Skip to content

Commit

Permalink
configure.ac: Fix Lua-source configuration
Browse files Browse the repository at this point in the history
Ugh, so many different cases...
  • Loading branch information
snogglethorpe committed Apr 14, 2012
1 parent e8e5b55 commit ace10fa
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ if test "$lua_src" != none; then
AC_MSG_RESULT([$build_lua_in_src_dir])
fi

AM_CONDITIONAL([build_lua], [test x"$lua_src" != xnone])

AM_CONDITIONAL([build_lua_in_src_dir], [test $build_lua_in_src_dir = yes])

##
Expand Down Expand Up @@ -635,7 +633,7 @@ AC_DEFUN([SNOGRAY_CHECK_SUBDIR_HEADER], [
#
have_liblua=no
have_luajit=no
if test x"$lua_src" != xnone; then
if test $build_lua_from_src = yes; then
# set "have_liblua" here to skip the tests for a system Lua library;
# liblua_CFLAGS and liblua_LIBS will be set below
have_liblua=yes
Expand Down Expand Up @@ -684,17 +682,27 @@ if test $have_liblua = no; then
AC_LANG_POP(C)
fi
if test $have_liblua = no || test $build_lua_from_src = yes; then
AC_SUBST([liblua_CFLAGS], ['-I$(LUA_SRC)'])
AC_SUBST([liblua_LIBS], [liblua.a])
if test x"$lua_src" != xnone; then
AC_SUBST([liblua_CFLAGS], ['-I$(LUA_SRC)'])
AC_SUBST([liblua_LIBS], [liblua.a])
build_lua_from_src=yes
have_liblua=yes
fi
else
build_lua_from_src=no
fi
if test "$have_liblua" = no; then
AC_MSG_ERROR([A Lua library is required, and was not found; aborting...])
AC_MSG_ERROR([A Lua library is required, and none was found; aborting...])
fi
if test $have_luajit = yes; then
AC_DEFINE([HAVE_LUAJIT], [1], [Define if using LuaJIT])
fi
AM_CONDITIONAL([have_luajit], [test $have_luajit = yes])

AC_MSG_CHECKING([whether to build Lua from source])
AC_MSG_RESULT([$build_lua_from_src])
AM_CONDITIONAL([build_lua], [test $build_lua_from_src = yes])


# Check for FFTW3 optimized FFT library; we actually check for
# "fftw3f", which is the single-precision variant.
Expand Down

0 comments on commit ace10fa

Please sign in to comment.