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.
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
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.])])
CFLAGS="$CFLAGS -fno-common"
;;
esac
+ case "$LD $LDFLAGS" in
+ *-Wl,-search_paths_first*) ;;
+ *) LDFLAGS="${LDFLAGS} -Wl,-search_paths_first" ;;
+ esac
fi
fi
])dnl