svn commit: samba r18479 - in
branches/SAMBA_4_0/source/lib/replace: .
metze at samba.org
metze at samba.org
Wed Sep 13 16:15:39 GMT 2006
Author: metze
Date: 2006-09-13 16:15:38 +0000 (Wed, 13 Sep 2006)
New Revision: 18479
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18479
Log:
start hiding libreplace configure tests behind macros
AC_LIBREPLACE_CC_CHECKS
AC_LIBREPLACE_BROKEN_CHECKS
and
AC_LIBREPLACE_ALL_CHECKS
which calls the 2 others
I'll add some more, so that samba3/samba4 can later call
them in the wanted order and all standalone builds
use AC_LIBREPLACE_ALL_CHECKS.
metze
Added:
branches/SAMBA_4_0/source/lib/replace/libreplace_cc.m4
Modified:
branches/SAMBA_4_0/source/lib/replace/libreplace.m4
branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4
Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-13 15:54:08 UTC (rev 18478)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-13 16:15:38 UTC (rev 18479)
@@ -1,3 +1,7 @@
+AC_DEFUN_ONCE(AC_LIBREPLACE_BROKEN_CHECKS,
+[
+echo "LIBREPLACE_BROKEN_CHECKS: START"
+
dnl find the libreplace sources. This is meant to work both for
dnl libreplace standalone builds, and builds of packages using libreplace
libreplacedir=""
@@ -13,70 +17,6 @@
LIBREPLACEOBJ="${LIBREPLACEOBJ} snprintf.o"
-dnl stop the C89 attempt by autoconf - if autoconf detects -Ae it will enable it
-dnl which conflicts with C99 on HPUX
-ac_cv_prog_cc_Ae=no
-
-savedCFLAGS=$CFLAGS
-AC_PROG_CC
-CFLAGS=$savedCFLAGS
-AC_ISC_POSIX
-AC_USE_SYSTEM_EXTENSIONS
-AC_PROG_CC_C99
-AC_C_INLINE
-AC_C_BIGENDIAN
-AC_PROG_INSTALL
-
-AH_VERBATIM([_XOPEN_SOURCE_EXTENDED],
-[/* Enable XOPEN extensions on systems that have them. */
-#ifndef _XOPEN_SOURCE_EXTENDED
-# define _XOPEN_SOURCE_EXTENDED 1
-#endif])
-
-AH_VERBATIM([_OSF_SOURCE],
-[/* Enable OSF extensions on systems that have them. */
-#ifndef _OSF_SOURCE
-# define _OSF_SOURCE 1
-#endif])
-
-LIBREPLACE_C99_STRUCT_INIT([],[])
-
-AC_SYS_LARGEFILE
-
-dnl Add #include for broken IRIX header files
-case "$host_os" in
- *irix6*) AC_ADD_INCLUDE(<standards.h>)
- ;;
-esac
-
-AC_CHECK_HEADERS([standards.h])
-
-AC_CHECK_TYPE(uint_t, unsigned int)
-AC_CHECK_TYPE(int8_t, char)
-AC_CHECK_TYPE(uint8_t, unsigned char)
-AC_CHECK_TYPE(int16_t, short)
-AC_CHECK_TYPE(uint16_t, unsigned short)
-AC_CHECK_TYPE(int32_t, long)
-AC_CHECK_TYPE(uint32_t, unsigned long)
-AC_CHECK_TYPE(int64_t, long long)
-AC_CHECK_TYPE(uint64_t, unsigned long long)
-
-AC_CHECK_TYPE(size_t, unsigned int)
-AC_CHECK_TYPE(ssize_t, int)
-
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-
-AC_CHECK_SIZEOF(off_t)
-AC_CHECK_SIZEOF(size_t)
-AC_CHECK_SIZEOF(ssize_t)
-
-AC_CHECK_TYPE(intptr_t, unsigned long long)
-AC_CHECK_TYPE(ptrdiff_t, unsigned long long)
-
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
@@ -343,3 +283,24 @@
AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
[AC_MSG_ERROR([Required function not found])])
+
+echo "LIBREPLACE_BROKEN_CHECKS: END"
+]) dnl end AC_LIBREPLACE_BROKEN_CHECKS
+
+AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_START,
+[
+#LIBREPLACE_ALL_CHECKS: START"
+])
+AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_END,
+[
+#LIBREPLACE_ALL_CHECKS: END"
+])
+m4_define(AC_LIBREPLACE_ALL_CHECKS,
+[
+AC__LIBREPLACE_ALL_CHECKS_START
+AC_LIBREPLACE_CC_CHECKS
+AC_LIBREPLACE_BROKEN_CHECKS
+AC__LIBREPLACE_ALL_CHECKS_END
+])
+
+AC_LIBREPLACE_ALL_CHECKS
Added: branches/SAMBA_4_0/source/lib/replace/libreplace_cc.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/libreplace_cc.m4 2006-09-13 15:54:08 UTC (rev 18478)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace_cc.m4 2006-09-13 16:15:38 UTC (rev 18479)
@@ -0,0 +1,99 @@
+
+AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_START,
+[
+echo "LIBREPLACE_CC_CHECKS: START"
+])
+
+AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_END,
+[
+echo "LIBREPLACE_CC_CHECKS: END"
+])
+
+dnl
+dnl
+dnl AC_LIBREPLACE_CC_CHECKS
+dnl
+dnl Note: we need to use m4_define instead of AC_DEFUN because
+dnl of the ordering of tests
+dnl
+dnl
+m4_define(AC_LIBREPLACE_CC_CHECKS,
+[
+AC__LIBREPLACE_ONLY_CC_CHECKS_START
+
+dnl stop the C89 attempt by autoconf - if autoconf detects -Ae it will enable it
+dnl which conflicts with C99 on HPUX
+ac_cv_prog_cc_Ae=no
+
+savedCFLAGS=$CFLAGS
+AC_PROG_CC
+CFLAGS=$savedCFLAGS
+dnl AC_PROG_CPP
+dnl AC_PROG_EGREP
+dnl AC_GNU_SOURCE
+dnl AC_AIX
+dnl AC_MINIX
+dnl AC_GNU_SOURCE
+dnl AC_INCLUDES_DEFAULT
+dnl AC_USE_SYSTEM_EXTENSIONS
+dnl AC_INCLUDES_DEFAULT
+dnl AC_HEADER_STDC
+AC_ISC_POSIX
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_CC_C99
+AC_C_INLINE
+AC_C_BIGENDIAN
+AC_PROG_INSTALL
+
+AH_VERBATIM([_XOPEN_SOURCE_EXTENDED],
+[/* Enable XOPEN extensions on systems that have them. */
+#ifndef _XOPEN_SOURCE_EXTENDED
+# define _XOPEN_SOURCE_EXTENDED 1
+#endif])
+
+AH_VERBATIM([_OSF_SOURCE],
+[/* Enable OSF extensions on systems that have them. */
+#ifndef _OSF_SOURCE
+# define _OSF_SOURCE 1
+#endif])
+
+LIBREPLACE_C99_STRUCT_INIT([],[AC_MSG_WARN([c99 structure initializer are not supported])])
+
+AC_SYS_LARGEFILE
+
+dnl Add #include for broken IRIX header files
+case "$host_os" in
+ *irix6*) AC_ADD_INCLUDE(<standards.h>)
+ ;;
+esac
+
+AC_CHECK_HEADERS([standards.h])
+
+AC_CHECK_TYPE(uint_t, unsigned int)
+AC_CHECK_TYPE(int8_t, char)
+AC_CHECK_TYPE(uint8_t, unsigned char)
+AC_CHECK_TYPE(int16_t, short)
+AC_CHECK_TYPE(uint16_t, unsigned short)
+AC_CHECK_TYPE(int32_t, long)
+AC_CHECK_TYPE(uint32_t, unsigned long)
+AC_CHECK_TYPE(int64_t, long long)
+AC_CHECK_TYPE(uint64_t, unsigned long long)
+
+AC_CHECK_TYPE(size_t, unsigned int)
+AC_CHECK_TYPE(ssize_t, int)
+
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(ssize_t)
+
+AC_CHECK_TYPE(intptr_t, unsigned long long)
+AC_CHECK_TYPE(ptrdiff_t, unsigned long long)
+
+AC__LIBREPLACE_ONLY_CC_CHECKS_END
+]) dnl end AC_LIBREPLACE_CC_CHECKS
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4 2006-09-13 15:54:08 UTC (rev 18478)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4 2006-09-13 16:15:38 UTC (rev 18479)
@@ -251,4 +251,6 @@
EOF
])
+m4_include(libreplace_cc.m4)
m4_include(autoconf-2.60.m4)
+
More information about the samba-cvs
mailing list