diff --git a/Makefile b/Makefile index c3e693b374..55a0a98dbc 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,8 @@ VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) os-dependencies = linux-dependencies +else ifneq (,$(findstring BSD,$(UNAME_S))) +os-dependencies = bsd-dependencies else ifeq ($(UNAME_S),Darwin) os-dependencies = osx-dependencies endif @@ -307,7 +309,12 @@ cli-dependencies: linux-dependencies: cli-dependencies linux-native-dependencies linux-native-dependencies: - @./thirdparty/configure-linux-native-deps.sh + @./thirdparty/configure-native-deps.sh + +bsd-dependencies: cli-dependencies bsd-native-dependencies + +bsd-native-dependencies: + @./thirdparty/configure-native-deps.sh windows-dependencies: @./thirdparty/fetch-thirdparty-deps-windows.sh diff --git a/thirdparty/configure-linux-native-deps.sh b/thirdparty/configure-linux-native-deps.sh deleted file mode 100755 index 0d3de1bf96..0000000000 --- a/thirdparty/configure-linux-native-deps.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# Use Linux system dependencies where possible, but take into account different .so names. - -os="$(uname -s)" -if [ "$os" = 'Linux' ] || [ "$os" = 'FreeBSD' ]; then - locations="/lib /lib64 /usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu /usr/local/lib /opt/lib" - sonames="liblua.so.5.1.5 liblua5.1.so.5.1 liblua5.1.so.0 liblua.so.5.1 liblua-5.1.so liblua5.1.so" - - if [ -f Eluant.dll.config ]; then - exit 0 - fi - - for location in $locations ; do - for soname in $sonames ; do - if [ -f "$location/$soname" ]; then - liblua51=$soname - echo "Detected Lua 5.1 library at "$location/$soname - break 2 - fi - done - done - - if [ -z "$liblua51" ]; then - echo "Lua 5.1 library detection failed." - exit 1 - else - sed "s/@LIBLUA51@/${liblua51}/" thirdparty/Eluant.dll.config.in > Eluant.dll.config - echo "Eluant.dll.config has been created successfully." - fi -fi diff --git a/thirdparty/configure-native-deps.sh b/thirdparty/configure-native-deps.sh new file mode 100755 index 0000000000..c3ec15277f --- /dev/null +++ b/thirdparty/configure-native-deps.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Use BSD/Linux system dependencies where possible, but take into account different .so names. + +locations="/lib /lib64 /usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu /usr/local/lib /opt/lib" +sonames="liblua.so.5.1.5 liblua5.1.so.5.1 liblua5.1.so.0 liblua.so.5.1 liblua-5.1.so liblua5.1.so" + +if [ -f Eluant.dll.config ]; then + exit 0 +fi + +for location in $locations ; do + for soname in $sonames ; do + if [ -f "$location/$soname" ]; then + liblua51=$soname + echo "Detected Lua 5.1 library at "$location/$soname + break 2 + fi + done +done + +if [ -z "$liblua51" ]; then + echo "Lua 5.1 library detection failed." + exit 1 +else + sed "s/@LIBLUA51@/${liblua51}/" thirdparty/Eluant.dll.config.in > Eluant.dll.config + echo "Eluant.dll.config has been created successfully." +fi