summaryrefslogtreecommitdiff
path: root/source4/build/m4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-09-06 14:29:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:46 -0500
commit21ef15d703557cfa8c71b72df35c8d485b3c2ab0 (patch)
tree446e8ab4226cfc61386ccd02cf269f105dbb4421 /source4/build/m4
parent8ebc545e5799c7c0ff7adf05071f6072cb1c5c5d (diff)
downloadsamba-21ef15d703557cfa8c71b72df35c8d485b3c2ab0.tar.gz
samba-21ef15d703557cfa8c71b72df35c8d485b3c2ab0.tar.bz2
samba-21ef15d703557cfa8c71b72df35c8d485b3c2ab0.zip
r18179: - move CC specific stuff to check_cc.m4
- 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)
Diffstat (limited to 'source4/build/m4')
-rw-r--r--source4/build/m4/check_cc.m443
-rw-r--r--source4/build/m4/rewrite.m493
2 files changed, 102 insertions, 34 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4
index 4769d5087d..7f166ff641 100644
--- a/source4/build/m4/check_cc.m4
+++ b/source4/build/m4/check_cc.m4
@@ -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],
diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4
index 99d4bb177a..62804a8ca9 100644
--- a/source4/build/m4/rewrite.m4
+++ b/source4/build/m4/rewrite.m4
@@ -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