/ Check-in [a35e5227]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Pthread is now conditionally included in makefile, see ticket #910 (CVS 1974)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a35e52276998f8db2407115b07f30bd490982944
User & Date: dougcurrie 2004-09-20 14:57:23
Context
2004-09-24
12:24
Fix for tickets #912 and #922. Problem introduced by check-in (1973). (CVS 1975) check-in: 9001e222 user: drh tags: trunk
2004-09-20
14:57
Pthread is now conditionally included in makefile, see ticket #910 (CVS 1974) check-in: a35e5227 user: dougcurrie tags: trunk
2004-09-19
02:15
Add comments to unused P3 fields of selected instructions when NDEBUG is not defined. This makes VDBE program dumps more readable during debugging. (CVS 1973) check-in: 4871c77f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

    57     57   # The library that programs using readline() must link against.
    58     58   #
    59     59   LIBREADLINE = @TARGET_READLINE_LIBS@
    60     60   
    61     61   # Should the database engine be compiled threadsafe
    62     62   #
    63     63   THREADSAFE = -DTHREADSAFE=@THREADSAFE@
           64  +
           65  +# The pthreads library if needed
           66  +#
           67  +LIBPTHREAD=@TARGET_THREAD_LIB@
    64     68   
    65     69   # Flags controlling use of the in memory btree implementation
    66     70   #
    67     71   # TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
    68     72   # default to file, 2 to default to memory, and 3 to force temporary
    69     73   # tables to always be in memory.
    70     74   #
    71     75   TEMP_STORE = -DTEMP_STORE=@TEMP_STORE@
    72     76   
    73     77   # You should not have to change anything below this line
    74     78   ###############################################################################
    75     79   
    76         -# The pthreads library is always defined, even if we don't need it.
    77         -#
    78         -LIBPTHREAD=-lpthread
    79         -
    80     80   # Object files for the SQLite library.
    81     81   #
    82     82   LIBOBJ = attach.lo auth.lo btree.lo build.lo date.lo delete.lo \
    83     83            expr.lo func.lo hash.lo insert.lo \
    84     84            main.lo opcodes.lo os_mac.lo os_unix.lo os_win.lo \
    85     85            pager.lo parse.lo pragma.lo printf.lo random.lo \
    86     86            select.lo table.lo tokenize.lo trigger.lo update.lo util.lo vacuum.lo \

Changes to configure.

   459    459   #  include <stdint.h>
   460    460   # endif
   461    461   #endif
   462    462   #if HAVE_UNISTD_H
   463    463   # include <unistd.h>
   464    464   #endif"
   465    465   
   466         -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'
          466  +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'
   467    467   ac_subst_files=''
   468    468   
   469    469   # Initialize some variables set by options.
   470    470   ac_init_help=
   471    471   ac_init_version=false
   472    472   # The variables have the same names as the options, with
   473    473   # dashes changed to underlines.
................................................................................
  1489   1489   
  1490   1490   
  1491   1491   
  1492   1492   
  1493   1493   
  1494   1494   
  1495   1495   # The following RCS revision string applies to configure.in
  1496         -# $Revision: 1.24 $
         1496  +# $Revision: 1.25 $
  1497   1497   
  1498   1498   #########
  1499   1499   # Programs needed
  1500   1500   #
  1501   1501   # Check whether --enable-shared or --disable-shared was given.
  1502   1502   if test "${enable_shared+set}" = set; then
  1503   1503     enableval="$enable_shared"
