Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify Autoconf macros.
* gettext-runtime/m4/intldir.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove intldir.m4.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Disallow 'no-libtool'
argument. Use libtool always. Remove variables that existed only for backward
compatibility.
* gettext-runtime/m4/intl.m4: Update comments.
* autogen.sh: Ignore gettext.m4 and intl.m4 from gnulib.
* gettext-runtime/intl/Makefile.in: Use libtool always.
(libintl.a, libgnuintl.a): Remove rule.
(.o): Remove suffix rule.
(install-exec, installdirs, uninstall, distclean, dist, distdir): PACKAGE cannot
be anything else than gettext-runtime and gettext-tools any more.
* gettext-tools/configure.ac (intl/Makefile): Update.
* NEWS: Mention that AM_GNU_GETTEXT_INTL_SUBDIR is gone.
  • Loading branch information
bhaible committed Nov 18, 2018
1 parent 9c2f617 commit ed4cb97
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 154 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -13,6 +13,7 @@
no longer available. Instead of including the intl sources in your package,
we suggest making the libintl library an optional prerequisite of your
package. This will simplify the build system of your package.
- Accordingly, the Autoconf macro AM_GNU_GETTEXT_INTL_SUBDIR is gone as well.

* Programming languages support:
- C, C++:
Expand Down
3 changes: 3 additions & 0 deletions autogen.sh
Expand Up @@ -397,6 +397,9 @@ if ! $skip_gnulib; then
'
$GNULIB_TOOL --dir=gettext-tools --source-base=libgettextpo --m4-base=libgettextpo/gnulib-m4 --macro-prefix=gtpo --makefile-name=Makefile.gnulib --libtool --local-dir=gnulib-local --local-symlink \
--import $GNULIB_MODULES_LIBGETTEXTPO $GNULIB_MODULES_LIBGETTEXTPO_OTHER || exit $?
# Overwrite older versions of .m4 files with the up-to-date version.
cp gettext-runtime/m4/gettext.m4 gettext-tools/gnulib-m4/gettext.m4
cp gettext-runtime/m4/intl.m4 gettext-tools/gnulib-m4/intl.m4
# Import build tools. We use --copy-file to avoid directory creation.
$GNULIB_TOOL --copy-file tests/init.sh gettext-tools || exit $?
$GNULIB_TOOL --copy-file build-aux/git-version-gen || exit $?
Expand Down
141 changes: 59 additions & 82 deletions gettext-runtime/intl/Makefile.in
Expand Up @@ -27,8 +27,7 @@ top_builddir = ..
# 'make' program that supports VPATH (such as GNU make). This line is removed
# by autoconf automatically when "$(srcdir)" = ".".
# In this directory, the VPATH handling is particular:
# 1. If INTL_LIBTOOL_SUFFIX_PREFIX is 'l' (indicating a build with libtool),
# the .c -> .lo rules carefully use $(srcdir), so that VPATH can be omitted.
# 1. The .c -> .lo rules carefully use $(srcdir), so that VPATH can be omitted.
# 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise
# 'make' does the wrong thing if GNU gettext was configured with
# "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
Expand Down Expand Up @@ -61,8 +60,6 @@ install_sh = $(SHELL) @install_sh@
MKDIR_P = @MKDIR_P@
mkdir_p = @mkdir_p@

l = @INTL_LIBTOOL_SUFFIX_PREFIX@

AR = @AR@
ARFLAGS = @ARFLAGS@
CC = @CC@
Expand Down Expand Up @@ -112,9 +109,9 @@ LIBS = @LIBS@

COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)

# This line will be replaced with pluralx.$lo, when this file is used
# This line will be replaced with pluralx.lo, when this file is used
# in gettext-tools/intl/. See the pluralx.lo rule below for the rationale.
PLURAL_OBJECT = plural.$lo
PLURAL_OBJECT = plural.lo

HEADERS = \
gmo.h \
Expand Down Expand Up @@ -171,38 +168,38 @@ SOURCES = \
intl-exports.c \
intl-compat.c
OBJECTS = \
bindtextdom.$lo \
dcgettext.$lo \
dgettext.$lo \
gettext.$lo \
finddomain.$lo \
hash-string.$lo \
loadmsgcat.$lo \
localealias.$lo \
textdomain.$lo \
l10nflist.$lo \
explodename.$lo \
dcigettext.$lo \
dcngettext.$lo \
dngettext.$lo \
ngettext.$lo \
bindtextdom.lo \
dcgettext.lo \
dgettext.lo \
gettext.lo \
finddomain.lo \
hash-string.lo \
loadmsgcat.lo \
localealias.lo \
textdomain.lo \
l10nflist.lo \
explodename.lo \
dcigettext.lo \
dcngettext.lo \
dngettext.lo \
ngettext.lo \
$(PLURAL_OBJECT) \
plural-exp.$lo \
localcharset.$lo \
threadlib.$lo \
lock.$lo \
relocatable.$lo \
langprefs.$lo \
localename.$lo \
localename-table.$lo \
log.$lo \
printf.$lo \
setlocale.$lo \
version.$lo \
xsize.$lo \
osdep.$lo \
intl-compat.$lo
OBJECTS_RES_yes = libintl.res.$lo
plural-exp.lo \
localcharset.lo \
threadlib.lo \
lock.lo \
relocatable.lo \
langprefs.lo \
localename.lo \
localename-table.lo \
log.lo \
printf.lo \
setlocale.lo \
version.lo \
xsize.lo \
osdep.lo \
intl-compat.lo
OBJECTS_RES_yes = libintl.res.lo
OBJECTS_RES_no =
DISTFILES.common = Makefile.in \
locale.alias ref-add.sin ref-del.sin export.h libintl.rc \
Expand All @@ -212,16 +209,11 @@ DISTFILES.normal = VERSION
DISTFILES.gettext = ChangeLog COPYING.LIB INSTALL.windows libintl.glibc

