Changeset 25770


Ignore:
Timestamp:
May 31, 2007, 11:00:11 PM (13 years ago)
Author:
sfiera@…
Message:

Build MacPorts with sqlite3 support in preparation for GSoC work

  • Include sqlite-3.1.3 for Panther; link against static lib
  • Install Tcl sqlite3 to ${prefix}/share/darwinports/Tcl if it's built, thus, it's always available
  • Rename ambiguous configure option "--with-sqlite3" to "--with-tcl-sqlite3"
  • Build our_included_packages before MacPorts so the static lib is there in later stages
Location:
trunk/base
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Mk/dports.autoconf.mk.in

    r24398 r25770  
    2525LIBS                    = @LIBS@
    2626MD5_LIBS                = @MD5_LIBS@
     27SQLITE3_LIBS            = @SQLITE3_LIBS@
    2728INSTALL                 = @INSTALL@
    2829MTREE                   = @MTREE@
  • trunk/base/Mk/dports.tea.mk

    r19376 r25770  
    33
    44$(SHLIB_NAME):: ${OBJS}
    5         ${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${SHLIB_LDFLAGS} ${LIBS} ${MD5_LIBS}
     5        ${SHLIB_LD} ${OBJS} -o ${SHLIB_NAME} ${TCL_STUB_LIB_SPEC} ${SHLIB_LDFLAGS} ${LIBS} ${MD5_LIBS} ${SQLITE3_LIBS}
    66
    77all:: ${SHLIB_NAME}
  • trunk/base/aclocal.m4

    r24366 r25770  
    733733
    734734
    735 # OD_PATH_SQLITE3
    736 #       Specify sqlite3 location
    737 #
    738 # Arguments:
    739 #       None.
    740 #
    741 # Requires:
    742 #   System or user-specified --with-sqlite=dir to specify
    743 #
    744 # Results:
    745 #   Sets SQLITE3_DIR to the directory where sqlite3 tcl pkgIndex.tcl is
    746 #---------------------------------------
    747 AC_DEFUN([OD_PATH_SQLITE3],[
    748 
    749         AC_ARG_WITH([sqlite],
    750                 AS_HELP_STRING([--with-sqlite3=DIR],
    751                         [directory for sqlite3 (default /usr/lib/sqlite3)]),           
    752                 [od_sqlite3_dir=$withval], [od_sqlite3_dir=/usr/lib/sqlite3])
    753                
    754         AC_CACHE_CHECK([for sqlite3 location], [od_cv_sqlite3_dir],
    755                 [od_cv_sqlite3_dir=
    756                 test -r "${od_sqlite3_dir}/pkgIndex.tcl" && od_cv_sqlite3_dir=$od_sqlite3_dir
    757                 ])
    758                
    759         SQLITE3_DIR=$od_cv_sqlite3_dir
    760         AC_SUBST(SQLITE3_DIR)
    761 ])
    762 
    763735dnl This macro tests if the compiler supports GCC's
    764736dnl __attribute__ syntax for unused variables/parameters
  • trunk/base/configure

    r24821 r25770  
    700700DPORTSDIR
    701701PORTCONFIGDIR
    702 SQLITE3_DIR
    703702DSTUSR
    704703DSTGRP
     
    730729LDFLAGS_LIBCURL
    731730subdirs
     731SQLITE3_LIBS
     732SQLITE3_DIR
    732733OUR_INCLUDED_PACKAGES
    733734INCLUDES
     
    766767CPP
    767768XMKMF'
    768 ac_subdirs_all='src/thread2.6'
     769ac_subdirs_all='src/thread2.6
     770src/sqlite-3.1.3'
    769771
    770772# Initialize some variables set by options.
     
    13511353  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    13521354  --with-dports-dir=DIR   Specify alternate dports directory
    1353   --with-sqlite3=DIR      directory for sqlite3 (default /usr/lib/sqlite3)
    13541355  --with-install-user=USER
    13551356                          Specify user ownership of installed files
     
    13631364  --with-tclpackage       Tcl package installation directory.
    13641365  --with-curlprefix       base directory for the cURL install '/usr', '/usr/local',...
    1365   --with-included-tclthread install included Thread package.
     1366  --with-included-tclthread
     1367                          install included Thread package.
     1368  --with-included-sqlite3 build using bundled sqlite3 package
     1369  --with-tcl-sqlite3=DIR  directory for Tcl sqlite3 (default /usr/lib/sqlite3)
    13661370
    13671371Some influential environment variables:
     
    40534057
    40544058
    4055 
    4056 
    4057 # Check whether --with-sqlite was given.
    4058 if test "${with_sqlite+set}" = set; then
    4059   withval=$with_sqlite; od_sqlite3_dir=$withval
    4060 else
    4061   od_sqlite3_dir=/usr/lib/sqlite3
    4062 fi
    4063 
    4064 
    4065         { echo "$as_me:$LINENO: checking for sqlite3 location" >&5
    4066 echo $ECHO_N "checking for sqlite3 location... $ECHO_C" >&6; }
    4067 if test "${od_cv_sqlite3_dir+set}" = set; then
    4068   echo $ECHO_N "(cached) $ECHO_C" >&6
    4069 else
    4070   od_cv_sqlite3_dir=
    4071                 test -r "${od_sqlite3_dir}/pkgIndex.tcl" && od_cv_sqlite3_dir=$od_sqlite3_dir
    4072 
    4073 fi
    4074 { echo "$as_me:$LINENO: result: $od_cv_sqlite3_dir" >&5
    4075 echo "${ECHO_T}$od_cv_sqlite3_dir" >&6; }
    4076 
    4077         SQLITE3_DIR=$od_cv_sqlite3_dir
    4078 
    4079 
    4080 
    40814059# Check for install ownership
    40824060
     
    95369514        patch -p0 < src/thread2.6.diff
    95379515fi
     9516
     9517## sqlite3 package.
     9518
     9519# Check whether --with-included-sqlite3 was given.
     9520if test "${with_included_sqlite3+set}" = set; then
     9521  withval=$with_included_sqlite3; with_included_sqlite3=$withval
     9522else
     9523  with_included_sqlite3="unspecified"
     9524fi
     9525
     9526
     9527# Check if sqlite3 package is already installed.
     9528if test "x$with_included_sqlite3" = "xunspecified" ; then
     9529        { echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
     9530echo $ECHO_N "checking for sqlite3_open in -lsqlite3... $ECHO_C" >&6; }
     9531if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then
     9532  echo $ECHO_N "(cached) $ECHO_C" >&6
     9533else
     9534  ac_check_lib_save_LIBS=$LIBS
     9535LIBS="-lsqlite3  $LIBS"
     9536cat >conftest.$ac_ext <<_ACEOF
     9537/* confdefs.h.  */
     9538_ACEOF
     9539cat confdefs.h >>conftest.$ac_ext
     9540cat >>conftest.$ac_ext <<_ACEOF
     9541/* end confdefs.h.  */
     9542
     9543/* Override any GCC internal prototype to avoid an error.
     9544   Use char because int might match the return type of a GCC
     9545   builtin and then its argument prototype would still apply.  */
     9546#ifdef __cplusplus
     9547extern "C"
     9548#endif
     9549char sqlite3_open ();
     9550int
     9551main ()
     9552{
     9553return sqlite3_open ();
     9554  ;
     9555  return 0;
     9556}
     9557_ACEOF
     9558rm -f conftest.$ac_objext conftest$ac_exeext
     9559if { (ac_try="$ac_link"
     9560case "(($ac_try" in
     9561  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
     9562  *) ac_try_echo=$ac_try;;
     9563esac
     9564eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
     9565  (eval "$ac_link") 2>conftest.er1
     9566  ac_status=$?
     9567  grep -v '^ *+' conftest.er1 >conftest.err
     9568  rm -f conftest.er1
     9569  cat conftest.err >&5
     9570  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     9571  (exit $ac_status); } && {
     9572         test -z "$ac_c_werror_flag" ||
     9573         test ! -s conftest.err
     9574       } && test -s conftest$ac_exeext &&
     9575       $as_test_x conftest$ac_exeext; then
     9576  ac_cv_lib_sqlite3_sqlite3_open=yes
     9577else
     9578  echo "$as_me: failed program was:" >&5
     9579sed 's/^/| /' conftest.$ac_ext >&5
     9580
     9581        ac_cv_lib_sqlite3_sqlite3_open=no
     9582fi
     9583
     9584rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
     9585      conftest$ac_exeext conftest.$ac_ext
     9586LIBS=$ac_check_lib_save_LIBS
     9587fi
     9588{ echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5
     9589echo "${ECHO_T}$ac_cv_lib_sqlite3_sqlite3_open" >&6; }
     9590if test $ac_cv_lib_sqlite3_sqlite3_open = yes; then
     9591  with_included_sqlite3=no
     9592else
     9593  with_included_sqlite3=yes
     9594fi
     9595
     9596fi
     9597
     9598
     9599# Check whether --with-tcl-sqlite3 was given.
     9600if test "${with_tcl_sqlite3+set}" = set; then
     9601  withval=$with_tcl_sqlite3; od_sqlite3_dir=$withval
     9602else
     9603  od_sqlite3_dir=/usr/lib/sqlite3
     9604fi
     9605
     9606
     9607# If sqlite3 package isn't installed, configure and install sqlite3 package.
     9608if test "$with_included_sqlite3" = "yes"; then
     9609        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES sqlite-3.1.3"
     9610        subdirs="$subdirs src/sqlite-3.1.3"
     9611
     9612        # Extract sqlite3 package
     9613        (cd src/; gzip -d < sqlite-3.1.3.tar.gz | tar xf -)
     9614        # patch sqlite3 with desired configure options
     9615        patch -p0 < src/sqlite-3.1.3.diff
     9616        # the new tclinstaller.tcl needs to have substitution occur
     9617        mv src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3/tclinstaller.tcl.in
     9618        SQLITE3_LIBS=`pwd`"/src/sqlite-3.1.3/.libs/libsqlite3.a"
     9619        if test "x$prefix" = "xNONE" ; then
     9620                SQLITE3_DIR=$ac_default_prefix/share/darwinports/Tcl/sqlite3
     9621        else
     9622                SQLITE3_DIR=$prefix/share/darwinports/Tcl/sqlite3
     9623        fi
     9624else
     9625        SQLITE3_LIBS="-lsqlite3"
     9626
     9627        { echo "$as_me:$LINENO: checking for Tcl sqlite3 location" >&5
     9628echo $ECHO_N "checking for Tcl sqlite3 location... $ECHO_C" >&6; }
     9629if test "${od_cv_sqlite3_dir+set}" = set; then
     9630  echo $ECHO_N "(cached) $ECHO_C" >&6
     9631else
     9632  od_cv_sqlite3_dir=
     9633                test -r "${od_sqlite3_dir}/pkgIndex.tcl" && od_cv_sqlite3_dir=$od_sqlite3_dir
     9634
     9635fi
     9636{ echo "$as_me:$LINENO: result: $od_cv_sqlite3_dir" >&5
     9637echo "${ECHO_T}$od_cv_sqlite3_dir" >&6; }
     9638
     9639        SQLITE3_DIR=$od_cv_sqlite3_dir
     9640fi
     9641
     9642
     9643
    95389644
    95399645
     
    1033110437DPORTSDIR!$DPORTSDIR$ac_delim
    1033210438PORTCONFIGDIR!$PORTCONFIGDIR$ac_delim
    10333 SQLITE3_DIR!$SQLITE3_DIR$ac_delim
    1033410439DSTUSR!$DSTUSR$ac_delim
    1033510440DSTGRP!$DSTGRP$ac_delim
     
    1034510450X_LIBS!$X_LIBS$ac_delim
    1034610451X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim
     10452TCL_VERSION!$TCL_VERSION$ac_delim
    1034710453_ACEOF
    1034810454
     
    1038610492for ac_last_try in false false false false false :; do
    1038710493  cat >conf$$subs.sed <<_ACEOF
    10388 TCL_VERSION!$TCL_VERSION$ac_delim
    1038910494TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim
    1039010495TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim
     
    1040210507LDFLAGS_LIBCURL!$LDFLAGS_LIBCURL$ac_delim
    1040310508subdirs!$subdirs$ac_delim
     10509SQLITE3_LIBS!$SQLITE3_LIBS$ac_delim
     10510SQLITE3_DIR!$SQLITE3_DIR$ac_delim
    1040410511OUR_INCLUDED_PACKAGES!$OUR_INCLUDED_PACKAGES$ac_delim
    1040510512INCLUDES!$INCLUDES$ac_delim
     
    1042010527_ACEOF
    1042110528
    10422   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 32; then
     10529  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 33; then
    1042310530    break
    1042410531  elif $ac_last_try; then
  • trunk/base/configure.ac

    r24820 r25770  
    5959OD_PATH_DPORTSDIR([$DPORTS_DIR_DEFAULT])
    6060OD_PATH_PORTCONFIGDIR
    61 OD_PATH_SQLITE3
    6261
    6362# Check for install ownership
     
    136135AC_ARG_WITH(
    137136                included-tclthread,
    138                 [  --with-included-tclthread install included Thread package.],
     137                AS_HELP_STRING([--with-included-tclthread],
     138                        [install included Thread package.]),
    139139                [with_included_tclthread=$withval],
    140140                [with_included_tclthread="unspecified"])
     
    157157        patch -p0 < src/thread2.6.diff
    158158fi
     159
     160## sqlite3 package.
     161AC_ARG_WITH(
     162                included-sqlite3,
     163                AS_HELP_STRING([--with-included-sqlite3],
     164                        [build using bundled sqlite3 package]),
     165                [with_included_sqlite3=$withval],
     166                [with_included_sqlite3="unspecified"])
     167
     168# Check if sqlite3 package is already installed.
     169if test "x$with_included_sqlite3" = "xunspecified" ; then
     170        AC_CHECK_LIB([sqlite3],[sqlite3_open],
     171                [with_included_sqlite3=no],
     172                [with_included_sqlite3=yes])
     173fi
     174
     175AC_ARG_WITH(
     176                tcl-sqlite3,
     177                AS_HELP_STRING([--with-tcl-sqlite3=DIR],
     178                        [directory for Tcl sqlite3 (default /usr/lib/sqlite3)]),
     179                [od_sqlite3_dir=$withval],
     180                [od_sqlite3_dir=/usr/lib/sqlite3])
     181
     182# If sqlite3 package isn't installed, configure and install sqlite3 package.
     183if test "$with_included_sqlite3" = "yes"; then
     184        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES sqlite-3.1.3"
     185        AC_CONFIG_SUBDIRS([src/sqlite-3.1.3])
     186        # Extract sqlite3 package
     187        (cd src/; gzip -d < sqlite-3.1.3.tar.gz | tar xf -)
     188        # patch sqlite3 with desired configure options
     189        patch -p0 < src/sqlite-3.1.3.diff
     190        # the new tclinstaller.tcl needs to have substitution occur
     191        mv src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3/tclinstaller.tcl.in
     192        SQLITE3_LIBS=`pwd`"/src/sqlite-3.1.3/.libs/libsqlite3.a"
     193        if test "x$prefix" = "xNONE" ; then
     194                SQLITE3_DIR=$ac_default_prefix/share/darwinports/Tcl/sqlite3
     195        else
     196                SQLITE3_DIR=$prefix/share/darwinports/Tcl/sqlite3
     197        fi
     198else
     199        SQLITE3_LIBS="-lsqlite3"
     200
     201        AC_CACHE_CHECK([for Tcl sqlite3 location], [od_cv_sqlite3_dir],
     202                [od_cv_sqlite3_dir=
     203                test -r "${od_sqlite3_dir}/pkgIndex.tcl" && od_cv_sqlite3_dir=$od_sqlite3_dir
     204                ])
     205
     206        SQLITE3_DIR=$od_cv_sqlite3_dir
     207fi
     208
     209AC_SUBST(SQLITE3_LIBS)
     210AC_SUBST(SQLITE3_DIR)
    159211
    160212AC_SUBST(OUR_INCLUDED_PACKAGES)
  • trunk/base/src/Makefile.in

    r19376 r25770  
    1 TCLPKG=         darwinports1.0 port1.0 package1.0 pextlib1.0 registry1.0 \
    2                         darwintracelib1.0 @OUR_INCLUDED_PACKAGES@
     1TCLPKG=         @OUR_INCLUDED_PACKAGES@ darwinports1.0 port1.0 package1.0 \
     2                        pextlib1.0 registry1.0 darwintracelib1.0
    33SUBDIR=         ${TCLPKG} port programs
    44
Note: See TracChangeset for help on using the changeset viewer.