From: Andrew Deason Date: Mon, 15 Mar 2010 17:41:11 +0000 (-0500) Subject: Use AC_USE_SYSTEM_EXTENSIONS X-Git-Tag: openafs-devel-1_5_73~25 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=129b6954a6f491c6f3c3e417055bdc68d4726408;p=packages%2Fo%2Fopenafs.git Use AC_USE_SYSTEM_EXTENSIONS 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 Tested-by: Derrick Brashear --- diff --git a/acinclude.m4 b/acinclude.m4 index 2b37105a2..e450150d9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/configure.in b/configure.in index 7ecc36414..92f0d9859 100644 --- a/configure.in +++ b/configure.in @@ -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]) diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 7b798445b..2622cf747 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -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= diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c index 7579813bf..fcdba046f 100644 --- a/src/lwp/iomgr.c +++ b/src/lwp/iomgr.c @@ -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. diff --git a/src/util/softsig.c b/src/util/softsig.c index b318368da..dd3db45c4 100644 --- a/src/util/softsig.c +++ b/src/util/softsig.c @@ -12,7 +12,6 @@ #include #include -#define _POSIX_PTHREAD_SEMANTICS #include #include #include