Changeset 66033


Ignore:
Timestamp:
Apr 5, 2010, 6:58:02 AM (11 years ago)
Author:
jmr@…
Message:

avoid build failure when sqlite3ext.h is not available; fix setting of tclsqlite location using pkgconfig

Location:
trunk/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/aclocal.m4

    r64363 r66033  
    806806            # for tclsqlite below
    807807            mp_sqlite3_dir=$($PKG_CONFIG --variable=prefix sqlite3)
    808             if test "x$mp_sqlite3_dir" = "x"; then
     808            if test "x$mp_sqlite3_dir" != "x"; then
    809809                mp_sqlite3_dir=${mp_sqlite3_dir}/lib/sqlite3
    810810            fi
     
    814814                LDFLAGS_SQLITE3="-L${sqlite3prefix}/lib -lsqlite3"
    815815        fi
     816
     817    # check if we have sqlite3ext.h, using the appropriate cppflags
     818    CPPFLAGS_OLD="${CPPFLAGS}"
     819    CPPFLAGS="${CPPFLAGS} ${CFLAGS_SQLITE3}"
     820    AC_CHECK_HEADERS(sqlite3ext.h)
     821    CPPFLAGS="${CPPFLAGS_OLD}"
    816822
    817823        AC_SUBST(CFLAGS_SQLITE3)
  • trunk/base/configure

    r65096 r66033  
    91539153            # for tclsqlite below
    91549154            mp_sqlite3_dir=$($PKG_CONFIG --variable=prefix sqlite3)
    9155             if test "x$mp_sqlite3_dir" = "x"; then
     9155            if test "x$mp_sqlite3_dir" != "x"; then
    91569156                mp_sqlite3_dir=${mp_sqlite3_dir}/lib/sqlite3
    91579157            fi
     
    91619161                LDFLAGS_SQLITE3="-L${sqlite3prefix}/lib -lsqlite3"
    91629162        fi
     9163
     9164    # check if we have sqlite3ext.h, using the appropriate cppflags
     9165    CPPFLAGS_OLD="${CPPFLAGS}"
     9166    CPPFLAGS="${CPPFLAGS} ${CFLAGS_SQLITE3}"
     9167    for ac_header in sqlite3ext.h
     9168do :
     9169  ac_fn_c_check_header_mongrel "$LINENO" "sqlite3ext.h" "ac_cv_header_sqlite3ext_h" "$ac_includes_default"
     9170if test "x$ac_cv_header_sqlite3ext_h" = x""yes; then :
     9171  cat >>confdefs.h <<_ACEOF
     9172#define HAVE_SQLITE3EXT_H 1
     9173_ACEOF
     9174
     9175fi
     9176
     9177done
     9178
     9179    CPPFLAGS="${CPPFLAGS_OLD}"
    91639180
    91649181
  • trunk/base/src/config.h.in

    r58137 r66033  
    129129#undef HAVE_SETMODE
    130130
     131/* Define to 1 if you have the <sqlite3ext.h> header file. */
     132#undef HAVE_SQLITE3EXT_H
     133
    131134/* Define to 1 if you have the <stdint.h> header file. */
    132135#undef HAVE_STDINT_H
  • trunk/base/src/cregistry/sqlext.c

    r65385 r66033  
    66
    77#include <string.h>
     8#if HAVE_SQLITE3EXT_H
    89#include <sqlite3ext.h>
    910SQLITE_EXTENSION_INIT1
     11#else
     12#include <sqlite3.h>
     13#endif
    1014
    1115/**
     
    2226    const sqlite3_api_routines *pApi  /* API methods */
    2327) {
     28#if HAVE_SQLITE3EXT_H
    2429    SQLITE_EXTENSION_INIT2(pApi)
    2530
    2631    sqlite3_create_collation(db, "VERSION", SQLITE_UTF8, NULL, sql_version);
    27 
     32#endif
    2833    return 0;
    2934}
Note: See TracChangeset for help on using the changeset viewer.