From a11e9e348b773cc763b33675f384b0960043a7a0 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 2 May 2015 07:36:48 +1200 Subject: [PATCH 1/2] Configure native dependencies from the makefile. --- Makefile | 2 +- configure | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3f5d97d132..0e1507f8c0 100644 --- a/Makefile +++ b/Makefile @@ -271,7 +271,7 @@ $(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog)))) ########################## MAKE/INSTALL RULES ########################## # -default: cli-dependencies core +default: dependencies core core: game renderers mods utility diff --git a/configure b/configure index eb2ea532c5..6ea8bd1a58 100755 --- a/configure +++ b/configure @@ -5,6 +5,11 @@ os=`uname` if [ "$os" == 'Linux' ]; 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 @@ -14,6 +19,7 @@ if [ "$os" == 'Linux' ]; then fi done done + if [ -z "$liblua51" ]; then echo "Lua 5.1 library detection failed." exit 1 @@ -22,9 +28,18 @@ if [ "$os" == 'Linux' ]; then echo "Eluant.dll.config has been created successfully." fi elif [ "$os" == 'Darwin' ]; then - echo "Downloading pre-compiled lua and SDL2 libraries" - curl -Os https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/master/dependencies/Eluant.dll.config - curl -Os https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/master/dependencies/liblua.5.1.dylib - curl -Os https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/master/dependencies/libSDL2.dylib - echo "Downloaded Lua 5.1 and SDL2 libraries successfully." + if [ ! -f libSDL2.dylib ]; then + echo "Fetching OS X SDL2 library from GitHub." + curl -LOs https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/master/dependencies/libSDL2.dylib + fi + + if [ ! -f liblua.5.1.dylib ]; then + echo "Fetching OS X Lua 5.1 library from GitHub." + curl -LOs https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/master/dependencies/liblua.5.1.dylib + fi + + if [ ! -f Eluant.dll.config ]; then + echo "Fetching OS X Lua configuration file from GitHub." + curl -LOs https://raw.githubusercontent.com/OpenRA/OpenRALauncherOSX/master/dependencies/Eluant.dll.config + fi fi From 2682dc4228033322498aaf71b24f419eeda13ede Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 2 May 2015 11:43:58 +1200 Subject: [PATCH 2/2] Move native deps script into thirdparty to avoid confusion. --- Makefile | 2 +- configure => thirdparty/configure-native-deps.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename configure => thirdparty/configure-native-deps.sh (100%) diff --git a/Makefile b/Makefile index 0e1507f8c0..eb80a08d0b 100644 --- a/Makefile +++ b/Makefile @@ -302,7 +302,7 @@ cli-dependencies: @ $(CP_R) thirdparty/*.dll.config . native-dependencies: - @./configure + @./thirdparty/configure-native-deps.sh version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/modchooser/mod.yaml @for i in $? ; do \ diff --git a/configure b/thirdparty/configure-native-deps.sh similarity index 100% rename from configure rename to thirdparty/configure-native-deps.sh