From 32a7aa223483c115e5ddaa2eee4d26f783c0f490 Mon Sep 17 00:00:00 2001 From: Olivier Teuliere Date: Sat, 11 Apr 2020 12:34:06 +0200 Subject: [PATCH] Fix libintl and add support for gettext in the win32 contribs --- dic/Makefile.am | 6 +++--- extras/contrib/Makefile | 23 ++++++++++++++++++++++- qt/Makefile.am | 2 +- utils/Makefile.am | 4 ++-- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/dic/Makefile.am b/dic/Makefile.am index 432936d..f34a617 100644 --- a/dic/Makefile.am +++ b/dic/Makefile.am @@ -51,14 +51,14 @@ bin_PROGRAMS = \ compdic_SOURCES=compdicmain.cpp compdic_CPPFLAGS=$(AM_CPPFLAGS) @BOOST_CPPFLAGS@ -compdic_LDADD=libdic.a @LIBICONV@ +compdic_LDADD=libdic.a @LIBINTL@ @LIBICONV@ listdic_SOURCES=listdicmain.cpp -listdic_LDADD=libdic.a @LIBICONV@ +listdic_LDADD=libdic.a @LIBINTL@ @LIBICONV@ #regexp_CFLAGS=-DDEBUG_RE regexp_SOURCES=regexpmain.cpp -regexp_LDADD=libdic.a @LIBICONV@ +regexp_LDADD=libdic.a @LIBINTL@ @LIBICONV@ if WITH_LOGGING compdic_LDADD += @LOG4CXX_LIBS@ diff --git a/extras/contrib/Makefile b/extras/contrib/Makefile index 208c459..8065754 100644 --- a/extras/contrib/Makefile +++ b/extras/contrib/Makefile @@ -3,6 +3,7 @@ APU_VERSION := 1.6.1 ARABICA_VERSION := 2016-January BOOST_VERSION := 1.72.0 EXPAT_VERSION := 2.2.9 +GETTEXT_VERSION := 0.20.1 ICONV_VERSION := 1.16 LIBCONFIG_VERSION := 1.7.2 LIBXML2_VERSION := 2.9.8 @@ -31,7 +32,7 @@ CONFIGURE = CC="$(CC)" CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS)" ./configure --host=$( # Dependencies (incomplete list): # expat <- apr <- apu <- log4cxx -LIBS := iconv boost expat apr apu libconfig log4cxx arabica qt2 +LIBS := iconv gettext boost expat apr apu libconfig log4cxx arabica qt2 TARGETS = $(LIBS:%=.%) .PHONY: help all clean clean-% distclean distclean-% @@ -169,6 +170,26 @@ $(EXPAT_DIR_FLAG): $(EXPAT_ARCHIVE) touch $@ +### gettext ### + +GETTEXT_DIR = $(BUILD_DIR)/gettext-$(GETTEXT_VERSION) +GETTEXT_DIR_FLAG = $(GETTEXT_DIR)/.flag +GETTEXT_ARCHIVE = $(ARCHIVE_DIR)/gettext-$(GETTEXT_VERSION).tar.gz + +$(GETTEXT_ARCHIVE): $(PREFIX_FLAG) + $(WGET) https://ftp.gnu.org/pub/gnu/gettext/$(shell basename $@) + +$(GETTEXT_DIR_FLAG): $(GETTEXT_ARCHIVE) + $(TAR) -xzf $< + touch $@ + +.gettext: $(GETTEXT_DIR_FLAG) + (cd $(GETTEXT_DIR) \ + && $(CONFIGURE) --disable-java --disable-native-java --disable-relocatable --without-emacs --without-included-libxml \ + && make install) + touch $@ + + ### iconv ### ICONV_DIR = $(BUILD_DIR)/libiconv-$(ICONV_VERSION) diff --git a/qt/Makefile.am b/qt/Makefile.am index 669903e..68ce4b2 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -148,7 +148,7 @@ BUILT_SOURCES = $(nodist_eliot_SOURCES) MOSTLYCLEANFILES = $(nodist_eliot_SOURCES) -eliot_LDADD = ../game/libgame.a ../dic/libdic.a @QT_LIBS@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ +eliot_LDADD = ../game/libgame.a ../dic/libdic.a @QT_LIBS@ @LIBINTL@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ # Needed for proper stack trace handling eliot_LDFLAGS = -rdynamic diff --git a/utils/Makefile.am b/utils/Makefile.am index 0c3ca71..aa0039e 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -25,7 +25,7 @@ bin_PROGRAMS = if BUILD_TEXT noinst_PROGRAMS += eliottxt eliottxt_SOURCES = game_io.h game_io.cpp eliottxt.cpp -eliottxt_LDADD = $(top_builddir)/game/libgame.a $(top_builddir)/dic/libdic.a @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ +eliottxt_LDADD = $(top_builddir)/game/libgame.a $(top_builddir)/dic/libdic.a @LIBINTL@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ if HAS_READLINE eliottxt_LDADD += -lreadline @@ -38,7 +38,7 @@ endif if BUILD_NCURSES bin_PROGRAMS += eliotcurses eliotcurses_SOURCES = curses_intf.cpp curses_intf.h -eliotcurses_LDADD = ../game/libgame.a ../dic/libdic.a @CURSES_LIB@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ +eliotcurses_LDADD = ../game/libgame.a ../dic/libdic.a @CURSES_LIB@ @LIBINTL@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ if WITH_LOGGING eliotcurses_LDADD += @LOG4CXX_LIBS@ endif