diff --git a/ChangeLog b/ChangeLog index 3ad55942..fd44c05f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-04-25 Adam Fedor + + * configure.in: Check OBJC_RUNTIME_LIB from library_combo and set + NeXT_RUNTIME if appropriate (only for thread test). + * config_thread.m: Don't include NSConstStr if NeXT_RUNTIME. + 2001-04-25 Richard Frith-Macdonald * documentation.make: Revert last change ... it broke javadoc makes diff --git a/config_thread.m b/config_thread.m index 527aa4b0..891d433c 100644 --- a/config_thread.m +++ b/config_thread.m @@ -1,9 +1,11 @@ /* Test whether Objective-C runtime was compiled with thread support */ +#ifndef NeXT_RUNTIME /* Dummy NXConstantString impl for so libobjc that doesn't include it */ #include @implementation NXConstantString @end +#endif /* From thr.c */ extern int __objc_init_thread_system(void); diff --git a/configure b/configure index 9426441a..18db4209 100755 --- a/configure +++ b/configure @@ -1116,6 +1116,8 @@ if test "$ac_cv_library_combo" = ""; then fi +OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | tr '-' ' ' | awk '{print $1}'` + #-------------------------------------------------------------------- # specific target_os options #-------------------------------------------------------------------- @@ -1128,12 +1130,12 @@ esac # Determine the host, build, and target systems #-------------------------------------------------------------------- echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1132: checking for Cygwin environment" >&5 +echo "configure:1134: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1161,19 +1163,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1165: checking for mingw32 environment" >&5 +echo "configure:1167: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1192,7 +1194,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1196: checking for executable suffix" >&5 +echo "configure:1198: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1202,7 +1204,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1223,13 +1225,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1227: checking for object suffix" >&5 +echo "configure:1229: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1270,7 +1272,7 @@ if test "x$target" != "x$host"; then # Extract the first word of ""${targetArgument}-gcc"", so it can be a program name with args. set dummy "${targetArgument}-gcc"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1274: checking for $ac_word" >&5 +echo "configure:1276: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1300,7 +1302,7 @@ fi # Extract the first word of ""${targetArgument}-ranlib"", so it can be a program name with args. set dummy "${targetArgument}-ranlib"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1304: checking for $ac_word" >&5 +echo "configure:1306: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1330,7 +1332,7 @@ fi # Extract the first word of ""${targetArgument}-ar"", so it can be a program name with args. set dummy "${targetArgument}-ar"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1334: checking for $ac_word" >&5 +echo "configure:1336: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1360,7 +1362,7 @@ fi # Extract the first word of ""${targetArgument}-dlltool"", so it can be a program name with args. set dummy "${targetArgument}-dlltool"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1364: checking for $ac_word" >&5 +echo "configure:1366: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1391,7 +1393,7 @@ else # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1395: checking for $ac_word" >&5 +echo "configure:1397: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1420,7 +1422,7 @@ fi # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1424: checking for $ac_word" >&5 +echo "configure:1426: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1449,7 +1451,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1453: checking for $ac_word" >&5 +echo "configure:1455: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1481,7 +1483,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1485: checking for $ac_word" >&5 +echo "configure:1487: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1527,7 +1529,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1531: checking for a BSD compatible install" >&5 +echo "configure:1533: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1590,7 +1592,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1594: checking whether ln -s works" >&5 +echo "configure:1596: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1616,7 +1618,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1620: checking for $ac_word" >&5 +echo "configure:1622: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1676,7 +1678,7 @@ fi # If so, there are probably other libraries that we want there also, so # leave the proper includes in CPPFLAGS and LDFLAGS echo $ac_n "checking for alternate objc library""... $ac_c" 1>&6 -echo "configure:1680: checking for alternate objc library" >&5 +echo "configure:1682: checking for alternate objc library" >&5 if eval "test \"`echo '$''{'gs_cv_objc_libdir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1718,12 +1720,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1722: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1724: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1731,7 +1733,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1756,7 +1758,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1760: checking for opendir in -ldir" >&5 +echo "configure:1762: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1764,7 +1766,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1797,7 +1799,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1801: checking for opendir in -lx" >&5 +echo "configure:1803: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1805,7 +1807,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1842,17 +1844,17 @@ for ac_hdr in sys/param.h sys/file.h dir.h string.h stdlib.h sys/types.h sys/s do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1846: checking for $ac_hdr" >&5 +echo "configure:1848: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1883,7 +1885,7 @@ done # Check if libobjc was compiled with thread support. #-------------------------------------------------------------------- echo $ac_n "checking whether objc has thread support""... $ac_c" 1>&6 -echo "configure:1887: checking whether objc has thread support" >&5 +echo "configure:1889: checking whether objc has thread support" >&5 extra_LIBS="" case "${target_os}" in solaris*) @@ -1891,19 +1893,22 @@ case "${target_os}" in ;; esac saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -x objective-c" saved_LIBS="$LIBS" +CFLAGS="$CFLAGS -x objective-c" +if test "$OBJC_RUNTIME_LIB" = "nx"; then + CFLAGS="$CFLAGS -DNeXT_RUNTIME" +fi if test "$host_os" = linux-gnu; then LIBS="-lobjc -lpthread" if test "$cross_compiling" = yes; then objc_threaded="-lpthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lpthread" else @@ -1921,11 +1926,11 @@ elif test "`echo $host_os|sed 's/[0-9].*//'|sed s/elf//`" = freebsd; then objc_threaded="-pthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-pthread" else @@ -1943,11 +1948,11 @@ fi objc_threaded="-lpthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lpthread" else @@ -1966,11 +1971,11 @@ fi objc_threaded="-lpcthread" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lpcthread" else @@ -1990,11 +1995,11 @@ elif test "$MINGW32" = yes; then objc_threaded="works" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="works" else @@ -2012,11 +2017,11 @@ else objc_threaded="" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then objc_threaded="-lthread $extra_LIBS" else diff --git a/configure.in b/configure.in index 4efcf32c..c44d0161 100644 --- a/configure.in +++ b/configure.in @@ -147,6 +147,8 @@ if test "$ac_cv_library_combo" = ""; then fi AC_SUBST(ac_cv_library_combo) +OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | tr '-' ' ' | awk '{print $1}'` + #-------------------------------------------------------------------- # specific target_os options #-------------------------------------------------------------------- @@ -291,8 +293,11 @@ case "${target_os}" in ;; esac saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -x objective-c" saved_LIBS="$LIBS" +CFLAGS="$CFLAGS -x objective-c" +if test "$OBJC_RUNTIME_LIB" = "nx"; then + CFLAGS="$CFLAGS -DNeXT_RUNTIME" +fi if test "$host_os" = linux-gnu; then LIBS="-lobjc -lpthread" AC_TRY_RUN([#include "config_thread.m"], objc_threaded="-lpthread",