From 6a5eb24a902647529411aa4a43a55e5c886e73f6 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Tue, 2 Oct 2012 02:32:15 +0200 Subject: [PATCH] Check for presence of lua and luac in configure and use path in Makefile This should help to prevent generating lua bytecode for a different version than the library being linked to. Not at all reliable, but a bit better than before. --- Makefile.am | 8 ++++---- configure.ac | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index fcc9bfc..2c97adb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,14 +46,14 @@ runner.o: runner.c defaults.o: defaults.c runner.c: runner.out bin2carray.lua - lua ./bin2carray.lua $< runner $@ + $(LUA) ./bin2carray.lua $< runner $@ defaults.c: defaults.out bin2carray.lua - lua ./bin2carray.lua $< defaults $@ + $(LUA) ./bin2carray.lua $< defaults $@ runner.out: lsyncd.lua - luac -o $@ $< + $(LUAC) -o $@ $< defaults.out: default.lua default-rsync.lua default-rsyncssh.lua default-direct.lua - luac -o $@ $^ + $(LUAC) -o $@ $^ diff --git a/configure.ac b/configure.ac index a58625e..e0cd7e6 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,16 @@ PKG_CHECK_MODULES([LUA], [lua >= 5.1.3]) ]) ]) +AC_PATH_PROGS([LUA], [lua5.1 lua51 lua], [no]) +if test x${LUA} = xno ; then + AC_MSG_ERROR([Program 'lua' is required]) +fi + +AC_PATH_PROGS([LUAC], [luac5.1 luac51 luac], [no]) +if test x${LUAC} = xno ; then + AC_MSG_ERROR([Program 'luac' is required]) +fi + ### # Checks for header files. AC_CHECK_HEADERS([sys/inotify.h])