Merge pull request #919 from h0tw1r3/master

fix android target libSDL2 circular ref (nw)
This commit is contained in:
Miodrag Milanović 2016-06-04 08:01:42 +02:00
commit 68a362bcd9
3 changed files with 57 additions and 64 deletions

View File

@ -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)

View File

@ -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)

View File

@ -114,80 +114,71 @@ function toolchain(_buildDir, _subDir)
os.exit(1)
end
if "android-arm" == _OPTIONS["gcc"] then
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 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_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.cc = "$(ANDROID_NDK_LLVM)/bin/clang"
premake.gcc.cxx = "$(ANDROID_NDK_LLVM)/bin/clang++"
premake.gcc.llvm = true
end
if "android-arm" == _OPTIONS["gcc"] then
if not os.getenv("ANDROID_NDK_ARM") then
print("Set ANDROID_NDK_ARM envrionment variables.")
end
premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
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