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@
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)
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