configure.ac 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. dnl -*- Autoconf -*-
  2. AC_INIT([Guile-SQLite3], [0.1.0],
  3. [guile-user@gnu.org], [guile-sqlite3],
  4. [https://notabug.org/civodul/guile-sqlite3])
  5. AC_CONFIG_SRCDIR([sqlite3.scm.in])
  6. AC_CONFIG_AUX_DIR([build-aux])
  7. AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability])
  8. AM_SILENT_RULES([yes])
  9. dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
  10. dnl Make sure they are available.
  11. m4_pattern_forbid([PKG_CHECK_MODULES])
  12. m4_pattern_forbid([GUILE_PKG])
  13. GUILE_PKG([3.0 2.2 2.0])
  14. GUILE_PROGS
  15. PKG_CHECK_MODULES([SQLITE], [sqlite3])
  16. SQLITE_LIBDIR="`"$PKG_CONFIG" sqlite3 --variable libdir`"
  17. AC_SUBST([SQLITE_LIBDIR])
  18. if test "$cross_compiling" = "no"; then
  19. AC_MSG_CHECKING([whether '$SQLITE_LIBDIR/libsqlite3' is usable])
  20. GUILE_CHECK([retval],
  21. [(dynamic-func \"sqlite3_open_v2\"
  22. (dynamic-link \"$SQLITE_LIBDIR/libsqlite3\"))])
  23. if test "$retval" != 0; then
  24. AC_MSG_RESULT([no])
  25. AC_MSG_ERROR([failed to load '$SQLITE_LIBDIR/libsqlite3'])
  26. else
  27. AC_MSG_RESULT([yes])
  28. fi
  29. else
  30. GUILE_TARGET="--target=$host_alias"
  31. AC_SUBST([GUILE_TARGET])
  32. fi
  33. AC_CONFIG_FILES([Makefile sqlite3.scm])
  34. AC_CONFIG_FILES([env], [chmod +x env])
  35. AC_OUTPUT