]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 166] Clean up Irix compile/link flags for 32/64 bits
authorHarlan Stenn <stenn@ntp.org>
Sat, 7 Aug 2004 11:22:03 +0000 (07:22 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 7 Aug 2004 11:22:03 +0000 (07:22 -0400)
bk: 4114bb5bwuaUtOCi9dVqgzBA4cdN2w

Makefile.am
configure.ac [moved from configure.in with 99% similarity]
m4/define_dir.m4 [moved from acinclude.m4 with 70% similarity]
m4/hs_ulong_const.m4 [new file with mode: 0644]
m4/os_cflags.m4 [new file with mode: 0644]

index 96918fc01dd05ffd396b16965e4fbffd78361639..b98665cdf6a96faf42f40cbd15ecd6e31c17b5ae 100644 (file)
@@ -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
similarity index 99%
rename from configure.in
rename to configure.ac
index f23a4e369a2c737ea598f23ce4c616bc7524bd53..fdd2a6df55032364d97e70fe37dbc005e8eccfcf 100644 (file)
@@ -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
similarity index 70%
rename from acinclude.m4
rename to m4/define_dir.m4
index 2b3f78d85bcdef99e816b1a32365dff99bf6bd78..48771760ad551da4187d7dfb3cac459d23fe6e7e 100644 (file)
@@ -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 (file)
index 0000000..b137cfd
--- /dev/null
@@ -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 (file)
index 0000000..3746ba8
--- /dev/null
@@ -0,0 +1,86 @@
+dnl ######################################################################
+dnl Specify additional compile options based on the OS and the compiler
+dnl From Erez Zadok <ezk@cs.sunysb.edu>, 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 ======================================================================