add BSD detection to the Makefile
This commit is contained in:
9
Makefile
9
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
|
||||
|
||||
30
thirdparty/configure-linux-native-deps.sh
vendored
30
thirdparty/configure-linux-native-deps.sh
vendored
@@ -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
|
||||
27
thirdparty/configure-native-deps.sh
vendored
Executable file
27
thirdparty/configure-native-deps.sh
vendored
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user