summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Jeffrey Clark <h0tw1r3@users.noreply.github.com>2016-06-04 00:23:54 -0500
committer Jeffrey Clark <h0tw1r3@users.noreply.github.com>2016-06-04 00:34:43 -0500
commit2e8521cde0b90d80a510be594a2124079edfea27 (patch)
tree54c59cb052695200e7b5ae4e14285fb2399ef85b
parent109e7fffd0c76f3140c508a9f2ab04023b8439a5 (diff)
fix android target libSDL2 circular ref (nw)
also rename ANDROID_NDK_ROOT -> ANDROID_NDK_LLVM to point directly to prebuilt host compiler (removes windows only restriction).
-rw-r--r--makefile48
-rw-r--r--scripts/src/osd/sdl.lua12
-rw-r--r--scripts/toolchain.lua59
3 files changed, 56 insertions, 63 deletions
diff --git a/makefile b/makefile
index 0f4e3343744..bd0f334876b 100644
--- a/makefile
+++ b/makefile
@@ -1051,8 +1051,8 @@ $(PROJECTDIR_SDL)/gmake-android-arm/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_ARM
$(error ANDROID_NDK_ARM is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-arm --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=arm --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 gmake
@@ -1061,8 +1061,8 @@ android-arm: generate $(PROJECTDIR_SDL)/gmake-android-arm/Makefile
ifndef ANDROID_NDK_ARM
$(error ANDROID_NDK_ARM is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-arm config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-arm config=$(CONFIG)
@@ -1075,8 +1075,8 @@ $(PROJECTDIR_SDL)/gmake-android-arm64/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_ARM64
$(error ANDROID_NDK_ARM64 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-arm64 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=arm64 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 gmake
@@ -1085,8 +1085,8 @@ android-arm64: generate $(PROJECTDIR_SDL)/gmake-android-arm64/Makefile
ifndef ANDROID_NDK_ARM64
$(error ANDROID_NDK_ARM64 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-arm64 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-arm64 config=$(CONFIG)
@@ -1099,8 +1099,8 @@ $(PROJECTDIR_SDL)/gmake-android-mips/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_MIPS
$(error ANDROID_NDK_MIPS is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-mips --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=mips --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 gmake
@@ -1109,8 +1109,8 @@ android-mips: generate $(PROJECTDIR_SDL)/gmake-android-mips/Makefile
ifndef ANDROID_NDK_MIPS
$(error ANDROID_NDK_MIPS is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-mips config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-mips config=$(CONFIG)
@@ -1123,8 +1123,8 @@ $(PROJECTDIR_SDL)/gmake-android-mips64/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_MIPS64
$(error ANDROID_NDK_MIPS64 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-mips64 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=mips64 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 --NOASM=1 gmake
@@ -1133,8 +1133,8 @@ android-mips64: generate $(PROJECTDIR_SDL)/gmake-android-mips64/Makefile
ifndef ANDROID_NDK_MIPS64
$(error ANDROID_NDK_MIPS64 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-mips64 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-mips64 config=$(CONFIG)
@@ -1147,8 +1147,8 @@ $(PROJECTDIR_SDL)/gmake-android-x86/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_X86
$(error ANDROID_NDK_X86 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-x86 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=x86 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 gmake
@@ -1157,8 +1157,8 @@ android-x86: generate $(PROJECTDIR_SDL)/gmake-android-x86/Makefile
ifndef ANDROID_NDK_X86
$(error ANDROID_NDK_X86 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-x86 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-x86 config=$(CONFIG)
@@ -1171,8 +1171,8 @@ $(PROJECTDIR_SDL)/gmake-android-x64/Makefile: makefile $(SCRIPTS) $(GENIE)
ifndef ANDROID_NDK_X64
$(error ANDROID_NDK_X64 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(GENIE) $(PARAMS) --gcc=android-x64 --gcc_version=3.8.0 --osd=sdl --targetos=android --PLATFORM=x64 --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_X11=1 --DONT_USE_NETWORK=1 gmake
@@ -1181,8 +1181,8 @@ android-x64: generate $(PROJECTDIR_SDL)/gmake-android-x64/Makefile
ifndef ANDROID_NDK_X64
$(error ANDROID_NDK_X64 is not set)
endif
-ifndef ANDROID_NDK_ROOT
- $(error ANDROID_NDK_ROOT is not set)
+ifndef ANDROID_NDK_LLVM
+ $(error ANDROID_NDK_LLVM is not set)
endif
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-x64 config=$(CONFIG) precompile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-android-x64 config=$(CONFIG)
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index d1a83229698..7766b69873d 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -239,7 +239,7 @@ elseif _OPTIONS["targetos"]=="macosx" then
SDL_NETWORK = "pcap"
end
-if _OPTIONS["with-bundled-sdl2"]~=nil or _OPTIONS["targetos"]=="android" then
+if _OPTIONS["with-bundled-sdl2"]~=nil then
includedirs {
GEN_DIR .. "includes",
}
@@ -295,10 +295,12 @@ if BASE_TARGETOS=="unix" then
"/usr/openwin/lib",
}
end
- if _OPTIONS["with-bundled-sdl2"]~=nil and _OPTIONS["targetos"]~="android" then
- links {
- "SDL2",
- }
+ if _OPTIONS["with-bundled-sdl2"]~=nil then
+ if _OPTIONS["targetos"]~="android" then
+ links {
+ "SDL2",
+ }
+ end
else
local str = backtick(sdlconfigcmd() .. " --libs")
addlibfromstring(str)
diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua
index 23429e52602..d94b8abddec 100644
--- a/scripts/toolchain.lua
+++ b/scripts/toolchain.lua
@@ -114,80 +114,71 @@ function toolchain(_buildDir, _subDir)
os.exit(1)
end
- if "android-arm" == _OPTIONS["gcc"] then
+ if string.find(_OPTIONS["gcc"], "android") then
+ if not os.getenv("ANDROID_NDK_LLVM") then
+ print("Set ANDROID_NDK_LLVM envrionment variables.")
+ end
+
+ premake.gcc.cc = "$(ANDROID_NDK_LLVM)/bin/clang"
+ premake.gcc.cxx = "$(ANDROID_NDK_LLVM)/bin/clang++"
+ premake.gcc.llvm = true
+ end
- if not os.getenv("ANDROID_NDK_ARM") or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_ARM and ANDROID_NDK_ROOT envrionment variables.")
+ if "android-arm" == _OPTIONS["gcc"] then
+ if not os.getenv("ANDROID_NDK_ARM") then
+ print("Set ANDROID_NDK_ARM envrionment variables.")
end
- premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
- premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
- premake.gcc.llvm = true
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-arm")
end
if "android-arm64" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_ARM64") or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_ARM64 and ANDROID_NDK_ROOT envrionment variables.")
+ if not os.getenv("ANDROID_NDK_ARM64") then
+ print("Set ANDROID_NDK_ARM64 envrionment variables.")
end
- premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
- premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
- premake.gcc.ar = "$(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-ar.exe"
+ premake.gcc.ar = "$(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-ar"
premake.gcc.llvm = true
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-arm64")
end
if "android-mips" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_MIPS") or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_MIPS and ANDROID_NDK_ROOT envrionment variables.")
+ if not os.getenv("ANDROID_NDK_MIPS") then
+ print("Set ANDROID_NDK_MIPS envrionment variables.")
end
- premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
- premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
premake.gcc.ar = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-ar"
premake.gcc.llvm = true
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-mips")
end
if "android-mips64" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_MIPS64") or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_MIPS64 and ANDROID_NDK_ROOT envrionment variables.")
+ if not os.getenv("ANDROID_NDK_MIPS64") then
+ print("Set ANDROID_NDK_MIPS64 envrionment variables.")
end
- premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
- premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
- premake.gcc.ar = "$(ANDROID_NDK_MIPS64)/bin/mips64el-linux-android-ar.exe"
+ premake.gcc.ar = "$(ANDROID_NDK_MIPS64)/bin/mips64el-linux-android-ar"
premake.gcc.llvm = true
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-mips64")
end
if "android-x86" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_X86") or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_X86 and ANDROID_NDK_ROOT envrionment variables.")
+ if not os.getenv("ANDROID_NDK_X86") then
+ print("Set ANDROID_NDK_X86 envrionment variables.")
end
- premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
- premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar"
premake.gcc.llvm = true
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-x86")
end
if "android-x64" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_X64") or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_X64 and ANDROID_NDK_ROOT envrionment variables.")
+ if not os.getenv("ANDROID_NDK_X64") then
+ print("Set ANDROID_NDK_X64 envrionment variables.")
end
- premake.gcc.cc = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"
- premake.gcc.cxx = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
- premake.gcc.ar = "$(ANDROID_NDK_X64)/bin/x86_64-linux-android-ar.exe"
+ premake.gcc.ar = "$(ANDROID_NDK_X64)/bin/x86_64-linux-android-ar"
premake.gcc.llvm = true
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-x64")
end