From: Harlan Stenn Date: Sat, 7 Aug 2004 11:22:03 +0000 (-0400) Subject: [Bug 166] Clean up Irix compile/link flags for 32/64 bits X-Git-Tag: NTP_4_2_3~137^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd3758fc4fb03994d8bc96642dcac21144aaf9af;p=thirdparty%2Fntp.git [Bug 166] Clean up Irix compile/link flags for 32/64 bits bk: 4114bb5bwuaUtOCi9dVqgzBA4cdN2w --- diff --git a/Makefile.am b/Makefile.am index 96918fc01d..b98665cdf6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ #AUTOMAKE_OPTIONS = util/ansi2knr foreign dist-tarZ no-dependencies AUTOMAKE_OPTIONS = util/ansi2knr foreign 1.5 +ACLOCAL_AMFLAGS= -I m4 SUBDIRS = \ scripts \ @@ -61,16 +62,18 @@ EXTRA_DIST = \ install-sh \ readme.y2kfixes \ results.y2kfixes \ + \ conf \ html \ libisc \ ports \ + \ version DISTCLEANFILES = .warning -#ETAGS_ARGS = $(srcdir)/Makefile.am $(srcdir)/configure.in -ETAGS_ARGS = Makefile.am configure.in +#ETAGS_ARGS = $(srcdir)/Makefile.am $(srcdir)/configure.ac +ETAGS_ARGS = Makefile.am configure.ac # HMS: make ports be the last directory... # DIST_HOOK_DIRS = conf html scripts ports diff --git a/configure.in b/configure.ac similarity index 99% rename from configure.in rename to configure.ac index f23a4e369a..fdd2a6df55 100644 --- a/configure.in +++ b/configure.ac @@ -46,6 +46,7 @@ case "$host" in LIBS="$LIBS -lcurses" ;; esac +AMU_OS_CFLAGS AC_CACHE_CHECK(if we should use /dev/clockctl, ac_clockctl, [AC_ARG_ENABLE(clockctl, @@ -136,25 +137,6 @@ case "$host" in ;; *-*-irix6*) # 6.2 (and later?) ac_busted_vpath_in_make=yes - # don't pass -n32 to gcc, it cannot handle and doesn't need it - if test "$GCC" != yes; then - case "$CFLAGS" in - *-n32*) ;; - *-n64*) ;; - *-64*) ;; - *) case "$iCFLAGS" in - '') CFLAGS="-O2 -g3 -n32" ;; - *) CFLAGS="$CFLAGS -n32" ;; - esac - ;; - esac - case "$LDFLAGS" in - *-n32*) ;; - *-n64*) ;; - *-64*) ;; - *) LDFLAGS="$LDFLAGS -n32" ;; - esac - fi ;; *-*-solaris2.5.1) ac_busted_vpath_in_make=yes diff --git a/acinclude.m4 b/m4/define_dir.m4 similarity index 70% rename from acinclude.m4 rename to m4/define_dir.m4 index 2b3f78d85b..48771760ad 100644 --- a/acinclude.m4 +++ b/m4/define_dir.m4 @@ -1,14 +1,3 @@ -AC_DEFUN([hs_ULONG_CONST], -[ AH_TEMPLATE(ULONG_CONST, [How do we create unsigned long constants?]) -AC_EGREP_CPP(Circus, - [#define ACAT(a,b)a ## b -ACAT(Cir,cus) -], AC_DEFINE([ULONG_CONST(a)], [a ## UL]), - AC_EGREP_CPP(Reiser, -[#define RCAT(a,b)a/**/b -RCAT(Rei,ser) -], AC_DEFINE([ULONG_CONST(a)], [a/**/L]), - AC_MSG_ERROR([How do we create an unsigned long constant?])))]) dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) dnl dnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR diff --git a/m4/hs_ulong_const.m4 b/m4/hs_ulong_const.m4 new file mode 100644 index 0000000000..b137cfdad0 --- /dev/null +++ b/m4/hs_ulong_const.m4 @@ -0,0 +1,11 @@ +AC_DEFUN([hs_ULONG_CONST], +[ AH_TEMPLATE(ULONG_CONST, [How do we create unsigned long constants?]) +AC_EGREP_CPP(Circus, + [#define ACAT(a,b)a ## b +ACAT(Cir,cus) +], AC_DEFINE([ULONG_CONST(a)], [a ## UL]), + AC_EGREP_CPP(Reiser, +[#define RCAT(a,b)a/**/b +RCAT(Rei,ser) +], AC_DEFINE([ULONG_CONST(a)], [a/**/L]), + AC_MSG_ERROR([How do we create an unsigned long constant?])))]) diff --git a/m4/os_cflags.m4 b/m4/os_cflags.m4 new file mode 100644 index 0000000000..3746ba86d3 --- /dev/null +++ b/m4/os_cflags.m4 @@ -0,0 +1,86 @@ +dnl ###################################################################### +dnl Specify additional compile options based on the OS and the compiler +dnl From Erez Zadok , http://www.am-utils.org +AC_DEFUN([AMU_OS_CFLAGS], +[ +AC_CACHE_CHECK(additional compiler flags, +ac_cv_os_cflags, +[ +case "${host_os}" in + irix6* ) + case "${CC}" in + cc ) + # do not use 64-bit compiler + ac_cv_os_cflags="-n32 -mips3 -Wl,-woff,84" + ;; + esac + ;; + osf[[1-3]]* ) + # get the right version of struct sockaddr + case "${CC}" in + cc ) + ac_cv_os_cflags="-std -D_SOCKADDR_LEN -D_NO_PROTO" + ;; + * ) + ac_cv_os_cflags="-D_SOCKADDR_LEN -D_NO_PROTO" + ;; + esac + ;; + osf* ) + # get the right version of struct sockaddr + case "${CC}" in + cc ) + ac_cv_os_cflags="-std -D_SOCKADDR_LEN" + ;; + * ) + ac_cv_os_cflags="-D_SOCKADDR_LEN" + ;; + esac + ;; + aix[[1-3]]* ) + ac_cv_os_cflags="" ;; + aix4.[[0-2]]* ) + # turn on additional headers + ac_cv_os_cflags="-D_XOPEN_EXTENDED_SOURCE" + ;; + aix* ) + # avoid circular dependencies in yp headers + ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE" + ;; + OFF-sunos4* ) + # make sure passing whole structures is handled in gcc + case "${CC}" in + gcc ) + ac_cv_os_cflags="-fpcc-struct-return" + ;; + esac + ;; + sunos[[34]]* | solaris1* | solaris2.[[0-5]]* | sunos5.[[0-5]]* ) + ac_cv_os_cflags="" ;; + solaris* | sunos* ) + # turn on 64-bit file offset interface + case "${CC}" in + * ) + ac_cv_os_cflags="-D_LARGEFILE64_SOURCE" + ;; + esac + ;; + hpux* ) + # use Ansi compiler on HPUX + case "${CC}" in + cc ) + ac_cv_os_cflags="-Ae" + ;; + esac + ;; + darwin* | rhapsody* ) + ac_cv_os_cflags="-D_P1003_1B_VISIBLE" + ;; + * ) + ac_cv_os_cflags="" + ;; +esac +]) +CFLAGS="$CFLAGS $ac_cv_os_cflags" +]) +dnl ======================================================================