From 7d8e6af2df12442c1c133956b3acf3fdbc496423 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 27 Oct 2011 11:32:40 +0200 Subject: Use pk-config to test for lua. --- configure.in | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/configure.in b/configure.in index 6c78153..1e57226 100644 --- a/configure.in +++ b/configure.in @@ -18,6 +18,11 @@ AC_OUTPUT(lib/Makefile) AC_DEFINE_UNQUOTED(ETC, "$prefix/etc/miav", [The path to the config files]) AC_DEFINE_UNQUOTED(PIXMAPS, "$prefix/share/pixmaps", [The path to the pixmap files]) +dnl ====================== +dnl Init pkg-config +dnl ====================== +PKG_PROG_PKG_CONFIG(0.23) + AC_ARG_WITH(debug, [ --with-debug Build with debugging (-g -Wall -Werror)]) if test x$with_debug == xyes; then CXXFLAGS="$CXXFLAGS -g -Wall -Werror" @@ -127,38 +132,9 @@ dnl ====================== AC_HAVE_HEADERS(getopt.h) dnl ====================== -dnl Check for the lua library +dnl Check for lua dnl ====================== -LUADIR="/usr" - -AC_ARG_WITH(luadir, [ --with-luadir=DIR The prefix to where LUA 5.1 is installed], - LUADIR=${withval} -) - -LDFLAGS="${LDFLAGS} -L${LUADIR}/lib" -LIBS="${LIBS} -llua -lm -ldl" -CFLAGS="${CFLAGS} -I${LUADIR}/include" -CXXFLAGS="${CXXFLAGS} -I${LUADIR}/include" -CPPFLAGS="${CPPFLAGS} -I${LUADIR}/include" - -AC_SUBST(CFLAGS) -AC_SUBST(CXXFLAGS) -AC_SUBST(CPPFLAGS) -AC_SUBST(LDFLAGS) -AC_SUBST(LIBS) -AC_CHECK_HEADER(lua.h, , AC_MSG_ERROR([*** lua headers not found!])) -AC_CHECK_HEADER(lualib.h, , AC_MSG_ERROR([*** lualib header not found!])) -AC_CHECK_HEADER(lauxlib.h, , AC_MSG_ERROR([*** lauxlib header not found!])) -AC_MSG_CHECKING([for lua_open in -llua using LUADIR=${LUADIR}]) -AC_TRY_RUN([ - #include - - int main(int argc, char *argv[]) - { - lua_open(); - return 0; - } -],AC_MSG_RESULT([yes]), AC_MSG_ERROR([*** lib lua not found!]) ) +PKG_CHECK_MODULES(LUA, lua >= 5.1) dnl ====================== dnl Check for pthread library -- cgit v1.2.3