diff options
-rw-r--r-- | Makefile.lang.in | 3 | ||||
-rw-r--r-- | config.lib | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/Makefile.lang.in b/Makefile.lang.in index 828fb60c4..3d32c2628 100644 --- a/Makefile.lang.in +++ b/Makefile.lang.in @@ -14,6 +14,7 @@ LANGS_SRC = $(shell ls $(LANG_DIR)/*.txt) LANGS = $(LANGS_SRC:$(LANG_DIR)/%.txt=%.lng) CXX_BUILD = !!CXX_BUILD!! CFLAGS_BUILD = !!CFLAGS_BUILD!! +LDFLAGS_BUILD= !!LDFLAGS_BUILD!! STRGEN_FLAGS = !!STRGEN_FLAGS!! STAGE = !!STAGE!! LANG_SUPPRESS= !!LANG_SUPPRESS!! @@ -59,7 +60,7 @@ lang/english.txt: $(LANG_DIR)/english.txt $(STRGEN): alloc_func.o string.o strgen.o $(E) '$(STAGE) Compiling and Linking $@' - $(Q)$(CXX_BUILD) $^ -o $@ + $(Q)$(CXX_BUILD) $(LDFLAGS_BUILD) $^ -o $@ table/strings.h: lang/english.txt $(STRGEN) $(E) '$(STAGE) Generating $@' diff --git a/config.lib b/config.lib index ee2579f3d..3ae524dfb 100644 --- a/config.lib +++ b/config.lib @@ -1102,6 +1102,8 @@ make_compiler_cflags() { make_cflags_and_ldflags() { # General CFlags for BUILD CFLAGS_BUILD="" + #LDFLAGS for BUILD + LDFLAGS_BUILD="" # General CFlags for HOST CFLAGS="$CFLAGS -D$os" # Libs to compile. In fact this is just LDFLAGS @@ -1162,12 +1164,12 @@ make_cflags_and_ldflags() { fi if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then flags="$flags -mno-cygwin" - LDFLAGS="$LDFLAGS -mno-cygwin" - fi - - if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then - LDFLAGS="$LDFLAGS -Wl,--subsystem,windows" + LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,windows" LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32" + + if [ $cc_version -ge 44 ]; then + LDFLAGS_BUILD="$LDFLAGS_BUILD -static-libgcc" + fi fi fi @@ -2648,6 +2650,7 @@ make_sed() { s@!!STRGEN_FLAGS!!@$strgen_flags@g; s@!!LIBS!!@$LIBS@g; s@!!LDFLAGS!!@$T_LDFLAGS@g; + s@!!LDFLAGS_BUILD!!@$LDFLAGS_BUILD@g; s@!!BIN_DIR!!@$BIN_DIR@g; s@!!ROOT_DIR!!@$ROOT_DIR@g; s@!!MEDIA_DIR!!@$MEDIA_DIR@g; |