dnl sxe-arch.m4 -- Architecture specific stuff AC_DEFUN([SXE_CHECK_MACHARCH], [dnl dnl ------------------------------ dnl Determine the s&m files to use dnl ------------------------------ dnl Given the configuration name, set machfile and opsysfile to the dnl names of the m/*.h and s/*.h files we should use. dnl If you add support for a new configuration, add code to this dnl switch statement to recognize your configuration name and select dnl the appropriate operating system and machine description files. dnl You would hope that you could choose an m/*.h file pretty much dnl based on the machine portion of the configuration name, and an s- dnl file based on the operating system portion. However, it turns out dnl that each m/*.h file is pretty manufacturer-specific - for dnl example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are dnl all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS dnl machines. So we basically have to have a special case for each dnl configuration name. dnl As far as handling version numbers on operating systems is dnl concerned, make sure things will fail in a fixable way. If dnl /etc/MACHINES says nothing about version numbers, be dnl prepared to handle anything reasonably. If version numbers dnl matter, be sure /etc/MACHINES says something about it. dnl Eric Raymond says we should accept strings like "sysvr4" to mean dnl "System V Release 4"; he writes, "The old convention encouraged" dnl "confusion between `system' and `release' levels'." machine='' opsys='' LDD="ldd" dnl Straightforward machine determination case "$ac_cv_build" in sparc-*-* ) machine=sparc ;; alpha*-*-* ) machine=alpha ;; vax-*-* ) machine=vax ;; mips-dec-* ) machine=pmax ;; mips-sgi-irix6* ) machine=iris6d ;; mips-sgi-* ) machine=iris4d ;; mips*-linux ) machine=mips ;; romp-ibm-* ) machine=ibmrt ;; rs6000-ibm-aix* ) machine=ibmrs6000 ;; powerpc-ibm-aix* ) machine=ibmrs6000 ;; powerpc*-* ) machine=powerpc ;; macppc*-* ) machine=powerpc ;; hppa-*-* ) machine=hp800 ;; m88k-dg-* ) machine=aviion ;; m68*-sony-* ) machine=news ;; mips-sony-* ) machine=news-risc ;; clipper-* ) machine=clipper ;; arm* ) machine=arm ;; ns32k-* ) machine=ns32000 ;; esac dnl Straightforward OS determination case "$ac_cv_build" in *-*-linux* ) opsys=linux ;; *-*-netbsd* ) opsys=netbsd ;; *-*-openbsd* ) opsys=openbsd ;; *-*-freebsd* ) opsys=freebsd ;; *-*-nextstep* ) opsys=nextstep ;; *-*-vms ) opsys=vms ;; dnl DEC OSF *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;; *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;; *-dec-osf3.[[2-9]] ) opsys=decosf3-2 ;; *-dec-osf3* ) opsys=decosf3-1 ;; *-dec-osf[[4-9]]* ) opsys=decosf4-0 ;; dnl DEC Ultrix *-*-ultrix[[0-3]].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;; *-*-ultrix4.[[12]]* ) opsys=bsd4-3 ;; dnl AIX *-*-aix3.1* ) opsys=aix3-1 ;; *-*-aix3.2.5 ) opsys=aix3-2-5 ;; *-*-aix3* ) opsys=aix3-2 ;; *-*-aix4.0* ) opsys=aix4 ;; *-*-aix4.1* ) opsys=aix4-1 ;; *-*-aix[[4-9]]* ) opsys=aix4-2 ;; dnl Other generic OSes *-gnu* ) opsys=gnu ;; *-*-bsd4.[[01]] ) opsys=bsd4-1 ;; *-*-bsd4.2 ) opsys=bsd4-2 ;; *-*-bsd4.3 ) opsys=bsd4-3 ;; *-*-aos4.2 ) opsys=bsd4-2 ;; *-*-aos* ) opsys=bsd4-3 ;; *-*-sysv0 | *-*-sysvr0 ) opsys=usg5-0 ;; *-*-sysv2 | *-*-sysvr2 ) opsys=usg5-2 ;; *-*-sysv2.2 | *-*-sysvr2.2 ) opsys=usg5-2-2 ;; *-*-sysv3* | *-*-sysvr3* ) opsys=usg5-3 ;; *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;; *-*-sysv4.[[2-9]]* | *-sysvr4.[[2-9]]* ) if test -z "$NON_GNU_CPP" ; then for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do if test -f "$prog"; then NON_GNU_CPP="$prog" break fi done fi opsys=usg5-4-2 ;; *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;; *-*-mach_bsd4.3* ) opsys=mach-bsd4-3 ;; esac case "$ac_cv_build" in dnl NetBSD ports *-*-netbsd* ) case "ac_cv_build" in i[[3-9]]86-*-netbsd* ) machine=intel386 ;; hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* ) dnl Yes, this is somewhat bogus. machine=hp9000s300 ;; pc532-*-netbsd* | ns32k-*-netbsd* ) machine=ns32000 ;; pmax-*-netbsd* | mips-*-netbsd* ) machine=pmax ;; macppc-*-netbsd* | powerpc-*-netbsd* ) machine=powerpc ;; esac ;; dnl OpenBSD ports *-*-openbsd* ) case "${ac_cv_build}" in i386-*-openbsd*) machine=intel386 ;; m68k-*-openbsd*) machine=hp9000s300 ;; mipsel-*-openbsd*) machine=pmax ;; macppc-*-openbsd* | powerpc-*-openbsd* ) machine=powerpc ;; esac ;; dnl FreeBSD ports *-*-freebsd* ) case "${ac_cv_build}" in i386-*-freebsd* ) machine=intel386 ;; powerpc-*-freebsd* ) machine=powerpc ;; esac ;; dnl Darwin, a.k.a. MacOS X (based on Mach and Freebsd) *-*-darwin*) opsys=darwin LDD="otool -XL" ;; dnl HP 9000 series 200 or 300 m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;; dnl HP-UX *-hp-hpux* ) dnl Figure out machine and opsys orthogonally case "$ac_cv_build" in m68* ) machine=hp9000s300 ;; hppa* ) machine=hp800 ;; esac case "$ac_cv_build" in *-hp-hpux7* ) opsys=hpux ;; *-hp-hpux8* ) opsys=hpux8 ;; *-hp-hpux9* ) opsys=hpux9 ;; *-hp-hpux10* ) opsys=hpux10 ;; *-hp-hpux11* ) opsys=hpux11 ;; * ) opsys=hpux ;; esac dnl HP has a broken "strcat" case "$opsys" in hpux9 | hpux10 ) SXE_ADD_CRUFT_OBJS([strcat.o]) ;; esac if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \ ansi_flag="-Ae"; else ansi_flag="-Aa"; fi NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E" case "$ac_cv_build" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac ;; dnl Prime EXL i[[3-9]]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;; dnl Intel 860 i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;; dnl NeXT m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;; dnl Silicon Graphics machines dnl Iris 2500 and Iris 2500 Turbo (aka the Iris 3030) m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;; m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;; dnl Iris 4D mips-sgi-irix3.* ) opsys=irix3-3 ;; mips-sgi-irix4.* ) opsys=irix4-0 ;; mips-sgi-irix6* ) opsys=irix6-0 ;; mips-sgi-irix5.1* ) opsys=irix5-1 ;; mips-sgi-irix5.2* ) opsys=irix5-2 ;; mips-sgi-irix5.* ) opsys=irix5-3 ;; mips-sgi-irix* ) opsys=irix5-0 ;; dnl SONY machines *-sony-newsos[[34]]* | *-sony-news[[34]]* ) opsys=bsd4-3 ;; *-sony-news* ) opsys=newsos5 ;; dnl Suns *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* ) dnl Hardware type case "$ac_cv_build" in m68*-sunos1* ) machine=sun1 ;; m68*-sunos2* ) machine=sun2 ;; m68* ) machine=sun3 ;; i*86*-sun-sunos[[34]]* ) machine=sun386 ;; i*86-*-* ) machine=intel386 ;; rs6000* ) machine=rs6000 ;; esac dnl Make $canonical even more so. case "$ac_cv_build" in *-sunos5*) ac_cv_build=`echo $ac_cv_build | sed -e s/sunos5/solaris2/`;; esac case "$ac_cv_build" in *-solaris* ) opsys=sol2 os_release_major=`uname -r | sed -e 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).*/\1/'` os_release_minor=`uname -r | sed -e 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).*/\2/'` case "$os_release_minor" in [[0-9]]) os_release_minor="0${os_release_minor}";; esac os_release="${os_release_major}${os_release_minor}" AC_DEFINE_UNQUOTED([OS_RELEASE], [$os_release], [Description here!]) ;; dnl The last Sun386 ran 4.0. i*86-*-sunos4* ) opsys=sunos4-0 ;; *-sunos4.0* ) opsys=sunos4-0 ;; *-sunos4.1.2* ) opsys=sunos4-1-2 ;; *-sunos4.1.3* ) opsys=sunos4-1-3 ;; *-sunos4.1.[[4-9]]* ) opsys=sunos4-1-4 ;; *-sunos4* | *-sunos ) opsys=sunos4-1 ;; *-mach* ) opsys=mach-bsd4-3 ;; * ) opsys=bsd4-2 ;; esac case "$ac_cv_build" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac ;; dnl Vaxen. vax-dec-* ) case "$ac_cv_build" in *-sysv[[01]]* | *-sysvr[[01]]* ) opsys=usg5-0 ;; *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;; *-mach* ) opsys=mach-bsd4-3 ;; esac ;; dnl Intel 386 machines where we do not care about the manufacturer i[[3-9]]86-*-* ) machine=intel386 case "$ac_cv_build" in *-isc1.* | *-isc2.[[01]]* ) opsys=386-ix ;; *-isc2.2* ) opsys=isc2-2 ;; *-isc4.0* ) opsys=isc4-0 ;; *-isc4.* ) opsys=isc4-1 GCC_TEST_OPTIONS=-posix NON_GCC_TEST_OPTIONS=-Xp ;; *-isc* ) opsys=isc3-0 ;; *-esix5* ) opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;; *-esix* ) opsys=esix ;; *-mach* ) opsys=mach-bsd4-3 ;; *-sco3.2v4* ) opsys=sco4 NON_GNU_CPP=/lib/cpp ;; *-bsd386* | *-bsdi1* ) opsys=bsd386 ;; *-bsdi4* ) opsys=bsdos4 ;; *-bsdi3* ) opsys=bsdos3 ;; *-bsdi2.1* ) opsys=bsdos2-1 ;; *-bsdi2* ) opsys=bsdos2 ;; *-sco3.2v5* ) opsys=sco5 ;; *-sysv5* ) opsys=sco7 ;; *-386bsd* ) opsys=386bsd ;; *-freebsd* ) opsys=freebsd ;; *-nextstep* ) opsys=nextstep ;; esac ;; dnl Linux/68k m68k-*-linux* ) machine=m68k opsys=linux ;; esac dnl Initialize machine from $canonical if not in our database above. test -z "$machine" && machine=`echo $ac_cv_build | sed 's/-.*$//'` dnl Initialize opsys from `uname -s` if not in our database above. test -z "$opsys" && opsys=`uname -s | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` dnl Use configure-time autodetection if s&m not available if test -r "${sxe_srcdir}/src/m/${machine}.h"; then machfile="m/${machine}.h" AC_DEFINE_UNQUOTED([config_machfile], ["$machfile"], [Description here!]) else echo "SXEmacs has no builtin knowledge of \`$machine' machines." echo "Using configure-time autodetection only." fi if test -r "${sxe_srcdir}/src/s/${opsys}.h"; then opsysfile="s/${opsys}.h" AC_DEFINE_UNQUOTED([config_opsysfile], ["$opsysfile"], [Description here!]) else echo "SXEmacs has no builtin knowledge of \`$opsys' operating systems." echo "Using configure-time autodetection only." fi ])dnl SXE_CHECK_MACHARCH dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE) define([CPP_to_sh], [[#]ifndef [$1] [#]define [$1]ifelse([$3],,, [ "$3"]) [#]endif configure___ [$2]=[$1] ])dnl CPP_to_sh dnl CPP_boolean_to_sh(CPP_SYMBOL, SH_VAR) define([CPP_boolean_to_sh], [[#]ifdef [$1] configure___ [$2]=yes [#]else configure___ [$2]=no [#]endif ])dnl CPP_boolean_to_sh AC_DEFUN([SXE_EXTRACT_MACHARCH_INFO], [dnl dnl It is not important that this name contain the PID; you cannot run dnl two configures in the same directory and have anything work dnl anyway. tempcname="conftest.c" cat > $tempcname < confdefs.h cat >> $tempcname <