📄 configure.in
字号:
fi AC_MSG_RESULT(trying $ssllib $sslinc)fidnl Implement the SSL library checking routine.dnl This will define HAVE_LIBSSL in gw-config.hif test "x$ssllib" != "x" && test "x$sslinc" != "x"; then CFLAGS="$CFLAGS -I$sslinc" LIBS="$LIBS -L$ssllib" AC_PATH_PROG(OPENSSL, openssl, no) if test "$OPENSSL" = "yes"; then AC_MSG_CHECKING([openssl version]) openssl_version=`$OPENSSL version | awk '{print $2}'` AC_MSG_RESULT([$openssl_version]) fi AC_CHECK_LIB(crypto, CRYPTO_lock, [ LIBS="$LIBS -lcrypto" AC_CHECK_LIB(ssl, SSL_library_init, [ AC_CHECK_LIB(ssl, SSL_connect) AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ openssl/pem.h openssl/ssl.h openssl/err.h) AC_MSG_CHECKING(whether the OpenSSL library is multithread-enabled) AC_TRY_RUN([ #define OPENSSL_THREAD_DEFINES #include <openssl/opensslconf.h> int main(void) { #if defined(THREADS) exit(0); #elif defined(OPENSSL_THREADS) exit(0); #else exit(1); #endif } ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LIBSSL) LIBS="$LIBS -lssl" AC_MSG_CHECKING([whether to compile with SSL support]) AC_MSG_RESULT(yes) ], [ AC_ARG_ENABLE(ssl-thread-test, [ --disable-ssl-thread-test disable the multithread test for the OpenSSL library this will force to continue even if the test fails], [ if test "$enableval" = no ; then AC_MSG_RESULT([no, continue forced]) fi ], [ AC_MSG_RESULT(no) AC_MSG_ERROR(Either get a multithread-enabled SSL or configure with --disable-ssl) ]) ], echo "Cross-compiling; make sure your SSL library is multithread-enabled" ) ]) ])fiAC_CONFIG_SECTION([Configuring DB support])dnl Implement the --with-mysql option. This will set HAVE_MYSQL in gw-config.hdnl accordingly and enable the usage of the libmysqlclient routines.AC_MSG_CHECKING([whether to compile with MySQL support])AC_ARG_WITH(mysql,[ --with-mysql enable MySQL storage [disabled]], [if test "$withval" != yes ; then AC_MSG_RESULT(disabled)else dnl Implement the --with-mysql-dir option. AC_ARG_WITH(mysql-dir, [ --with-mysql-dir=DIR where to look for MySQL libs and header files DIR points to the installation [/usr/local/mysql] ], [ mysqlloc="" if test -d "$withval" ; then mysqlloc="$withval" fi ]) AC_MSG_RESULT(searching) AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, [$PATH:$mysqlloc/bin:$mysqlloc]) dnl check for MySQL 4.x style mysql_config information if test "$MYSQL_CONFIG" = "no"; then found="" for loc in $mysqlloc /usr /usr/local ; do if test "x$found" = "x" ; then AC_MSG_CHECKING([for MySQL client support in]) AC_MSG_RESULT($loc) AC_CHECK_FILE("$loc/include/mysql/mysql.h", [CFLAGS="$CFLAGS -I$loc/include/mysql"; LIBS="$LIBS -L$loc/lib/mysql -lmysqlclient"]; found=1, [AC_CHECK_FILE("$loc/include/mysql.h", [CFLAGS="$CFLAGS -I$loc/include"; LIBS="$LIBS -L$loc/lib -lmysqlclient"]; found=1 )] ) fi done if test "x$found" != "x1" ; then AC_MSG_ERROR([Unable to find mysql.h, please provide a --with-mysql-dir=<dir> location]) fi else dnl mysql_config found AC_MSG_CHECKING([mysql version]) mysql_version=`$MYSQL_CONFIG --version` AC_MSG_RESULT([$mysql_version]) dnl mysql-4.x style MYSQL_LIBS="" if $MYSQL_CONFIG --libs_r &>/dev/null ; then MYSQL_LIBS="$($MYSQL_CONFIG --libs_r)" AC_MSG_CHECKING([mysql reentrant libs]) AC_MSG_RESULT([ $MYSQL_LIBS ]) AC_CHECK_LIB(mysqlclient_r, mysql_init, [ LIBS="$LIBS $MYSQL_LIBS" ], [ MYSQL_LIBS="" ], [ $MYSQL_LIBS ]) fi if test -z "$MYSQL_LIBS" ; then MYSQL_LIBS="$($MYSQL_CONFIG --libs)" AC_MSG_CHECKING([mysql libs]) AC_MSG_RESULT([ $MYSQL_LIBS ]) AC_CHECK_LIB(mysqlclient, mysql_init, [ LIBS="$LIBS $MYSQL_LIBS" ], [AC_MSG_ERROR([Unable to find MySQL client libraries])], [ $MYSQL_LIBS ]) fi AC_MSG_CHECKING([mysql includes]) dnl mysql-4.x style if $MYSQL_CONFIG --include &>/dev/null ; then CFLAGS="$CFLAGS $($MYSQL_CONFIG --include)" AC_MSG_RESULT([$($MYSQL_CONFIG --include)]) else CFLAGS="$CFLAGS $($MYSQL_CONFIG --cflags)" AC_MSG_RESULT([$($MYSQL_CONFIG --cflags)]) fi fi AC_CHECK_HEADERS(mysql/mysql.h mysql/mysql_version.h) AC_DEFINE(HAVE_MYSQL) AC_MSG_CHECKING([whether to compile with MySQL support]) AC_MSG_RESULT(yes) MYSQL="yes" fi],[ AC_MSG_RESULT(disabled)])dnl Implement the --with-sdb option. This will set HAVE_SDB in gw-config.hdnl accordingly and enable the usage of the libsdb routines.AC_MSG_CHECKING([whether to compile with LibSDB support])AC_ARG_WITH(sdb,[ --with-sdb enable LibSDB storage [disabled]], [ if test "$withval" != yes; then AC_MSG_RESULT(disabled) else AC_MSG_RESULT(searching) AC_PATH_PROGS(SDB_CONFIG, sdb-config, no) if test "$SDB_CONFIG" = "no"; then AC_MSG_ERROR(Unable to find sdb-config in path for SDB support) else AC_MSG_CHECKING([sdb version]) sdb_version=`$SDB_CONFIG --version` AC_MSG_RESULT([$sdb_version]) LIBS="$LIBS `$SDB_CONFIG --libs`" CFLAGS="$CFLAGS `$SDB_CONFIG --cflags`" AC_CHECK_HEADERS(sdb.h) dnl AC_CHECK_LIB(sdb, sdb_init, [LIBS="`$SDB_CONFIG --libs`"]) AC_CHECK_FUNCS(sdb_init) AC_DEFINE(HAVE_SDB) AC_DEFINE_UNQUOTED(LIBSDB_VERSION, "$sdb_version") SDB="yes" fi fi],[ AC_MSG_RESULT(disabled)])dnl Implement the --with-sqlite option. This will set HAVE_SQLITE in gw-config.hdnl accordingly and enable the usage of the libsqlite routines.AC_MSG_CHECKING([whether to compile with SQLite support])AC_ARG_WITH(sqlite,[ --with-sqlite enable SQLite storage [disabled]], [ if test "$withval" != yes; then AC_MSG_RESULT(disabled) else AC_MSG_RESULT(searching) AC_CHECK_HEADERS(sqlite.h) LIBS="$LIBS -L/usr/local/lib" AC_CHECK_LIB(sqlite, sqlite_open, [LIBS="$LIBS -lsqlite"]) AC_PATH_PROGS(SQLITE, sqlite, no) AC_MSG_CHECKING([sqlite version]) sqlite_version=`$SQLITE -version` AC_MSG_RESULT([$sqlite_version]) AC_DEFINE(HAVE_SQLITE) SQLITE="yes" fi],[ AC_MSG_RESULT(disabled)])dnl Implement the --with-oracle option. This will set HAVE_ORACLE in gw-config.hdnl accordingly and enable the usage of the OCI routines.AC_MSG_CHECKING([whether to compile with Oracle support])AC_ARG_WITH(oracle,[ --with-oracle enable ORACLE storage [disabled]],[ AC_MSG_RESULT(searching) AC_ARG_WITH( oracle-includes, [ --with-oracle-includes=DIR adds oracle include paths], [ ORACLE_INCLUDE_PATH="$withval" ], [ ORACLE_INCLUDE_PATH="$ORACLE_HOME/rdbms/demo $ORACLE_HOME/rdbms/public" ] ) for a in $ORACLE_INCLUDE_PATH do CPPFLAGS="$CPPFLAGS -I$a" done AC_MSG_CHECKING([for oci.h ]) AC_TRY_CPP([#include <oci.h>],AC_MSG_RESULT(yes), AC_MSG_ERROR([oci.h not found])) CFLAGS="$CFLAGS $CPPFLAGS" AC_ARG_WITH( oracle-libs, [ --with-oracle-libs=DIR adds oracle library path], [ ORACLE_LIB_PATH="$withval" ], [ ORACLE_LIB_PATH="$ORACLE_HOME/lib" ] ) for a in $ORACLE_LIB_PATH do LIBS="$LIBS -L$a" done AC_CHECK_LIB(clntsh,OCIEnvCreate,[ LIBS="$LIBS -lclntsh" ],exit) if test -f "$ORACLE_HOME/lib/libwtc8.so" then AC_CHECK_LIB(wtc8,wtcstu,[ LIBS="$LIBS -lwtc8" ],AC_MSG_ERROR([Oracle libwtc8.so not found])) else AC_CHECK_LIB(wtc9,wtcstu,[ LIBS="$LIBS -lwtc9" ],AC_MSG_ERROR([Oracle libwtc9.so not found])) fi AC_DEFINE(HAVE_ORACLE) AC_MSG_CHECKING([whether to compile with Oracle support]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(disabled)])dnl Implement the --with-pgsql option. This will set HAVE_PGSQL in gw-config.hdnl accordingly and enable the usage of the libpq routines.AC_MSG_CHECKING([whether to compile with PostgresSQL support])AC_ARG_WITH(pgsql,[ --with-pgsql enable PostgreSQL storage [disabled]], [if test "$withval" != yes ; then AC_MSG_RESULT(disabled)else dnl Implement the --with-pgsql-dir option. AC_ARG_WITH(pgsql-dir, [ --with-pgsql-dir=DIR where to look for PostgreSQL libs and header files DIR points to the installation [/usr/local/pgsql] ], [ pgsqlloc="" if test -d "$withval" ; then pgsqlloc="$withval" fi ]) AC_MSG_RESULT(searching) AC_PATH_PROG(PGSQL_CONFIG, pg_config, no, [$PATH:$pgsqlloc/bin:$pgsqlloc:/usr/lib/postgresql/bin]) dnl check for PgSQL >= 7.2 style pg_config information if test "$PGSQL_CONFIG" = "no"; then found="" for loc in $pgsqlloc /usr /usr/local ; do if test "x$found" = "x" ; then AC_MSG_CHECKING([for PostgresSQL include files in]) AC_MSG_RESULT($loc) AC_CHECK_FILE("$loc/include/postgresql/libpq-fe.h", [CFLAGS="$CFLAGS -I$loc/include/postgresql"; LIBS="$LIBS -L$loc/lib/postgresql -lpq"]; found=1, [AC_CHECK_FILE("$loc/include/pgsql/libpq-fe.h", [CFLAGS="$CFLAGS -I$loc/include/pgsql"; LIBS="$LIBS -L$loc/lib/pgsql -lpq"]; found=1, [AC_CHECK_FILE("$loc/pgsql/include/libpq-fe.h", [CFLAGS="$CFLAGS -I$loc/pgsql/include"; LIBS="$LIBS -L$loc/pgsql/lib -lpq"]; found=1, )] )] ) fi done if test "x$found" != "x1" ; then AC_MSG_ERROR([Unable to find libpq-fe.h, please provide a --with-pgsql-dir=<dir> location]) fi else dnl pg_config found AC_MSG_CHECKING([PostgreSQL version]) pgsql_version=`$PGSQL_CONFIG --version` AC_MSG_RESULT([$pgsql_version]) AC_MSG_CHECKING([PostgreSQL libs]) if $PGSQL_CONFIG --libdir &>/dev/null ; then LIBS="$LIBS -L`$PGSQL_CONFIG --libdir`" pg_libdir=`$PGSQL_CONFIG --libdir` AC_MSG_RESULT([$pg_libdir]) fi AC_MSG_CHECKING([PostgreSQL includes]) if $PGSQL_CONFIG --includedir &>/dev/null ; then CFLAGS="$CFLAGS -I`$PGSQL_CONFIG --includedir`" pg_incdir=`$PGSQL_CONFIG --includedir` AC_MSG_RESULT([$pg_incdir]) fi fi AC_CHECK_HEADERS(postgresql/libpq-fe.h) AC_CHECK_LIB(pq, PQconnectdb, []) AC_DEFINE(HAVE_PGSQL) AC_MSG_CHECKING([whether to compile with PostgreSQL support]) AC_MSG_RESULT(yes) PGSQL="yes" fi],[ AC_MSG_RESULT(disabled)])dnl Implement the --with-wtls option.dnl Check to see if we should include WTLS support, and which library to use.AC_ARG_WITH(wtls,[ --with-wtls[=TYPE] select WTLS version to use: openssl/baltimore], [ AC_CONFIG_SECTION([Configuring WTLS support]) AC_MSG_CHECKING([for WTLS library]) AC_MSG_RESULT($withval) case "$withval" in openssl) OLDLIBS="$LIBS" LIBS="$LIBS -L/usr/local/ssl/lib -lcrypto" AC_CHECK_LIB(crypto, RSA_new, [ AC_CHECK_HEADERS(openssl/objects.h openssl/rc5.h, AC_DEFINE(HAVE_WTLS_OPENSSL), AC_MSG_WARN(OpenSSL installation seems to lack RC5 algorithm!) ) ]) ;; baltimore) AC_MSG_ERROR(This WTLS library is yet not supported!) ;; *) AC_MSG_ERROR(Unknown WTLS libary support!) exit 1 ;; esac])dnl Final OutputAC_CONFIG_SECTION([Generating output files]) AC_OUTPUT(gwlib/gw_uuid_types.h Makefile)dnl LICENSE noticeAC_CONFIG_SECTION([License information])cat <<X+--------------------------------------------------------------------+| License: || This software is subject to the Kannel Software License, available || in this distribution in the file LICENSE. By continuing this || installation process, you are bound by the terms of this license || agreement. If you do not agree with the terms of this license, you || must abort the installation process at this point. || || The Kannel Group <http://www.kannel.org/> |+--------------------------------------------------------------------+Thank you for using Kannel.X
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -