]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Pthread is now conditionally included in makefile, see ticket #910 (CVS 1974)
authordougcurrie <dougcurrie@noemail.net>
Mon, 20 Sep 2004 14:57:23 +0000 (14:57 +0000)
committerdougcurrie <dougcurrie@noemail.net>
Mon, 20 Sep 2004 14:57:23 +0000 (14:57 +0000)
FossilOrigin-Name: a35e52276998f8db2407115b07f30bd490982944

Makefile.in
configure
configure.ac
manifest
manifest.uuid

index 39d93af508f6af8ca696e3d90f5bd704854bf49f..75e8b0205cea8015e73bf35b717cc32c794ab998 100644 (file)
@@ -62,6 +62,10 @@ LIBREADLINE = @TARGET_READLINE_LIBS@
 #
 THREADSAFE = -DTHREADSAFE=@THREADSAFE@
 
+# The pthreads library if needed
+#
+LIBPTHREAD=@TARGET_THREAD_LIB@
+
 # Flags controlling use of the in memory btree implementation
 #
 # TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
@@ -73,10 +77,6 @@ TEMP_STORE = -DTEMP_STORE=@TEMP_STORE@
 # You should not have to change anything below this line
 ###############################################################################
 
-# The pthreads library is always defined, even if we don't need it.
-#
-LIBPTHREAD=-lpthread
-
 # Object files for the SQLite library.
 #
 LIBOBJ = attach.lo auth.lo btree.lo build.lo date.lo delete.lo \
index e1c4262cc5a62843bfef74fa7bb1449a05d1f885..b72c41bbb7dd0767456b3040d189fce5c5b31fa4 100755 (executable)
--- a/configure
+++ b/configure
@@ -463,7 +463,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA program_prefix VERSION BUILD_CC BUILD_CFLAGS BUILD_LIBS TARGET_CC TARGET_CFLAGS TARGET_LINK TARGET_LFLAGS TARGET_RANLIB TARGET_AR THREADSAFE ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN TARGET_EXEEXT TARGET_LIBS TARGET_TCL_LIBS TARGET_TCL_INC TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA program_prefix VERSION BUILD_CC BUILD_CFLAGS BUILD_LIBS TARGET_CC TARGET_CFLAGS TARGET_LINK TARGET_LFLAGS TARGET_RANLIB TARGET_AR THREADSAFE TARGET_THREAD_LIB ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN TARGET_EXEEXT TARGET_LIBS TARGET_TCL_LIBS TARGET_TCL_INC TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1493,7 +1493,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 # The following RCS revision string applies to configure.in
-# $Revision: 1.24 $
+# $Revision: 1.25 $
 
 #########
 # Programs needed
@@ -19407,6 +19407,89 @@ echo "${ECHO_T}yes" >&6
 fi
 
 
+if test "$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 $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_create ();
+int
+main ()
+{
+pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      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=""
+else
+  TARGET_THREAD_LIB=""
+fi
+
+
 ##########
 # Do we want to support release
 #
@@ -21271,6 +21354,7 @@ s,@TARGET_LFLAGS@,$TARGET_LFLAGS,;t t
 s,@TARGET_RANLIB@,$TARGET_RANLIB,;t t
 s,@TARGET_AR@,$TARGET_AR,;t t
 s,@THREADSAFE@,$THREADSAFE,;t t
+s,@TARGET_THREAD_LIB@,$TARGET_THREAD_LIB,;t t
 s,@ALLOWRELEASE@,$ALLOWRELEASE,;t t
 s,@TEMP_STORE@,$TEMP_STORE,;t t
 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
index 52409a2f05dc6648e5a9bc8d9fcb9a991e649213..0d9c2d40e838f66ff3950b984bbc5435038497d1 100644 (file)
@@ -138,7 +138,7 @@ AC_INIT(src/sqlite.h.in)
 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.10 $
+# $Revision: 1.11 $
 
 #########
 # Programs needed
@@ -305,6 +305,16 @@ else
 fi
 AC_SUBST(THREADSAFE)
 
+if test "$THREADSAFE" = "1"; then
+  LIBS=""
+  AC_CHECK_LIB(pthread, pthread_create)
+  TARGET_THREAD_LIB="$LIBS"
+  LIBS=""
+else
+  TARGET_THREAD_LIB=""
+fi
+AC_SUBST(TARGET_THREAD_LIB)
+
 ##########
 # Do we want to support release
 #
index 6d73a40bb07ae232cddbd65f0ae26ec9062cfdb0..c9732c248774f20da26a6a2a1e7540be56fa1fe6 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,6 +1,6 @@
-C Add\scomments\sto\sunused\sP3\sfields\sof\sselected\sinstructions\swhen\sNDEBUG\sis\nnot\sdefined.\s\sThis\smakes\sVDBE\sprogram\sdumps\smore\sreadable\sduring\sdebugging.\s(CVS\s1973)
-D 2004-09-19T02:15:25
-F Makefile.in 76f8790c727cdbe2e1bef19c9c72b6e5da9cb9d8
+C Pthread\sis\snow\sconditionally\sincluded\sin\smakefile,\ssee\sticket\s#910\s(CVS\s1974)
+D 2004-09-20T14:57:23
+F Makefile.in abdeb5bd9d017822691884935c320037c33f6ee6
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
 F VERSION 0aeddfe96f008f6cbe2c7167a782f3133e118d8d
@@ -10,8 +10,8 @@ F art/SQLite.gif 1bbb94484963f1382e27e1c5e86dd0c1061eba2b
 F art/SQLiteLogo3.tiff b9e6bf022ae939bc986cddb8ab99583ca1b02cb3
 F config.guess 2103e94b15dc57112d7b9ee152c6fac5288895b4
 F config.sub 9bf686ec001ae7bc53f5b3563c90c62d4c6d48be
-F configure d3720624693e6b18264e7776f7250dd472659a10 x
-F configure.ac 82b4d26ae0234e87019b5783b67bd5b807eb5820
+F configure 8f1b0d5cad4dadcc1677c737e35646abf6332794 x
+F configure.ac 5903493fe34908d768d4abaa3c0c9397e32e2bb5
 F doc/affinity.html bdc7560fa3d2284af59d8fb52041cddbb14578f5
 F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538
 F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
@@ -247,7 +247,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25
 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P eb9b501ad8b0fa0fd63a67ece05fe142d6a19114
-R c7e379274e1d8907f42f1545aa184a86
-U drh
-Z adae3eae9c54320f47912f08aac3df30
+P 4871c77f8fce36ff230e1f026f4e4e49492515e9
+R bede9b44ed7ebb616aa1848cfc38c778
+U dougcurrie
+Z fde2d4fad7076c6aba6215b69248b2e7
index f78de9442bd259ca04d064c3415328d7eed207c7..a6734bc79b6521e9b43eb9b04a7778e0bd48c1df 100644 (file)
@@ -1 +1 @@
-4871c77f8fce36ff230e1f026f4e4e49492515e9
\ No newline at end of file
+a35e52276998f8db2407115b07f30bd490982944
\ No newline at end of file