Ignore:
Timestamp:
Mar 3, 2010, 10:10:44 PM (10 years ago)
Author:
jmr@…
Message:

remove bundled copy of sqlite3, make sqlite3 location configurable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/aclocal.m4

    r58141 r64358  
    775775])
    776776
     777# MP_SQLITE3_FLAGS
     778#       Sets the flags to compile with libsqlite3 and tclsqlite3.
     779#
     780# Arguments:
     781#       None.
     782#
     783# Requires:
     784#   pkgconfig, libsqlite3 in /usr/lib, or user parameters to define the flags.
     785#
     786# Results:
     787#   defines some help strings.
     788#   sets CFLAGS_SQLITE3 and LDFLAGS_SQLITE3
     789#---------------------------------------
     790AC_DEFUN([MP_SQLITE3_FLAGS],[
     791    # first sqlite3 itself
     792        AC_ARG_WITH(sqlite3prefix,
     793                   [  --with-sqlite3prefix       base directory for the sqlite3 install '/usr', '/usr/local',...],
     794                   [  sqlite3prefix=$withval ])
     795
     796        if test "x$sqlite3prefix" = "x"; then
     797                AC_PATH_PROG([PKG_CONFIG], [pkg-config])
     798                if test "x$PKG_CONFIG" = "x" || ! $PKG_CONFIG --exists sqlite3; then
     799                    # assume it's somewhere like /usr that needs no extra flags
     800                    AC_CHECK_HEADER(sqlite3.h, [], [AC_MSG_ERROR([cannot find sqlite3 header])])
     801            CFLAGS_SQLITE3=""
     802                    LDFLAGS_SQLITE3="-lsqlite3"
     803        else
     804            CFLAGS_SQLITE3=$($PKG_CONFIG --cflags sqlite3)
     805            LDFLAGS_SQLITE3=$($PKG_CONFIG --libs sqlite3)
     806            # for tclsqlite below
     807            mp_sqlite3_dir=$($PKG_CONFIG --variable=prefix sqlite3)
     808            if test "x$mp_sqlite3_dir" = "x"; then
     809                mp_sqlite3_dir=${mp_sqlite3_dir}/lib/sqlite3
     810            fi
     811        fi
     812        else
     813            CFLAGS_SQLITE3="-I${sqlite3prefix}/include"
     814                LDFLAGS_SQLITE3="-L${sqlite3prefix}/lib -lsqlite3"
     815        fi
     816
     817        AC_SUBST(CFLAGS_SQLITE3)
     818        AC_SUBST(LDFLAGS_SQLITE3)
     819
     820        # now the sqlite Tcl bindings
     821        AC_ARG_WITH(tcl-sqlite3,
     822                AS_HELP_STRING([--with-tcl-sqlite3=DIR],
     823                        [directory for Tcl sqlite3 (default /usr/lib/sqlite3)]),
     824                [mp_sqlite3_dir=$withval])
     825
     826    if test "x$mp_sqlite3_dir" = "x"; then
     827        mp_sqlite3_dir=/usr/lib/sqlite3
     828    fi
     829
     830        AC_CACHE_CHECK([for Tcl sqlite3 location], [mp_cv_sqlite3_dir],
     831                [mp_cv_sqlite3_dir=
     832                test -r "${mp_sqlite3_dir}/pkgIndex.tcl" && mp_cv_sqlite3_dir=$mp_sqlite3_dir
     833                ])
     834
     835        SQLITE3_TCL_DIR=$mp_cv_sqlite3_dir
     836        AC_SUBST(SQLITE3_TCL_DIR)
     837])
     838
    777839dnl This macro tests if the compiler supports GCC's
    778840dnl __attribute__ syntax for unused variables/parameters
Note: See TracChangeset for help on using the changeset viewer.