all: all-@USE_INCLUDED_LIBINTL@
all-yes: libintl.$la libintl.h ref-add.sed ref-del.sed
all-yes: libintl.la libintl.h ref-add.sed ref-del.sed
all-no: all-no-@BUILD_INCLUDED_LIBINTL@
all-no-yes: libgnuintl.$la
all-no-yes: libgnuintl.la
all-no-no:

libintl.a libgnuintl.a: $(OBJECTS)
$(AM_V_at)rm -f $@
$(AM_V_AR)$(AR) $(ARFLAGS) $@ $(OBJECTS)
$(AM_V_at)$(RANLIB) $@

libintl.la libgnuintl.la: $(OBJECTS) $(OBJECTS_RES_@WOE32@)
$(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
$(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
Expand All @@ -241,10 +233,7 @@ LTV_REVISION=5
LTV_AGE=1

.SUFFIXES:
.SUFFIXES: .c .y .o .lo .sin .sed

.c.o:
$(AM_V_CC)$(COMPILE) $<
.SUFFIXES: .c .y .lo .sin .sed

.y.c:
$(AM_V_YACC)$(YACC) $(YFLAGS) --output $@ $<
Expand Down Expand Up @@ -396,19 +385,18 @@ localename-table.h: $(srcdir)/localename-table.in.h

check: all

# We must not install the libintl.h/libintl.a files if we are on a
# We must not install the libintl.h/libintl.la files if we are on a
# system which has the GNU gettext() function in its C library or in a
# separate library.
# If you want to use the one which comes with this version of the
# package, you have to use "configure --with-included-gettext".
install: install-exec install-data
install-exec: all
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
$(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
$(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
$(LIBTOOL) --mode=install \
$(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
$(INSTALL_DATA) libintl.la $(DESTDIR)$(libdir)/libintl.la; \
if test "@RELOCATABLE@" = yes; then \
dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
if test -n "$$dependencies"; then \
Expand All @@ -423,11 +411,11 @@ install-exec: all
&& test @GLIBC2@ != no; then \
$(mkdir_p) $(DESTDIR)$(libdir); \
$(LIBTOOL) --mode=install \
$(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
$(INSTALL_DATA) libgnuintl.la $(DESTDIR)$(libdir)/libgnuintl.la; \
rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
$(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
$(LIBTOOL) --mode=uninstall \
rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
rm -f $(DESTDIR)$(libdir)/libgnuintl.la; \
else \
: ; \
fi
Expand All @@ -451,8 +439,7 @@ install-strip: install
install-dvi install-html install-info install-ps install-pdf:

installdirs:
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
$(mkdir_p) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
else \
: ; \
Expand All @@ -474,11 +461,10 @@ installdirs:
installcheck:

uninstall:
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
&& test '@USE_INCLUDED_LIBINTL@' = yes; then \
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
rm -f $(DESTDIR)$(includedir)/libintl.h; \
$(LIBTOOL) --mode=uninstall \
rm -f $(DESTDIR)$(libdir)/libintl.$la; \
rm -f $(DESTDIR)$(libdir)/libintl.la; \
else \
: ; \
fi
Expand Down Expand Up @@ -515,17 +501,17 @@ uninstall:
info dvi ps pdf html:

$(OBJECTS): ../config.h libgnuintl.h
bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo setlocale.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
localename.$lo: $(srcdir)/gettextP.h
localename.$lo localename-table.$lo: localename-table.h
hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
dcigettext.$lo loadmsgcat.$lo $(PLURAL_OBJECT) plural-exp.$lo: $(srcdir)/plural-exp.h
dcigettext.$lo: $(srcdir)/eval-plural.h
localcharset.$lo: $(srcdir)/localcharset.h
bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h
localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/xsize.c $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
bindtextdom.lo dcgettext.lo dcigettext.lo dcngettext.lo dgettext.lo dngettext.lo finddomain.lo gettext.lo intl-compat.lo loadmsgcat.lo localealias.lo ngettext.lo setlocale.lo textdomain.lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
localename.lo: $(srcdir)/gettextP.h
localename.lo localename-table.lo: localename-table.h
hash-string.lo dcigettext.lo loadmsgcat.lo: $(srcdir)/hash-string.h
explodename.lo l10nflist.lo: $(srcdir)/loadinfo.h
dcigettext.lo loadmsgcat.lo $(PLURAL_OBJECT) plural-exp.lo: $(srcdir)/plural-exp.h
dcigettext.lo: $(srcdir)/eval-plural.h
localcharset.lo: $(srcdir)/localcharset.h
bindtextdom.lo dcigettext.lo finddomain.lo loadmsgcat.lo localealias.lo lock.lo log.lo: $(srcdir)/lock.h
localealias.lo localcharset.lo relocatable.lo: $(srcdir)/relocatable.h
printf.lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/xsize.c $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c

# A bison-2.1 generated plural.c includes <libintl.h> if ENABLE_NLS.
PLURAL_DEPS_yes = libintl.h
Expand Down Expand Up @@ -558,11 +544,7 @@ clean: mostlyclean

distclean: clean
rm -f Makefile ID TAGS
if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
rm -f $(DISTFILES.normal); \
else \
: ; \
fi
rm -f $(DISTFILES.normal)

maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
Expand All @@ -576,13 +558,8 @@ dist distdir: Makefile
if test "$(PACKAGE)" = "gettext-tools"; then \
: ; \
else \
if test "$(PACKAGE)" = "gettext-runtime"; then \
additional="$(DISTFILES.gettext)"; \
else \
additional="$(DISTFILES.normal)"; \
fi; \
$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
for file in $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $(DISTFILES.gettext); \
for file in $(DISTFILES.common) $(DISTFILES.generated) $(DISTFILES.gettext); do \
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \
done; \
Expand Down
1 change: 0 additions & 1 deletion gettext-runtime/m4/Makefile.am
Expand Up @@ -14,7 +14,6 @@ iconv.m4 \
intdiv0.m4 \
intl.m4 \
intl-thread-locale.m4 \
intldir.m4 \
intlmacosx.m4 \
intmax.m4 \
inttypes-pri.m4 \
Expand Down
63 changes: 15 additions & 48 deletions gettext-runtime/m4/gettext.m4
@@ -1,4 +1,4 @@
# gettext.m4 serial 69 (gettext-0.19.9)
# gettext.m4 serial 70 (gettext-0.19.9)
dnl Copyright (C) 1995-2014, 2016, 2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
Expand All @@ -20,15 +20,13 @@ dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
dnl Macro to add for using GNU gettext.

dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
dnl default (if it is not specified or empty) is 'no-libtool'.
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and
dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
dnl depending on --{enable,disable}-{shared,static} and on the presence of
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
dnl $(top_builddir)/intl/libintl.a will be created.
dnl AM-DISABLE-SHARED).
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
dnl implementations (in libc or libintl) without the ngettext() function
dnl will be ignored. If NEEDSYMBOL is specified and is
Expand Down Expand Up @@ -57,19 +55,17 @@ dnl
AC_DEFUN([AM_GNU_GETTEXT],
[
dnl Argument checking.
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
])])])])])
])])])])
ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
[AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
[errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
])])
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
])])])])
define([gt_included_intl],
ifelse([$1], [external],
ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
[yes]))
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
ifelse([$1], [external], [no], [yes]))
gt_NEEDS_INIT
AM_GNU_GETTEXT_NEED([$2])
Expand Down Expand Up @@ -277,8 +273,8 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
dnl Mark actions used to generate GNU NLS library.
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
Expand Down Expand Up @@ -346,43 +342,14 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
fi
ifelse(gt_included_intl, yes, [
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
dnl to 'yes' because some of the testsuite requires it.
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
BUILD_INCLUDED_LIBINTL=yes
fi
dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
dnl because some of the testsuite requires it.
BUILD_INCLUDED_LIBINTL=yes
dnl Make all variables we use known to autoconf.
AC_SUBST([BUILD_INCLUDED_LIBINTL])
AC_SUBST([USE_INCLUDED_LIBINTL])
AC_SUBST([CATOBJEXT])
dnl For backward compatibility. Some configure.ins may be using this.
nls_cv_header_intl=
nls_cv_header_libgt=
dnl For backward compatibility. Some Makefiles may be using this.
DATADIRNAME=share
AC_SUBST([DATADIRNAME])
dnl For backward compatibility. Some Makefiles may be using this.
INSTOBJEXT=.mo
AC_SUBST([INSTOBJEXT])
dnl For backward compatibility. Some Makefiles may be using this.
GENCAT=gencat
AC_SUBST([GENCAT])
dnl For backward compatibility. Some Makefiles may be using this.
INTLOBJS=
if test "$USE_INCLUDED_LIBINTL" = yes; then
INTLOBJS="\$(GETTOBJS)"
fi
AC_SUBST([INTLOBJS])
dnl Enable libtool support if the surrounding package wishes it.
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
])
dnl For backward compatibility. Some Makefiles may be using this.
Expand Down

0 comments on commit ed4cb97

Please sign in to comment.