r18179: - move CC specific stuff to check_cc.m4
authorStefan Metzmacher <metze@samba.org>
Wed, 6 Sep 2006 14:29:57 +0000 (14:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:17:46 +0000 (14:17 -0500)
- add some AC_DEFINES to rewrite.m4
  (I'll remove them from check_ld.m4 soon)
  (I've also merged new values from samba3)

metze
(This used to be commit de0c8d1b1729daef984d5b44e0224481cf9e2164)

source4/build/m4/check_cc.m4
source4/build/m4/rewrite.m4

index 4769d5087d5437f54fe7781a6601395ee20d534d..7f166ff641c8555a5050cb14824302122696b313 100644 (file)
@@ -198,6 +198,49 @@ if test -n "$DEVELOPER_CFLAGS"; then
        CFLAGS="${OLD_CFLAGS}"
 fi
 
+#
+# Config CPPFLAG settings for strange OS's that must be set
+# before other tests.
+#
+case "$host_os" in
+       # Try to work out if this is the native HPUX compiler that uses the -Ae flag.
+       *hpux*)
+               AC_PROG_CC_FLAG(Ae)
+               # mmap on HPUX is completely broken...
+               AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
+               if test $ac_cv_prog_cc_Ae = yes; then
+                       CPPFLAGS="$CPPFLAGS -Ae"
+               fi
+               ;;
+
+       *aix*)
+               if test "${GCC}" != "yes"; then
+                       ## for funky AIX compiler using strncpy()
+                       CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
+               fi
+               ;;
+
+       #
+       # VOS may need to have POSIX support and System V compatibility enabled.
+       #
+       *vos*)
+               case "$CPPFLAGS" in
+                       *-D_POSIX_C_SOURCE*);;
+                       *)
+                               CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
+                               AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Whether to enable POSIX support])
+                               ;;
+               esac
+               case "$CPPFLAGS" in
+                       *-D_SYSV*|*-D_SVID_SOURCE*);;
+                       *)
+                               CPPFLAGS="$CPPFLAGS -D_SYSV"
+                               AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
+                               ;;
+               esac
+               ;;
+esac
+
 # allow for --with-hostcc=gcc
 AC_ARG_WITH(hostcc,[  --with-hostcc=compiler    choose host compiler],
 [HOSTCC=$withval],
index 99d4bb177ab8167ae576e3e1a03827633dd74bbe..62804a8ca917aaee7e34acb2c7f78f4807d88c1d 100644 (file)
@@ -1,42 +1,67 @@
 AC_SYS_LARGEFILE
 
-#
-# Config CPPFLAG settings for strange OS's that must be set
-# before other tests.
-#
 case "$host_os" in
-# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
-    *hpux*)    
-      AC_PROG_CC_FLAG(Ae)
-      # mmap on HPUX is completely broken...
-      AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
-      if test $ac_cv_prog_cc_Ae = yes; then
-        CPPFLAGS="$CPPFLAGS -Ae"
-      fi
-    ;;
-#
-# VOS may need to have POSIX support and System V compatibility enabled.
-#
-    *vos*)
-          case "$CPPFLAGS" in
-             *-D_POSIX_C_SOURCE*)
-               ;;
-         *)
-               CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
-               AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Whether to enable POSIX support])
-               ;;
-          esac
-          case "$CPPFLAGS" in
-            *-D_SYSV*|*-D_SVID_SOURCE*)
-               ;;
-            *)
-               CPPFLAGS="$CPPFLAGS -D_SYSV"
-               AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
-          esac
-    ;;
-
+       *linux*)   AC_DEFINE(LINUX,1,[Whether the host os is linux])
+               ;;
+       *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris])
+               AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
+               ;;
+       *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
+               AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
+               ;;
+       *netbsd* | *freebsd* | *dragonfly* )  
+               AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
+               ;;
+       *openbsd*)
+               AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
+               ;;
+       *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
+               case "$host_os" in
+               *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
+               ;;
+               esac
+               ;;
+       *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
+               AC_DEFINE(BROKEN_STRNLEN,1,[Does strnlen work correctly])
+               AC_DEFINE(BROKEN_STRNDUP,1,[Does strndup work correctly])
+               ;;
+       *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
+               ;;
+       *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx])
+               ;;
+       *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
+               AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
+               ;;
+       *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
+               ;;
+       *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
+               ;;
+       *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2])
+               ;;
+       *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
+               ;;
+       *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
+               case "$host" in
+                       *-univel-*)
+                               if [ test "$GCC" != yes ]; then
+                                       AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
+                               fi
+                               ;;
+                       *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);;
+               esac
+               ;;
+       *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
+               if [ test "$GCC" != yes ]; then
+                       AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
+               fi
+               ;;
+       *vos*)
+               ;;
+       *darwin*)   AC_DEFINE(DARWINOS,1,[Whether the host os is Darwin/MacOSX])
+               ;;
 esac
 
+
 AC_CHECK_HEADERS(stdarg.h string.h)
 
 AC_TYPE_SIGNAL