From: Karel Zak Date: Mon, 2 Jul 2007 11:21:06 +0000 (+0200) Subject: build-sys: cleanup architecture conditionals X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e782f1d4000686207152dd31a12d67457a684ea5;p=util-linux build-sys: cleanup architecture conditionals This patch also add some new architectures for AM_CONDITIONAL(ARCH_ ...) Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index d63b99d8..aeb92b55 100644 --- a/configure.ac +++ b/configure.ac @@ -224,15 +224,24 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM( ]) -case "$host" in - i?86-*) intel=true ;; - m68*) m68k=true ;; - sparc*) sparc=true ;; -esac +dnl UTIL_SET_ARCH(ARCHNAME, PATTERN) +dnl --------------------------------- +AC_DEFUN([UTIL_SET_ARCH], [ + cpu_$1=false + case "$host" in + $2) cpu_$1=true ;; + esac + AM_CONDITIONAL(AS_TR_CPP(ARCH_$1), [test x$cpu_$1 = xtrue]) +]) -AM_CONDITIONAL(INTEL, test x$intel = xtrue) -AM_CONDITIONAL(M68K, test x$m68k = xtrue) -AM_CONDITIONAL(SPARC, test x$sparc = xtrue) +UTIL_SET_ARCH(I86, i?86-*) +UTIL_SET_ARCH(86_64, x86_64*) +UTIL_SET_ARCH(IA64, ia64*) +UTIL_SET_ARCH(S390, s390*) +UTIL_SET_ARCH(SPARC, sparc*) +UTIL_SET_ARCH(PPC, ppc*|powerpc*) +UTIL_SET_ARCH(M68K, m68*) +UTIL_SET_ARCH(MIPS, mips*) AC_ARG_ENABLE([agetty], diff --git a/fdisk/Makefile.am b/fdisk/Makefile.am index 9561fef2..c149263b 100644 --- a/fdisk/Makefile.am +++ b/fdisk/Makefile.am @@ -4,7 +4,7 @@ EXTRA_DIST = README.fdisk README.cfdisk sfdisk.examples partitiontype.c fdisk_common = disksize.c i386_sys_types.c common.h gpt.c gpt.h -if !M68K +if !ARCH_M68K sbin_PROGRAMS = fdisk man_MANS = fdisk.8 @@ -13,7 +13,7 @@ fdisk_SOURCES = fdisk.c fdiskbsdlabel.c fdisksgilabel.c \ fdisk.h fdisksunlabel.h fdisksgilabel.h fdiskaixlabel.h \ fdiskbsdlabel.h fdiskmaclabel.h $(fdisk_common) -if !SPARC +if !ARCH_SPARC sbin_PROGRAMS += sfdisk man_MANS += sfdisk.8 @@ -33,6 +33,6 @@ cfdisk_LDADD = -lncurses endif endif -endif # !SPARC -endif # !M68K +endif # !ARCH_SPARC +endif # !ARCH_M68K diff --git a/sys-utils/Makefile.am b/sys-utils/Makefile.am index 92730b18..096f6e80 100644 --- a/sys-utils/Makefile.am +++ b/sys-utils/Makefile.am @@ -20,7 +20,7 @@ info_TEXINFOS = ipc.texi if BUILD_RDEV -if INTEL +if ARCH_I86 usrsbinexec_PROGRAMS += rdev man_MANS += rdev.8 ramsize.8 rootflags.8 vidmode.8 RDEV_LINKS = ramsize vidmode rootflags