diff options
author | 2015-05-31 13:20:42 +0200 | |
---|---|---|
committer | 2015-05-31 13:25:17 +0200 | |
commit | 511762fa2d25965d05fc277efd29fb4a50d95420 (patch) | |
tree | 09211cade5deaa068d2e2603ba93c4ca4d8b6951 /scripts | |
parent | 3a9d6f4b4be4bed19720eea2cffab021139bd241 (diff) |
Allow compiling with shared libraries [O. Galibert]
Put SHLIB=1 in the main makefile, or on the command line.
The idea is to get a *way* faster link with symbols. It works at
least on linux, with one annoying caveat: you have to be in the
build/projects/sdl/mame/gmake-linux directory to start mame
afterwards. We're going to move some things around to be able to use
LD_LIBRARY_PATH or have it start as-is from the root.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/genie.lua | 21 | ||||
-rw-r--r-- | scripts/src/emu.lua | 9 | ||||
-rw-r--r-- | scripts/src/lib.lua | 6 | ||||
-rw-r--r-- | scripts/src/osd/osdmini.lua | 4 | ||||
-rw-r--r-- | scripts/src/osd/sdl.lua | 6 | ||||
-rw-r--r-- | scripts/src/osd/windows.lua | 4 | ||||
-rw-r--r-- | scripts/target/ldplayer/ldplayer.lua | 2 | ||||
-rw-r--r-- | scripts/target/mame/arcade.lua | 2 | ||||
-rw-r--r-- | scripts/target/mame/dummy.lua | 2 | ||||
-rw-r--r-- | scripts/target/mame/mess.lua | 2 | ||||
-rw-r--r-- | scripts/target/mame/tiny.lua | 2 |
11 files changed, 43 insertions, 17 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua index 7b88a7d3ade..b4915406b25 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -311,6 +311,21 @@ newoption { } +newoption { + trigger = "SHLIB", + description = "Generate shared libs.", + allowed = { + { "0", "Static libs" }, + { "1", "Shared libs" }, + } +} + +if _OPTIONS["SHLIB"]=="1" then + LIBTYPE = "SharedLib" +else + LIBTYPE = "StaticLib" +end + PYTHON = "python" if _OPTIONS["PYTHON_EXECUTABLE"]~=nil then @@ -743,6 +758,12 @@ if _OPTIONS["OPTIMIZE"] then end end +if _OPTIONS["SHLIB"] then + buildoptions { + "-fPIC" + } +end + if _OPTIONS["SSE2"]=="1" then buildoptions { "-msse2", diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index 3b020839b14..2eb279377b5 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -2,8 +2,9 @@ -- copyright-holders:MAMEdev Team project ("emu") +targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf") -kind "StaticLib" +kind (LIBTYPE) options { "ForceCPP", } @@ -358,7 +359,7 @@ function emuProject(_target, _subtarget) project ("optional") uuid (os.uuid("optional-" .. _target .."_" .. _subtarget)) - kind "StaticLib" + kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) options { "ForceCPP", @@ -397,7 +398,7 @@ function emuProject(_target, _subtarget) project ("bus") uuid ("5d782c89-cf7e-4cfe-8f9f-0d4bfc16c91d") - kind "StaticLib" + kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) options { "ForceCPP", @@ -428,7 +429,7 @@ function emuProject(_target, _subtarget) project ("dasm") uuid ("f2d28b0a-6da5-4f78-b629-d834aa00429d") - kind "StaticLib" + kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) options { "ForceCPP", diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 6eca056a87f..e24ff00f438 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -2,8 +2,9 @@ -- copyright-holders:MAMEdev Team project "utils" + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid "22489ad0-4cb2-4d91-ad81-24b0d80ca30a" - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", @@ -94,8 +95,9 @@ project "utils" project "formats" + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid "f69636b1-fcce-45ce-b09a-113e371a2d7a" - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/src/osd/osdmini.lua b/scripts/src/osd/osdmini.lua index a1b19f9cb2a..b4afaaa6532 100644 --- a/scripts/src/osd/osdmini.lua +++ b/scripts/src/osd/osdmini.lua @@ -7,7 +7,7 @@ end project ("osd_" .. _OPTIONS["osd"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) removeflags { "SingleOutputDir", @@ -54,7 +54,7 @@ project ("osd_" .. _OPTIONS["osd"]) project ("ocore_" .. _OPTIONS["osd"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 2c8e2ed51c5..0fc7d57d3b9 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -293,8 +293,9 @@ end project ("osd_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .._OPTIONS["subtarget"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) dofile("sdl_cfg.lua") osdmodulesbuild() @@ -361,8 +362,9 @@ project ("osd_" .. _OPTIONS["osd"]) project ("ocore_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index 33176ff43fc..e9965017933 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -90,7 +90,7 @@ end project ("osd_" .. _OPTIONS["osd"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) dofile("windows_cfg.lua") osdmodulesbuild() @@ -153,7 +153,7 @@ project ("osd_" .. _OPTIONS["osd"]) project ("ocore_" .. _OPTIONS["osd"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/target/ldplayer/ldplayer.lua b/scripts/target/ldplayer/ldplayer.lua index 3660b87cba9..f12fad0c7db 100644 --- a/scripts/target/ldplayer/ldplayer.lua +++ b/scripts/target/ldplayer/ldplayer.lua @@ -54,7 +54,7 @@ BUSES["MIDI"] = true function createProjects_ldplayer_ldplayer(_target, _subtarget) project ("drvldplayer") targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drvldplayer")) options { diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index eff03dac309..8d0346f3942 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -760,7 +760,7 @@ end function createMAMEProjects(_target, _subtarget, _name) project (_name) targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) options { diff --git a/scripts/target/mame/dummy.lua b/scripts/target/mame/dummy.lua index bd207bf41c8..145862828d5 100644 --- a/scripts/target/mame/dummy.lua +++ b/scripts/target/mame/dummy.lua @@ -15,7 +15,7 @@ dofile("mess.lua") function createProjects_mame_dummy(_target, _subtarget) project ("mame_dummy") targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-mame_dummy")) options { diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 84bed8d6c66..8db1d42aa81 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -859,7 +859,7 @@ end function createMESSProjects(_target, _subtarget, _name) project (_name) targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) options { diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua index 350dfd5847c..9dc18d31d9a 100644 --- a/scripts/target/mame/tiny.lua +++ b/scripts/target/mame/tiny.lua @@ -78,7 +78,7 @@ BUSES["CENTRONICS"] = true function createProjects_mame_tiny(_target, _subtarget) project ("mame_tiny") targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-mame-tiny")) options { |