mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 14:05:32 +02:00
link linux binary (mostly) statically
This commit is contained in:
parent
18a9744bad
commit
ad03754378
4 changed files with 18 additions and 6 deletions
|
@ -256,7 +256,7 @@ $(DOWNLOADS)/freetype/autogen.sh:
|
||||||
# OpenAL
|
# OpenAL
|
||||||
openal: init_dirs libogg $(LIBDIR)/libopenal.a
|
openal: init_dirs libogg $(LIBDIR)/libopenal.a
|
||||||
|
|
||||||
$(LIBDIR)/libOpenAL32.a: $(DOWNLOADS)/openal/cmakebuild/Makefile
|
$(LIBDIR)/libopenal.a: $(DOWNLOADS)/openal/cmakebuild/Makefile
|
||||||
cd $(DOWNLOADS)/openal/cmakebuild; \
|
cd $(DOWNLOADS)/openal/cmakebuild; \
|
||||||
make -j$(NPROC); make install
|
make -j$(NPROC); make install
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
|
||||||
MKXPZ_PREFIX=$(shell gcc -dumpmachine | sed -r "s/(.+)-.+-.+/\1/")
|
MKXPZ_PREFIX=$(gcc -dumpmachine | sed -r "s/(.+)-.+-.+/\1/")
|
||||||
export LDFLAGS="-L$DIR/build-${MKXPZ_PREFIX}/lib -L$DIR/build-${MKXPZ_PREFIX}/bin"
|
export LDFLAGS="-L$DIR/build-${MKXPZ_PREFIX}/lib -L$DIR/build-${MKXPZ_PREFIX}/bin"
|
||||||
MKXPZ_OLD_PC=$(pkg-config --variable pc_path pkg-config)
|
MKXPZ_OLD_PC=$(pkg-config --variable pc_path pkg-config)
|
||||||
|
|
||||||
# Try to load the stuff we built first
|
# Try to load the stuff we built first
|
||||||
export PKG_CONFIG_LIBDIR="$DIR/build-${MKXPZ_PREFIX}/lib/pkgconfig:${MKXPZ_OLD_PC}"
|
export PKG_CONFIG_LIBDIR="$DIR/build-${MKXPZ_PREFIX}/lib/pkgconfig:$DIR/build-${MKXPZ_PREFIX}/lib64/pkgconfig:${MKXPZ_OLD_PC}"
|
||||||
export PATH="$DIR/build-${MKXPZ_PREFIX}/bin:$PATH"
|
export PATH="$DIR/build-${MKXPZ_PREFIX}/bin:$PATH"
|
||||||
export LD_LIBRARY_PATH="$DIR/build-${MKXPZ_PREFIX}/lib:${LD_LIBRARY_PATH}"
|
export LD_LIBRARY_PATH="$DIR/build-${MKXPZ_PREFIX}/lib:${LD_LIBRARY_PATH}"
|
||||||
export MKXPZ_PREFIX="$DIR/build-${MKXPZ_PREFIX}"
|
export MKXPZ_PREFIX="$DIR/build-${MKXPZ_PREFIX}"
|
|
@ -116,7 +116,7 @@ if get_option('force32') == true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
build_static = false
|
build_static = false
|
||||||
if get_option('static_executable') == true and host_system == 'windows'
|
if get_option('static_executable') == true # and host_system == 'windows'
|
||||||
build_static = true
|
build_static = true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,12 @@ pixman = dependency('pixman-1', static: build_static)
|
||||||
png = dependency('libpng', static: build_static)
|
png = dependency('libpng', static: build_static)
|
||||||
jpeg = dependency('libjpeg', static: build_static)
|
jpeg = dependency('libjpeg', static: build_static)
|
||||||
zlib = dependency('zlib', static: build_static)
|
zlib = dependency('zlib', static: build_static)
|
||||||
|
|
||||||
|
if host_system == 'windows'
|
||||||
bz2 = dependency('bzip2', static: build_static)
|
bz2 = dependency('bzip2', static: build_static)
|
||||||
|
else
|
||||||
|
bz2 = compilers['cpp'].find_library('bz2')
|
||||||
|
endif
|
||||||
|
|
||||||
# If OpenSSL is present, you get HTTPS support
|
# If OpenSSL is present, you get HTTPS support
|
||||||
if get_option('enable-https') == true
|
if get_option('enable-https') == true
|
||||||
|
@ -37,6 +42,11 @@ if host_system == 'windows'
|
||||||
endif
|
endif
|
||||||
if build_static == true
|
if build_static == true
|
||||||
global_link_args += ['-Wl,-Bstatic', '-lgcc', '-lstdc++', '-lpthread', '-Wl,-Bdynamic']
|
global_link_args += ['-Wl,-Bstatic', '-lgcc', '-lstdc++', '-lpthread', '-Wl,-Bdynamic']
|
||||||
|
if host_system == 'windows'
|
||||||
|
global_link_args += ['-Wl,-Bstatic', '-lgcc', '-lstdc++', '-lpthread', '-Wl,-Bdynamic']
|
||||||
|
else
|
||||||
|
global_link_args += ['-static-libgcc', '-static-libstdc++']
|
||||||
|
endif
|
||||||
global_args += '-DAL_LIBTYPE_STATIC'
|
global_args += '-DAL_LIBTYPE_STATIC'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -77,8 +87,10 @@ if get_option('shared_fluid') == true
|
||||||
fluidsynth = dependency('fluidsynth', static: build_static)
|
fluidsynth = dependency('fluidsynth', static: build_static)
|
||||||
add_project_arguments('-DSHARED_FLUID', language: 'cpp')
|
add_project_arguments('-DSHARED_FLUID', language: 'cpp')
|
||||||
global_dependencies += fluidsynth
|
global_dependencies += fluidsynth
|
||||||
|
if host_system == 'windows'
|
||||||
global_dependencies += compilers['cpp'].find_library('dsound')
|
global_dependencies += compilers['cpp'].find_library('dsound')
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('default_framerate') == true
|
if get_option('default_framerate') == true
|
||||||
add_project_arguments('-DMKXPZ_STATIC_FRAMERATE', language: 'cpp')
|
add_project_arguments('-DMKXPZ_STATIC_FRAMERATE', language: 'cpp')
|
||||||
|
|
Loading…
Add table
Reference in a new issue