From: Ken Raeburn Date: Sun, 8 Aug 2004 22:35:02 +0000 (+0000) Subject: * aclocal.m4 (KRB5_AC_ENABLE_THREADS): Clear PTHREAD_CFLAGS and PTHREAD_LIBS X-Git-Tag: krb5-1.4-beta1~159 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=818624d17b78f8f3561e8c6b81a0c19c70ad2f23;p=krb5.git * aclocal.m4 (KRB5_AC_ENABLE_THREADS): Clear PTHREAD_CFLAGS and PTHREAD_LIBS after adding them to CFLAGS and LIBS respectively, to avoid duplicating the options later. (WITH_CC): Add -O on AIX also. Don't add options if similar options are already present. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16649 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ChangeLog b/src/ChangeLog index b843fdfb0..1271185cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,11 @@ 2004-08-08 Ken Raeburn * aclocal.m4 (KRB5_AC_ENABLE_THREADS): On AIX and OSF/1, always - add $PTHREAD_CFLAGS to CFLAGS for use in later tests. - (WITH_CC): If on AIX and not using gcc, add -qhalt=e to CFLAGS. + add $PTHREAD_CFLAGS to CFLAGS for use in later tests. Clear + PTHREAD_CFLAGS and PTHREAD_LIBS to avoid duplicating the options + later. + (WITH_CC): If on AIX and not using gcc, add -qhalt=e and -O to + CFLAGS if similar options are not already present. 2004-07-16 Ken Raeburn diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 1d106ddea..bfc465e65 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -151,7 +151,14 @@ if test "$enable_thread_support" = yes; then # AIX and Tru64 don't support weak references, and don't have # stub versions of the pthread code in libc. case "${host_os}" in - aix* | osf*) LIBS="$LIBS $PTHREAD_LIBS" ; CFLAGS="$CFLAGS $PTHREAD_CFLAGS" ;; + aix* | osf*) + # On these platforms, we'll always pull in the thread support. + LIBS="$LIBS $PTHREAD_LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + # We don't need to sometimes add the flags we've just folded in... + PTHREAD_LIBS= + PTHREAD_CFLAGS= + ;; esac fi dnl We want to know where these routines live, so on systems with weak @@ -574,8 +581,19 @@ else # Using AIX but not GCC, assume native compiler. # The native compiler appears not to give a nonzero exit # status for certain classes of errors, like missing arguments - # in function calls. Let's try to fix that. - CFLAGS="$CFLAGS -qhalt=e" + # in function calls. Let's try to fix that with -qhalt=e. + case "$CC $CFLAGS" in + *-qhalt=*) ;; + *) CFLAGS="$CFLAGS -qhalt=e" ;; + esac + # Also, the optimizer isn't turned on by default, which means + # the static inline functions get left in random object files, + # leading to references to pthread_mutex_lock from anything that + # includes k5-int.h whether it uses threads or not. + case "$CC $CFLAGS" in + *-O*) ;; + *) CFLAGS="$CFLAGS -O" ;; + esac fi fi ])dnl