diff --git a/linux/Makefile b/linux/Makefile index fe83b989..626f2356 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -256,7 +256,7 @@ $(DOWNLOADS)/freetype/autogen.sh: # OpenAL 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; \ make -j$(NPROC); make install diff --git a/linux/vars.sh b/linux/vars.sh index 732757c9..09dee4d3 100755 --- a/linux/vars.sh +++ b/linux/vars.sh @@ -1,11 +1,11 @@ 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" MKXPZ_OLD_PC=$(pkg-config --variable pc_path pkg-config) # 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 LD_LIBRARY_PATH="$DIR/build-${MKXPZ_PREFIX}/lib:${LD_LIBRARY_PATH}" export MKXPZ_PREFIX="$DIR/build-${MKXPZ_PREFIX}" \ No newline at end of file diff --git a/meson.build b/meson.build index 9b4308f2..3579d01d 100644 --- a/meson.build +++ b/meson.build @@ -116,7 +116,7 @@ if get_option('force32') == true endif 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 endif diff --git a/src/meson.build b/src/meson.build index 086ceab9..9b5a5e0b 100755 --- a/src/meson.build +++ b/src/meson.build @@ -13,7 +13,12 @@ pixman = dependency('pixman-1', static: build_static) png = dependency('libpng', static: build_static) jpeg = dependency('libjpeg', static: build_static) zlib = dependency('zlib', static: build_static) -bz2 = dependency('bzip2', static: build_static) + +if host_system == 'windows' + bz2 = dependency('bzip2', static: build_static) +else + bz2 = compilers['cpp'].find_library('bz2') +endif # If OpenSSL is present, you get HTTPS support if get_option('enable-https') == true @@ -37,6 +42,11 @@ if host_system == 'windows' endif if build_static == true 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' endif @@ -77,7 +87,9 @@ if get_option('shared_fluid') == true fluidsynth = dependency('fluidsynth', static: build_static) add_project_arguments('-DSHARED_FLUID', language: 'cpp') global_dependencies += fluidsynth - global_dependencies += compilers['cpp'].find_library('dsound') + if host_system == 'windows' + global_dependencies += compilers['cpp'].find_library('dsound') + endif endif if get_option('default_framerate') == true