Alien-SVN
view release on metacpan or search on metacpan
src/subversion/build/ac-macros/sqlite.m4 view on Meta::CPAN
sqlite_dir="$1"
sqlite_include="$1/include/sqlite3.h"
fi
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
if test ! -z "$1"; then
CPPFLAGS="$CPPFLAGS -I$sqlite_dir/include"
LDFLAGS="$LDFLAGS -L$sqlite_dir/lib"
fi
AC_CHECK_HEADER(sqlite3.h,
[
AC_MSG_CHECKING([sqlite library version (via header)])
AC_EGREP_CPP(SQLITE_VERSION_OKAY,[
#include "$sqlite_include"
#if SQLITE_VERSION_NUMBER >= $sqlite_min_ver_num
SQLITE_VERSION_OKAY
#endif],
[AC_MSG_RESULT([okay])
AC_CHECK_LIB(sqlite3, sqlite3_close, [
svn_lib_sqlite="yes"
if test -z "$sqlite_dir" -o ! -d "$sqlite_dir"; then
SVN_SQLITE_LIBS="-lsqlite3"
else
SVN_SQLITE_INCLUDES="-I$sqlite_dir/include"
SVN_SQLITE_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS(-L$sqlite_dir/lib -lsqlite3)`"
fi
])], [AC_MSG_RESULT([unsupported SQLite version])])
])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
])
dnl SVN_SQLITE_FILE_CONFIG(sqlite_file)
dnl
dnl Check to see if we've got an appropriate sqlite amalgamation file
dnl at sqlite_file. If not, fail.
AC_DEFUN(SVN_SQLITE_FILE_CONFIG,
[
sqlite_amalg="$1"
AC_MSG_CHECKING([sqlite amalgamation])
if test ! -e $sqlite_amalg; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([sqlite amalgamation file version])
AC_EGREP_CPP(SQLITE_VERSION_OKAY,[
#include "$sqlite_amalg"
#if SQLITE_VERSION_NUMBER >= $sqlite_min_ver_num
SQLITE_VERSION_OKAY
#endif],
[AC_MSG_RESULT([amalgamation found and is okay])
_SVN_SQLITE_DSO_LIBS
AC_DEFINE(SVN_SQLITE_INLINE, 1,
[Defined if svn should use the amalgamated version of sqlite])
SVN_SQLITE_INCLUDES="-I`dirname $sqlite_amalg`"
if test -n "$svn_sqlite_dso_ldflags"; then
SVN_SQLITE_LIBS="$svn_sqlite_dso_ldflags -lpthread"
else
SVN_SQLITE_LIBS="-lpthread"
fi
svn_lib_sqlite="yes"],
[AC_MSG_RESULT([unsupported amalgamation SQLite version])])
fi
])
dnl SVN_SQLITE_VERNUM_PARSE(version_string, result_var)
dnl
dnl Parse a x.y[.z] version string version_string into a number result_var.
AC_DEFUN(SVN_SQLITE_VERNUM_PARSE,
[
version_string="$1"
major=`expr $version_string : '\([[0-9]]*\)'`
minor=`expr $version_string : '[[0-9]]*\.\([[0-9]]*\)'`
micro=`expr $version_string : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test -z "$micro"; then
micro=0
fi
$2=`expr $major \* 1000000 \
\+ $minor \* 1000 \
\+ $micro`
])
dnl SVN_SQLITE_MIN_VERNUM_PARSE()
dnl
dnl Parse a x.y.z version string SQLITE_MINIMUM_VER into a number
dnl sqlite_min_ver_num.
AC_DEFUN(SVN_SQLITE_MIN_VERNUM_PARSE,
[
SVN_SQLITE_VERNUM_PARSE([$SQLITE_MINIMUM_VER], [sqlite_min_ver_num])
])
dnl SVN_DOWNLOAD_SQLITE()
dnl no sqlite found, print out a message telling the user what to do
AC_DEFUN(SVN_DOWNLOAD_SQLITE,
[
echo ""
echo "An appropriate version of sqlite could not be found. We recommmend"
echo "${SQLITE_RECOMMENDED_VER}, but require at least ${SQLITE_MINIMUM_VER}."
echo "Please either install a newer sqlite on this system"
echo ""
echo "or"
echo ""
echo "get the sqlite ${SQLITE_RECOMMENDED_VER} amalgamation from:"
echo " ${SQLITE_URL}"
echo "unpack the archive using unzip and rename the resulting"
echo "directory to:"
echo "$abs_srcdir/sqlite-amalgamation"
if test x"$abs_srcdir" != x"$abs_builddir"; then
echo "or to:"
echo "$abs_builddir/sqlite-amalgamation"
fi
echo ""
AC_MSG_ERROR([Subversion requires SQLite])
])
dnl _SVN_SQLITE_DSO_LIBS() dnl Find additional libraries that the
dnl sqlite amalgamation code should link in order to load
dnl shared libraries. Copied from build/libtool.m4
( run in 0.504 second using v1.01-cache-2.11-cpan-6b5c3043376 )