Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -52,19 +52,16 @@ # Should the database engine be compiled threadsafe # TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@ -# The pthreads library if needed -# -LIBPTHREAD=@TARGET_THREAD_LIB@ - # Do threads override each others locks by default (1), or do we test (-1) # TCC += -DSQLITE_THREAD_OVERRIDE_LOCK=@THREADSOVERRIDELOCKS@ -# The fdatasync library +# Any target libraries which libsqlite must be linked against +# TLIBS = @LIBS@ # Flags controlling use of the in memory btree implementation # # TEMP_STORE is 0 to force temporary tables to be in a file, 1 to @@ -359,21 +356,21 @@ last_change: $(SRC) cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -1 \ | $(NAWK) '{print $$5,$$6}' >last_change libsqlite3.la: $(LIBOBJ) - $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) \ + $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(TLIBS) \ ${ALLOWRELEASE} -rpath $(libdir) -version-info "8:6:8" libtclsqlite3.la: tclsqlite.lo libsqlite3.la $(LTLINK) -o libtclsqlite3.la tclsqlite.lo \ - $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(LIBPTHREAD) \ + $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(TLIBS) \ -rpath $(libdir)/sqlite \ -version-info "8:6:8" sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h - $(LTLINK) $(READLINE_FLAGS) $(LIBPTHREAD) \ + $(LTLINK) $(READLINE_FLAGS) \ -o $@ $(TOP)/src/shell.c libsqlite3.la \ $(LIBREADLINE) $(TLIBS) # This target creates a directory named "tsrc" and fills it with # copies of all of the C source code and header files needed to Index: configure ================================================================== --- configure +++ configure @@ -842,11 +842,10 @@ VERSION RELEASE VERSION_NUMBER BUILD_CC SQLITE_THREADSAFE -TARGET_THREAD_LIB XTHREADCONNECT THREADSOVERRIDELOCKS ALLOWRELEASE TEMP_STORE BUILD_EXEEXT @@ -1944,11 +1943,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # The following RCS revision string applies to configure.in -# $Revision: 1.51 $ +# $Revision: 1.52 $ ######### # Programs needed # # Check whether --enable-shared was given. @@ -3695,11 +3694,11 @@ fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3700 "configure"' > conftest.$ac_ext + echo '#line 3699 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -6374,15 +6373,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6379: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6378: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6383: \$? = $ac_status" >&5 + echo "$as_me:6382: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -6642,15 +6641,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6647: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6646: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6651: \$? = $ac_status" >&5 + echo "$as_me:6650: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -6746,15 +6745,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6751: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6750: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6755: \$? = $ac_status" >&5 + echo "$as_me:6754: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -9091,11 +9090,11 @@ lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif @@ -9191,11 +9190,11 @@ lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif @@ -11527,15 +11526,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11532: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11531: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11536: \$? = $ac_status" >&5 + echo "$as_me:11535: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -11631,15 +11630,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11636: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11635: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11640: \$? = $ac_status" >&5 + echo "$as_me:11639: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -13238,15 +13237,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13243: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13242: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13247: \$? = $ac_status" >&5 + echo "$as_me:13246: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -13342,15 +13341,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13347: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13346: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13351: \$? = $ac_status" >&5 + echo "$as_me:13350: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -15577,15 +15576,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15582: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15581: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15586: \$? = $ac_status" >&5 + echo "$as_me:15585: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -15845,15 +15844,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15850: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15849: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15854: \$? = $ac_status" >&5 + echo "$as_me:15853: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -15949,15 +15948,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15954: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15953: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15958: \$? = $ac_status" >&5 + echo "$as_me:15957: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -19774,19 +19773,16 @@ echo "${ECHO_T}yes" >&6; } fi if test "$SQLITE_THREADSAFE" = "1"; then - LIBS="" - -{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } -if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then + { echo "$as_me:$LINENO: checking for library containing pthread_create" >&5 +echo $ECHO_N "checking for library containing pthread_create... $ECHO_C" >&6; } +if test "${ac_cv_search_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" + ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -19805,11 +19801,18 @@ return pthread_create (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext +for ac_lib in '' pthread; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac @@ -19823,39 +19826,41 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_pthread_pthread_create=yes + ac_cv_search_pthread_create=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_pthread_pthread_create=no + fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } -if test $ac_cv_lib_pthread_pthread_create = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -fi - - TARGET_THREAD_LIB="$LIBS" - LIBS="" + conftest$ac_exeext + if test "${ac_cv_search_pthread_create+set}" = set; then + break +fi +done +if test "${ac_cv_search_pthread_create+set}" = set; then + : else - TARGET_THREAD_LIB="" + ac_cv_search_pthread_create=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_search_pthread_create" >&6; } +ac_res=$ac_cv_search_pthread_create +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + fi +fi ########## # Do we want to allow a connection created in one thread to be used # in another thread. This does not work on many Linux systems (ex: RedHat 9) # due to bugs in the threading implementations. This is thus off by default. @@ -21460,11 +21465,10 @@ VERSION!$VERSION$ac_delim RELEASE!$RELEASE$ac_delim VERSION_NUMBER!$VERSION_NUMBER$ac_delim BUILD_CC!$BUILD_CC$ac_delim SQLITE_THREADSAFE!$SQLITE_THREADSAFE$ac_delim -TARGET_THREAD_LIB!$TARGET_THREAD_LIB$ac_delim XTHREADCONNECT!$XTHREADCONNECT$ac_delim THREADSOVERRIDELOCKS!$THREADSOVERRIDELOCKS$ac_delim ALLOWRELEASE!$ALLOWRELEASE$ac_delim TEMP_STORE!$TEMP_STORE$ac_delim BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim @@ -21479,10 +21483,11 @@ TCL_INCLUDE_SPEC!$TCL_INCLUDE_SPEC$ac_delim TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim TCL_LIB_FLAG!$TCL_LIB_FLAG$ac_delim TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim TCL_STUB_LIB_FILE!$TCL_STUB_LIB_FILE$ac_delim +TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then @@ -21520,11 +21525,10 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim TCL_STUB_LIB_SPEC!$TCL_STUB_LIB_SPEC$ac_delim HAVE_TCL!$HAVE_TCL$ac_delim TARGET_READLINE_LIBS!$TARGET_READLINE_LIBS$ac_delim TARGET_READLINE_INC!$TARGET_READLINE_INC$ac_delim TARGET_HAVE_READLINE!$TARGET_HAVE_READLINE$ac_delim @@ -21534,11 +21538,11 @@ BUILD_CFLAGS!$BUILD_CFLAGS$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 12; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 11; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -90,11 +90,11 @@ AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) dnl Put the RCS revision string after AC_INIT so that it will also dnl show in in configure. # The following RCS revision string applies to configure.in -# $Revision: 1.37 $ +# $Revision: 1.38 $ ######### # Programs needed # AC_PROG_LIBTOOL @@ -202,18 +202,12 @@ AC_MSG_RESULT([yes]) fi AC_SUBST(SQLITE_THREADSAFE) if test "$SQLITE_THREADSAFE" = "1"; then - LIBS="" - AC_CHECK_LIB(pthread, pthread_create) - TARGET_THREAD_LIB="$LIBS" - LIBS="" -else - TARGET_THREAD_LIB="" + AC_SEARCH_LIBS(pthread_create, pthread) fi -AC_SUBST(TARGET_THREAD_LIB) ########## # Do we want to allow a connection created in one thread to be used # in another thread. This does not work on many Linux systems (ex: RedHat 9) # due to bugs in the threading implementations. This is thus off by default.