aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-18 17:31:40 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-18 17:31:40 +0000
commite2946e9a9c27808d99a1d8e35e17f6257efd8c1e (patch)
treedf9bc399b87c893f949c7372bbd104b22e96618b /CMakeLists.txt
parent913a6b1ffa1fba46dc5b2ce92874ed1b1d07a3d1 (diff)
downloadrspamd-e2946e9a9c27808d99a1d8e35e17f6257efd8c1e.tar.gz
rspamd-e2946e9a9c27808d99a1d8e35e17f6257efd8c1e.zip
Fix luajit detection.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt74
1 files changed, 35 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a2d1178a..e681f6944 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,6 +122,7 @@ MACRO(FindLua _major _minor)
# Find lua libraries
MESSAGE(STATUS "Check for lua ${_major}.${_minor}")
+ UNSET(LUA_INCLUDE_DIR CACHE)
FIND_PATH(LUA_INCLUDE_DIR lua.h
HINTS
$ENV{LUA_DIR}
@@ -131,6 +132,7 @@ MACRO(FindLua _major _minor)
include/lua include
PATHS
/usr/local
+ /usr/pkg
/usr
~/Library/Frameworks
/Library/Frameworks
@@ -140,42 +142,13 @@ MACRO(FindLua _major _minor)
/opt
)
- FIND_LIBRARY(LUA_LIBRARY
- NAMES lua
- "lua${_major}${_minor}"
- "lua${_major}.${_minor}"
- "lua-${_major}.${_minor}"
- HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- /usr/local
- /usr
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
- DOC "Lua library"
- )
-
- IF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
- SET(LUA_FOUND 1)
- IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
- SET(LUA_VERSION_MAJOR ${_major})
- SET(LUA_VERSION_MINOR ${_minor})
- ENDIF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
- MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
- ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
-
# Check for luajit
IF(ENABLE_LUAJIT MATCHES "ON")
- FIND_LIBRARY(LUAJIT_LIBRARY NAMES
+ FIND_LIBRARY(LUA_LIBRARY NAMES
"luajit${_major}${_minor}"
"luajit${_major}.${_minor}"
"luajit-${_major}.${_minor}"
- luajit
+ "luajit"
HINTS
$ENV{LUA_DIR}
PATH_SUFFIXES lib64 lib
@@ -187,12 +160,38 @@ MACRO(FindLua _major _minor)
/sw
/opt/local
/opt/csw
+ /usr/pkg
/opt
)
- IF(NOT LUAJIT_LIBRARY)
- MESSAGE(FATAL_ERROR "Luajit not found but enabled in configuration")
- ENDIF(NOT LUAJIT_LIBRARY)
+ ELSE(ENABLE_LUAJIT MATCHES "ON")
+ FIND_LIBRARY(LUA_LIBRARY
+ NAMES lua
+ "lua${_major}${_minor}"
+ "lua${_major}.${_minor}"
+ "lua-${_major}.${_minor}"
+ HINTS
+ $ENV{LUA_DIR}
+ PATH_SUFFIXES lib64 lib
+ PATHS
+ /usr/local
+ /usr
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ DOC "Lua library"
+ )
ENDIF(ENABLE_LUAJIT MATCHES "ON")
+ IF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
+ SET(LUA_FOUND 1)
+ IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
+ SET(LUA_VERSION_MAJOR ${_major})
+ SET(LUA_VERSION_MINOR ${_minor})
+ ENDIF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
+ MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+ ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
ENDMACRO(FindLua _major _minor)
FUNCTION(INSTALL_IF_NOT_EXISTS src dest suffix)
@@ -931,11 +930,8 @@ IF(WITH_DB)
LIST(APPEND RSPAMD_REQUIRED_LIBRARIES db)
ENDIF(WITH_DB)
-IF(ENABLE_LUAJIT MATCHES "ON")
- LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${LUAJIT_LIBRARY}")
-ELSE(ENABLE_LUAJIT MATCHES "ON")
- LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${LUA_LIBRARY}")
-ENDIF(ENABLE_LUAJIT MATCHES "ON")
+
+LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${LUA_LIBRARY}")
IF(ENABLE_GPERF_TOOLS MATCHES "ON")
LIST(APPEND RSPAMD_REQUIRED_LIBRARIES profiler)