* aclocal.m4 (WITH_CC): Use -Wl,-search_paths_first for linking on Darwin.
authorKen Raeburn <raeburn@mit.edu>
Sat, 19 Jun 2004 00:21:48 +0000 (00:21 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 19 Jun 2004 00:21:48 +0000 (00:21 +0000)
(KRB5_AC_ENABLE_THREADS): On AIX, add PTHREAD_LIBS to LIBS; don't do it on
other platforms.  Override CC with PTHREAD_CC only if CC is not gcc.  Don't add
PTHREAD_CFLAGS to CFLAGS; substitute PTHREAD_CFLAGS separately.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16493 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4

index 80b492bb37c63db4d4c3192a6df05274315bb737..519292220a3c0bff29dacc85031ce2a80adb6640 100644 (file)
@@ -1,5 +1,12 @@
 2004-06-18  Ken Raeburn  <raeburn@mit.edu>
 
+       * aclocal.m4 (WITH_CC): Use -Wl,-search_paths_first for linking on
+       Darwin.
+       (KRB5_AC_ENABLE_THREADS): On AIX, add PTHREAD_LIBS to LIBS; don't
+       do it on other platforms.  Override CC with PTHREAD_CC only if CC
+       is not gcc.  Don't add PTHREAD_CFLAGS to CFLAGS; substitute
+       PTHREAD_CFLAGS separately.
+
        * Makefile.in (all-windows): Make autoconf.h in include\krb5
        before building anything else.
        (WINMAKEFILES): Add util\support\Makefile.
index 85a1e0297e6228e26bc07d995547eaa5b478307d..97ddb190b7f45ed5c118348fc2d0d81f5f9dcf46 100644 (file)
@@ -149,6 +149,9 @@ AC_MSG_NOTICE(PTHREAD_CFLAGS = $PTHREAD_CFLAGS)
 AC_MSG_NOTICE(PTHREAD_LIBS = $PTHREAD_LIBS)
 dnl Not really needed -- if pthread.h isn't found, ACX_PTHREAD will fail.
 AC_CHECK_HEADERS(pthread.h)
+case "${host_os}" in
+  aix*) LIBS="$LIBS $PTHREAD_LIBS" ;;
+esac
 fi
 dnl We want to know where these routines live, so on systems with weak
 dnl reference support we can figure out whether or not the pthread library
@@ -156,11 +159,12 @@ dnl has been linked in.
 dnl If we don't add any libraries for thread support, don't bother.
 AC_CHECK_FUNCS(pthread_once pthread_mutexattr_setrobust_np)
 old_CC="$CC"
-test "$PTHREAD_CC" != "" && CC=$PTHREAD_CC
+test "$PTHREAD_CC" != "" && test "$ac_cv_c_compiler_gnu" = no && CC=$PTHREAD_CC
 old_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+AC_SUBST(PTHREAD_CFLAGS)
 old_LIBS="$LIBS"
-LIBS="$PTHREAD_LIBS $LIBS"
+#LIBS="$PTHREAD_LIBS $LIBS"
 AC_MSG_NOTICE(rechecking with PTHREAD_... options)
 AC_CHECK_LIB(c, pthread_mutexattr_setrobust_np,
   [AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP_IN_THREAD_LIB,1,[Define if pthread_mutexattr_setrobust_np is provided in the thread library.])])
@@ -545,6 +549,10 @@ if test "$GCC" = yes ; then
       CFLAGS="$CFLAGS -fno-common"
       ;;
     esac
+    case "$LD $LDFLAGS" in
+    *-Wl,-search_paths_first*) ;;
+    *) LDFLAGS="${LDFLAGS} -Wl,-search_paths_first" ;;
+    esac
   fi
 fi
 ])dnl