Use AC_USE_SYSTEM_EXTENSIONS
authorAndrew Deason <adeason@sinenomine.net>
Mon, 15 Mar 2010 17:41:11 +0000 (12:41 -0500)
committerDerrick Brashear <shadow@dementia.org>
Mon, 22 Mar 2010 22:15:56 +0000 (15:15 -0700)
Instead of defining various symbols like _XOPEN_SOURCE, _BSD_SOURCE, and
the like, just use autoconf's AC_USE_SYSTEM_EXTENSIONS to define all of
the appropriate symbols for us. Deal with some fallout by removing some
of the existing defines.

Change-Id: I1c1968c89cc2dfda1293fd2566dac8e266325a72
Reviewed-on: http://gerrit.openafs.org/1582
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
configure.in
src/cf/osconf.m4
src/lwp/iomgr.c
src/util/softsig.c

index 2b37105..e450150 100644 (file)
@@ -5,8 +5,8 @@ dnl NB: Because this code is a macro, references to positional shell
 dnl parameters must be done like $[]1 instead of $1
 
 AC_DEFUN([OPENAFS_CONFIGURE_COMMON],[
-AH_VERBATIM([OPENAFS_HEADER],
-[#undef HAVE_RES_SEARCH
+AH_BOTTOM([
+#undef HAVE_RES_SEARCH
 #undef STRUCT_SOCKADDR_HAS_SA_LEN
 #if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
 # if ENDIANESS_IN_SYS_PARAM_H
index 7ecc364..92f0d98 100644 (file)
@@ -10,6 +10,7 @@ AC_SUBST(MACOS_VERSION)
 AC_SUBST(LINUX_PKGVER)
 AC_SUBST(LINUX_PKGREL)
 
+AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_CC
 AC_PATH_PROGS([PATH_CPP], [cpp], [${CC-cc} -E], [$PATH:/lib:/usr/ccs/lib])
 AC_SUBST([PATH_CPP])
index 7b79844..2622cf7 100644 (file)
@@ -1084,18 +1084,6 @@ case $AFS_SYSNAME in
        ;;
 esac
 
-
-
-dnl pthreads fixes
-case $AFS_SYSNAME in
-dnl we'll go ahead and turn on XOPEN2K and ISO_C99
-dnl if this causes problems, we should scale back to _XOPEN_SOURCE=500
-       *linux*)
-               MT_CFLAGS="${MT_CFLAGS} -D_XOPEN_SOURCE=600 -D_BSD_SOURCE"
-       ;;
-esac
-
-
 dnl Disable the default for debugging/optimization if not enabled
 if test "x$enable_debug_kernel" = "xno"; then
   KERN_DBG=
index 7579813..fcdba04 100644 (file)
@@ -236,11 +236,12 @@ static struct IoRequest *NewRequest(void)
 #define FD_N_ZERO(nfds, x) memset((char*)(x), 0, (INTS_PER_FDS(nfds))*sizeof(int))
 #endif
 
-#if defined(AFS_LINUX22_ENV) && (__GLIBC_MINOR__ > 0)
-/* Build for both glibc 2.0.x and 2.1.x */
-#define FDS_BITS __fds_bits
+/* On Linux without __USE_XOPEN, we have __fds_bits. With __USE_XOPEN, or
+ * non-Linux, we have fds_bits. */
+#if defined(AFS_LINUX22_ENV) && (__GLIBC_MINOR__ > 0) && !defined(__USE_XOPEN)
+# define FDS_BITS __fds_bits
 #else
-#define FDS_BITS fds_bits
+# define FDS_BITS fds_bits
 #endif
 
 /* FDSetCmp - returns 1 if any bits in fd_set1 are also set in fd_set2.
index b318368..dd3db45 100644 (file)
@@ -12,7 +12,6 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-#define _POSIX_PTHREAD_SEMANTICS
 #include <afs/param.h>
 #include <assert.h>
 #include <stdlib.h>