From 53e05b72500d8f6112f7af7b40b487e6486c920c Mon Sep 17 00:00:00 2001 From: netcrep Date: Tue, 8 Jul 1997 18:41:13 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2359 72102866-910b-0410-8b05-ffd578937521 --- aclocal.m4 | 16 +++++--- configure | 107 +++++++++++++++++++++++++++++++++++++-------------- configure.in | 4 +- 3 files changed, 92 insertions(+), 35 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index c64ae4a13..7a65f7898 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -164,6 +164,7 @@ dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_C_CROSS])dnl AC_MSG_CHECKING(for the Foundation library) +OBJC_LIBS= AC_CACHE_VAL(ac_cv_foundation_library, [AC_LANG_SAVE[]dnl AC_LANG_OBJECTIVE_C[] @@ -205,19 +206,19 @@ case "$FOUNDATION_LIBRARY" in # restore the value of prefix prefix=$old_prefix - LIBS="$LIBS -lFoundation_s"; + OBJC_LIBS="-lFoundation_s"; AC_DEFINE(NeXT_foundation_LIBRARY);; libobjects) - LIBS="$LIBS -lobjects" + OBJC_LIBS="-lobjects" AC_DEFINE(GNUSTEP_BASE_LIBRARY);; gnustep-base) - LIBS="$LIBS -lgnustep-base" + OBJC_LIBS="-lgnustep-base" AC_DEFINE(GNUSTEP_BASE_LIBRARY);; libFoundation) if test "$FOUNDATION_LIB" = ""; then FOUNDATION_LIB=Foundation fi - LIBS="-l${FOUNDATION_LIB} $LIBS" + OBJC_LIBS="-l${FOUNDATION_LIB}" AC_DEFINE(LIB_FOUNDATION_LIBRARY);; *) AC_MSG_ERROR(Unknown $FOUNDATION_LIBRARY library!);; @@ -246,13 +247,15 @@ AC_CACHE_VAL(ac_cv_objc_runtime, ], ac_cv_objc_runtime=NeXT, ac_cv_objc_runtime=unknown) if test $ac_cv_objc_runtime = unknown; then OBJC_RUNTIME_FLAG=-fgnu-runtime - LIBS="$LIBS -lobjc" + saved_LIBS=$LIBS + LIBS="$OBJC_LIBS -lobjc $LIBS" AC_TRY_LINK([#include #include ], [id class = objc_lookup_class("NSObject"); id obj = [class alloc]; puts([[obj description] cString]); ], ac_cv_objc_runtime=GNU, ac_cv_objc_runtime=unknown) + LIBS=$saved_LIBS fi AC_LANG_RESTORE[] fi @@ -262,7 +265,7 @@ if test "`echo ${OBJC_RUNTIME} | tr a-z A-Z`" = "GNU"; then OBJC_RUNTIME=GNU OBJC_RUNTIME_FLAG=-fgnu-runtime ac_cv_objc_runtime=GNU - LIBS="$LIBS -lobjc" + OBJC_LIBS="$OBJC_LIBS -lobjc" AC_DEFINE(GNU_RUNTIME) elif test "`echo ${OBJC_RUNTIME} | tr a-z A-Z`" = "NEXT"; then OBJC_RUNTIME=NeXT @@ -280,4 +283,5 @@ to specify some additional libraries needed to link an ObjC program, so please take a look in the config.log file to see the reason and try again.]) fi AC_MSG_RESULT(${ac_cv_objc_runtime}) +LIBS="$OBJC_LIBS $LIBS" ])dnl diff --git a/configure b/configure index 3a41ec49a..ff89e7deb 100755 --- a/configure +++ b/configure @@ -1194,14 +1194,14 @@ else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:1199: checking for pthread_create in -lpthread" >&5 -ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +echo $ac_n "checking for pthread_create in -lpcthread""... $ac_c" 1>&6 +echo "configure:1199: checking for pthread_create in -lpcthread" >&5 +ac_lib_var=`echo pcthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lpthread $LIBS" +LIBS="-lpcthread $LIBS" cat > conftest.$ac_ext <&6 - ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + ac_tr_lib=HAVE_LIB`echo pcthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +echo "configure:1244: checking for pthread_create in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/^a-zA-Z0-9_/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi +fi + echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6 -echo "configure:1246: checking for sqrt in -lm" >&5 +echo "configure:1293: checking for sqrt in -lm" >&5 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1250,7 +1297,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1292,7 +1339,8 @@ fi # Determine the Foundation library echo $ac_n "checking for the Foundation library""... $ac_c" 1>&6 -echo "configure:1296: checking for the Foundation library" >&5 +echo "configure:1343: checking for the Foundation library" >&5 +OBJC_LIBS= if eval "test \"`echo '$''{'ac_cv_foundation_library'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1303,7 +1351,7 @@ ac_compile='${CC-cc} -c $OBJC_RUNTIME_FLAG $CFLAGS conftest.$ac_ext 1>&5 2>&5' ac_link='${CC-cc} -o conftest $OBJC_RUNTIME_FLAG $CFLAGS $LDFLAGS conftest.$ac_ext $LIBS $OBJC_LIBS 1>&5 2>&5' cat > conftest.$ac_ext < @@ -1311,7 +1359,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_foundation_library="$ac_cv_foundation_library gnustep-base" else @@ -1320,7 +1368,7 @@ else fi rm -f conftest* cat > conftest.$ac_ext < @@ -1328,7 +1376,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_foundation_library="$ac_cv_foundation_library libFoundation" else @@ -1337,7 +1385,7 @@ else fi rm -f conftest* cat > conftest.$ac_ext < @@ -1345,7 +1393,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_foundation_library="$ac_cv_foundation_library libobjects" else @@ -1361,13 +1409,13 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross if test "$FOUNDATION" = ""; then cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1400,19 +1448,19 @@ case "$FOUNDATION_LIBRARY" in # restore the value of prefix prefix=$old_prefix - LIBS="$LIBS -lFoundation_s"; + OBJC_LIBS="-lFoundation_s"; cat >> confdefs.h <<\EOF #define NeXT_foundation_LIBRARY 1 EOF ;; libobjects) - LIBS="$LIBS -lobjects" + OBJC_LIBS="-lobjects" cat >> confdefs.h <<\EOF #define GNUSTEP_BASE_LIBRARY 1 EOF ;; gnustep-base) - LIBS="$LIBS -lgnustep-base" + OBJC_LIBS="-lgnustep-base" cat >> confdefs.h <<\EOF #define GNUSTEP_BASE_LIBRARY 1 EOF @@ -1421,7 +1469,7 @@ EOF if test "$FOUNDATION_LIB" = ""; then FOUNDATION_LIB=Foundation fi - LIBS="-l${FOUNDATION_LIB} $LIBS" + OBJC_LIBS="-l${FOUNDATION_LIB}" cat >> confdefs.h <<\EOF #define LIB_FOUNDATION_LIBRARY 1 EOF @@ -1431,7 +1479,7 @@ EOF esac echo "$ac_t""${ac_cv_foundation_library}" 1>&6 echo $ac_n "checking for the Objective-C runtime""... $ac_c" 1>&6 -echo "configure:1435: checking for the Objective-C runtime" >&5 +echo "configure:1483: checking for the Objective-C runtime" >&5 if eval "test \"`echo '$''{'ac_cv_objc_runtime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1443,7 +1491,7 @@ ac_compile='${CC-cc} -c $OBJC_RUNTIME_FLAG $CFLAGS conftest.$ac_ext 1>&5 2>&5' ac_link='${CC-cc} -o conftest $OBJC_RUNTIME_FLAG $CFLAGS $LDFLAGS conftest.$ac_ext $LIBS $OBJC_LIBS 1>&5 2>&5' cat > conftest.$ac_ext < int main() { @@ -1454,7 +1502,7 @@ extern id objc_lookUpClass(char*); ; return 0; } EOF -if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_objc_runtime=NeXT else @@ -1466,9 +1514,10 @@ fi rm -f conftest* if test $ac_cv_objc_runtime = unknown; then OBJC_RUNTIME_FLAG=-fgnu-runtime - LIBS="$LIBS -lobjc" + saved_LIBS=$LIBS + LIBS="$OBJC_LIBS -lobjc $LIBS" cat > conftest.$ac_ext < #include @@ -1479,7 +1528,7 @@ id class = objc_lookup_class("NSObject"); ; return 0; } EOF -if { (eval echo configure:1483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_objc_runtime=GNU else @@ -1489,6 +1538,7 @@ else ac_cv_objc_runtime=unknown fi rm -f conftest* + LIBS=$saved_LIBS fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1505,7 +1555,7 @@ if test "`echo ${OBJC_RUNTIME} | tr a-z A-Z`" = "GNU"; then OBJC_RUNTIME=GNU OBJC_RUNTIME_FLAG=-fgnu-runtime ac_cv_objc_runtime=GNU - LIBS="$LIBS -lobjc" + OBJC_LIBS="$OBJC_LIBS -lobjc" cat >> confdefs.h <<\EOF #define GNU_RUNTIME 1 EOF @@ -1529,6 +1579,7 @@ to specify some additional libraries needed to link an ObjC program, so please take a look in the config.log file to see the reason and try again." 1>&2; exit 1; } fi echo "$ac_t""${ac_cv_objc_runtime}" 1>&6 +LIBS="$OBJC_LIBS $LIBS" diff --git a/configure.in b/configure.in index 242fa4e3d..a9c64900e 100644 --- a/configure.in +++ b/configure.in @@ -93,7 +93,9 @@ AC_SUBST(config_include) # Checking for some additional libraries we might need AC_CHECK_LIB(dl, dlopen) -AC_CHECK_LIB(pthread, pthread_create) +AC_CHECK_LIB(pcthread, pthread_create, + , + AC_CHECK_LIB(pthread, pthread_create)) AC_CHECK_LIB(m, sqrt) # Determine the Foundation library