................................................................................
 19402  19402   echo "${ECHO_T}no" >&6
 19403  19403   else
 19404  19404     THREADSAFE=1
 19405  19405     echo "$as_me:$LINENO: result: yes" >&5
 19406  19406   echo "${ECHO_T}yes" >&6
 19407  19407   fi
 19408  19408   
        19409  +
        19410  +if test "$THREADSAFE" = "1"; then
        19411  +  LIBS=""
        19412  +
        19413  +echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
        19414  +echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
        19415  +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
        19416  +  echo $ECHO_N "(cached) $ECHO_C" >&6
        19417  +else
        19418  +  ac_check_lib_save_LIBS=$LIBS
        19419  +LIBS="-lpthread  $LIBS"
        19420  +cat >conftest.$ac_ext <<_ACEOF
        19421  +/* confdefs.h.  */
        19422  +_ACEOF
        19423  +cat confdefs.h >>conftest.$ac_ext
        19424  +cat >>conftest.$ac_ext <<_ACEOF
        19425  +/* end confdefs.h.  */
        19426  +
        19427  +/* Override any gcc2 internal prototype to avoid an error.  */
        19428  +#ifdef __cplusplus
        19429  +extern "C"
        19430  +#endif
        19431  +/* We use char because int might match the return type of a gcc2
        19432  +   builtin and then its argument prototype would still apply.  */
        19433  +char pthread_create ();
        19434  +int
        19435  +main ()
        19436  +{
        19437  +pthread_create ();
        19438  +  ;
        19439  +  return 0;
        19440  +}
        19441  +_ACEOF
        19442  +rm -f conftest.$ac_objext conftest$ac_exeext
        19443  +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
        19444  +  (eval $ac_link) 2>conftest.er1
        19445  +  ac_status=$?
        19446  +  grep -v '^ *+' conftest.er1 >conftest.err
        19447  +  rm -f conftest.er1
        19448  +  cat conftest.err >&5
        19449  +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
        19450  +  (exit $ac_status); } &&
        19451  +	 { ac_try='test -z "$ac_c_werror_flag"
        19452  +			 || test ! -s conftest.err'
        19453  +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
        19454  +  (eval $ac_try) 2>&5
        19455  +  ac_status=$?
        19456  +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
        19457  +  (exit $ac_status); }; } &&
        19458  +	 { ac_try='test -s conftest$ac_exeext'
        19459  +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
        19460  +  (eval $ac_try) 2>&5
        19461  +  ac_status=$?
        19462  +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
        19463  +  (exit $ac_status); }; }; then
        19464  +  ac_cv_lib_pthread_pthread_create=yes
        19465  +else
        19466  +  echo "$as_me: failed program was:" >&5
        19467  +sed 's/^/| /' conftest.$ac_ext >&5
        19468  +
        19469  +ac_cv_lib_pthread_pthread_create=no
        19470  +fi
        19471  +rm -f conftest.err conftest.$ac_objext \
        19472  +      conftest$ac_exeext conftest.$ac_ext
        19473  +LIBS=$ac_check_lib_save_LIBS
        19474  +fi
        19475  +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
        19476  +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
        19477  +if test $ac_cv_lib_pthread_pthread_create = yes; then
        19478  +  cat >>confdefs.h <<_ACEOF
        19479  +#define HAVE_LIBPTHREAD 1
        19480  +_ACEOF
        19481  +
        19482  +  LIBS="-lpthread $LIBS"
        19483  +
        19484  +fi
        19485  +
        19486  +  TARGET_THREAD_LIB="$LIBS"
        19487  +  LIBS=""
        19488  +else
        19489  +  TARGET_THREAD_LIB=""
        19490  +fi
        19491  +
 19409  19492   
 19410  19493   ##########
 19411  19494   # Do we want to support release
 19412  19495   #
 19413  19496   # Check whether --enable-releasemode or --disable-releasemode was given.
 19414  19497   if test "${enable_releasemode+set}" = set; then
 19415  19498     enableval="$enable_releasemode"
................................................................................
 21267  21350   s,@TARGET_CC@,$TARGET_CC,;t t
 21268  21351   s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t
 21269  21352   s,@TARGET_LINK@,$TARGET_LINK,;t t
 21270  21353   s,@TARGET_LFLAGS@,$TARGET_LFLAGS,;t t
 21271  21354   s,@TARGET_RANLIB@,$TARGET_RANLIB,;t t
 21272  21355   s,@TARGET_AR@,$TARGET_AR,;t t
 21273  21356   s,@THREADSAFE@,$THREADSAFE,;t t
        21357  +s,@TARGET_THREAD_LIB@,$TARGET_THREAD_LIB,;t t
 21274  21358   s,@ALLOWRELEASE@,$ALLOWRELEASE,;t t
 21275  21359   s,@TEMP_STORE@,$TEMP_STORE,;t t
 21276  21360   s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
 21277  21361   s,@OS_UNIX@,$OS_UNIX,;t t
 21278  21362   s,@OS_WIN@,$OS_WIN,;t t
 21279  21363   s,@TARGET_EXEEXT@,$TARGET_EXEEXT,;t t
 21280  21364   s,@TARGET_LIBS@,$TARGET_LIBS,;t t

Changes to configure.ac.

   134    134   # the corresponding code.
   135    135   #
   136    136   AC_INIT(src/sqlite.h.in)
   137    137   
   138    138   dnl Put the RCS revision string after AC_INIT so that it will also
   139    139   dnl show in in configure.
   140    140   # The following RCS revision string applies to configure.in
   141         -# $Revision: 1.10 $
          141  +# $Revision: 1.11 $
   142    142   
   143    143   #########
   144    144   # Programs needed
   145    145   #
   146    146   AC_PROG_LIBTOOL
   147    147   AC_PROG_INSTALL
   148    148   
................................................................................
   300    300     THREADSAFE=0
   301    301     AC_MSG_RESULT([no])
   302    302   else
   303    303     THREADSAFE=1
   304    304     AC_MSG_RESULT([yes])
   305    305   fi
   306    306   AC_SUBST(THREADSAFE)
          307  +
          308  +if test "$THREADSAFE" = "1"; then
          309  +  LIBS=""
          310  +  AC_CHECK_LIB(pthread, pthread_create)
          311  +  TARGET_THREAD_LIB="$LIBS"
          312  +  LIBS=""
          313  +else
          314  +  TARGET_THREAD_LIB=""
          315  +fi
          316  +AC_SUBST(TARGET_THREAD_LIB)
   307    317   
   308    318   ##########
   309    319   # Do we want to support release
   310    320   #
   311    321   AC_ARG_ENABLE(releasemode, 
   312    322   [  --enable-releasemode           Support libtool link to release mode],,enable_releasemode=no)
   313    323   AC_MSG_CHECKING([whether to support shared library linked as release mode or not])