From 6451ad61a1aac3c116ca1df66b3bfb61d393500c Mon Sep 17 00:00:00 2001 From: Rick Bird Date: Tue, 26 Apr 2011 02:49:28 -0400 Subject: [PATCH] Added lua detection. configure now stops if it can't find system lua or ltdl... Next step, add an argument to look use local installations IssueID #240 --- Makefile.in | 2 +- configure.ac | 28 ++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index fa34e7c..987d5e8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,7 +22,7 @@ SQL_LDFLAGS=@MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@ @SQLITE3_LDFLAGS@ CCFLAGS=@CFLAGS@ -I.. -I../hdrs -I/usr/include/lua5.1 @CPPFLAGS@ @PCRE_CFLAGS@ -Werror LDFLAGS=@LDFLAGS@ -CLIBS=@LIBS@ @PCRE_LIBS@ @LIBLTDL@ -llua5.1 +CLIBS=@LIBS@ @PCRE_LIBS@ @LIBLTDL@ @LIBLUA@ INSTALL=@INSTALL@ INSTALLDIR=$installdir CP=@CP@ diff --git a/configure.ac b/configure.ac index 7729087..ba9ad41 100644 --- a/configure.ac +++ b/configure.ac @@ -23,14 +23,6 @@ fi AC_LANG(C) -AC_CHECK_HEADER([ltdl.h], - [AC_CHECK_LIB([ltdl], [lt_dladvise_init], - [LIBLTDL=-lltdl], [LIBLTDL=])], - [LIBLTDL=]) - -AC_SUBST([LIBLTDL]) - - ### Programs AC_PATH_PROG(CAT, cat) @@ -201,6 +193,26 @@ AC_CHECK_LIB(crypt, crypt) LIB_SOCKET_NSL AC_CHECK_LIB(fam, FAMOpen) +# Make these smarters.. And allow for local packages to exist +AC_CHECK_HEADER([ltdl.h], + [AC_CHECK_LIB([ltdl], [lt_dladvise_init], + [LIBLTDL=-lltdl], + AC_MSG_ERROR([Advise your server admin to install libltdl]) + )], + AC_MSG_ERROR([Advise your server admin to install libltdl]) + ) +AC_CHECK_HEADER([lua5.1/lua.h], + [AC_CHECK_LIB([lua5.1], [lua_close], + [LIBLUA=-llua5.1], + AC_MSG_ERROR([No lua found on your system.]) + )], + AC_MSG_ERROR([No lua found on your system.]) + ) +AC_SUBST([LIBLTDL]) +AC_SUBST([LIBLUA]) + + + if test "$enable_zlib" = "yes"; then AC_CHECK_LIB(z, gzungetc) fi -- 2.30.2