From: Bruno Haible Date: Mon, 7 Apr 2003 10:44:31 +0000 (+0000) Subject: Better way to define the dependencies of a program or library. X-Git-Tag: v0.12~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c9235740a4ef76ce7ff252b40c62e1ea920c0a9;p=thirdparty%2Fgettext.git Better way to define the dependencies of a program or library. --- diff --git a/ChangeLog b/ChangeLog index 06289199f..49094648b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-04-05 Bruno Haible + + * config/install-reloc: Don't define NO_LIBRARIES. + 2003-04-01 Bruno Haible * README.mingw: New file. diff --git a/config/install-reloc b/config/install-reloc index e4895fa04..030bee677 100755 --- a/config/install-reloc +++ b/config/install-reloc @@ -110,7 +110,7 @@ test -n "$libdirs" || exit 0 # Compile wrapper. installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'` -func_verbose $compile_command -I"$builddir" -I"$srcdir" -I"$config_h_dir" -DHAVE_CONFIG_H -DNO_LIBRARIES -DNO_XMALLOC -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" "$srcdir"/relocwrapper.c "$srcdir"/progname.c "$srcdir"/xreadlink.c "$srcdir"/canonicalize.c "$srcdir"/relocatable.c "$srcdir"/setenv.c "$srcdir"/strerror.c -o $destprog.wrapper || exit $? +func_verbose $compile_command -I"$builddir" -I"$srcdir" -I"$config_h_dir" -DHAVE_CONFIG_H -DNO_XMALLOC -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" "$srcdir"/relocwrapper.c "$srcdir"/progname.c "$srcdir"/xreadlink.c "$srcdir"/canonicalize.c "$srcdir"/relocatable.c "$srcdir"/setenv.c "$srcdir"/strerror.c -o $destprog.wrapper || exit $? # Rename $destprog.wrapper -> $destprog -> $destprog.bin. ln -f $destprog $destprog.bin || exit 1 diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index a34bcd63f..ea811b85f 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,10 @@ +2003-04-05 Bruno Haible + + * relocatable.c: Rely on DEPENDS_ON_LIBCHARSET, DEPENDS_ON_LIBICONV, + DEPENDS_ON_LIBINTL, not on NO_LIBRARIES. + * Makefile.in (DEFS): Define DEPENDS_ON_LIBICONV, for relocatable.c. + * Makefile.msvc (CFLAGS): Also define DEPENDS_ON_LIBICONV. + 2003-04-05 Bruno Haible * relocatable.c (_GNU_SOURCE): Define, to ensure getline() gets diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index 59711191d..90321e86a 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -54,7 +54,8 @@ DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ -Dset_relocation_prefix=libintl_set_relocation_prefix \ --Drelocate=libintl_relocate @DEFS@ +-Drelocate=libintl_relocate \ +-DDEPENDS_ON_LIBICONV=1 @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ diff --git a/gettext-runtime/intl/Makefile.msvc b/gettext-runtime/intl/Makefile.msvc index 779c1f91e..ba6bd0a36 100644 --- a/gettext-runtime/intl/Makefile.msvc +++ b/gettext-runtime/intl/Makefile.msvc @@ -78,7 +78,7 @@ OPTIMFLAGS = -D_NDEBUG -O1 # -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. # -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. -CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DBUILDING_LIBINTL -DBUILDING_DLL -DLOCALEDIR=\"$(IIlocaledir)\" -DLOCALE_ALIAS_PATH=\"$(IIaliaspath)\" -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(IIbindir)\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate +CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DBUILDING_LIBINTL -DBUILDING_DLL -DLOCALEDIR=\"$(IIlocaledir)\" -DLOCALE_ALIAS_PATH=\"$(IIaliaspath)\" -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(IIbindir)\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 INCLUDES = -I. -I.. -I$(includedir) diff --git a/gettext-runtime/intl/relocatable.c b/gettext-runtime/intl/relocatable.c index fb8e16ed3..16f79a528 100644 --- a/gettext-runtime/intl/relocatable.c +++ b/gettext-runtime/intl/relocatable.c @@ -45,13 +45,14 @@ # include "xmalloc.h" #endif -#ifndef NO_LIBRARIES -# if !defined IN_LIBICONV && HAVE_ICONV -# include -# endif -# if !defined IN_LIBINTL && !defined IN_LIBICONV && ENABLE_NLS -# include -# endif +#if DEPENDS_ON_LIBCHARSET +# include +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV +# include +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS +# include #endif /* Faked cheap 'bool'. */ @@ -139,14 +140,15 @@ set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); -#ifndef NO_LIBRARIES /* Now notify all dependent libraries. */ -# if !defined IN_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 +#if DEPENDS_ON_LIBCHARSET + libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); -# endif -# if !defined IN_LIBINTL && !defined IN_LIBICONV && ENABLE_NLS && defined libintl_set_relocation_prefix +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); -# endif #endif } diff --git a/gettext-runtime/lib/ChangeLog b/gettext-runtime/lib/ChangeLog index 97b063357..6d8054551 100644 --- a/gettext-runtime/lib/ChangeLog +++ b/gettext-runtime/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-04-05 Bruno Haible + + * Makefile.am (DEFS): Define DEPENDS_ON_LIBINTL, for relocatable.c. + * Makefile.msvc (CFLAGS): Also define DEPENDS_ON_LIBINTL. + 2003-03-30 Bruno Haible * Makefile.vms: New file. diff --git a/gettext-runtime/lib/Makefile.am b/gettext-runtime/lib/Makefile.am index a59b8312c..be13dc748 100644 --- a/gettext-runtime/lib/Makefile.am +++ b/gettext-runtime/lib/Makefile.am @@ -55,6 +55,8 @@ INCLUDES = \ -I../intl -I$(srcdir)/../intl \ -I../../gettext-tools/lib -I$(srcdir)/../../gettext-tools/lib +DEFS = -DDEPENDS_ON_LIBINTL=1 @DEFS@ + # List of files to be distributed. EXTRA_DIST += $(LIBADD_SOURCE) diff --git a/gettext-runtime/lib/Makefile.msvc b/gettext-runtime/lib/Makefile.msvc index e7a68d617..e3afab68e 100644 --- a/gettext-runtime/lib/Makefile.msvc +++ b/gettext-runtime/lib/Makefile.msvc @@ -38,7 +38,7 @@ OPTIMFLAGS = -Od -Z7 OPTIMFLAGS = -D_NDEBUG -O1 !endif -CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H +CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DDEPENDS_ON_LIBINTL=1 INCLUDES = -I. -I.. -I..\intl -I..\..\gettext-tools\lib -I..\..\gettext-tools\windows -I$(includedir) diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index e7f62b574..fba2b1ed7 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,12 @@ +2003-04-05 Bruno Haible + + * relocatable.c: Rely on DEPENDS_ON_LIBCHARSET, DEPENDS_ON_LIBICONV, + DEPENDS_ON_LIBINTL, not on NO_LIBRARIES. + * Makefile.am (DEFS): Define DEPENDS_ON_LIBINTL and DEPENDS_ON_LIBCONV, + for relocatable.c. + * Makefile.msvc (CFLAGS): Also define DEPENDS_ON_LIBINTL and + DEPENDS_ON_LIBCONV. + 2003-04-05 Bruno Haible * relocatable.c (_GNU_SOURCE): Define, to ensure getline() gets diff --git a/gettext-tools/lib/Makefile.am b/gettext-tools/lib/Makefile.am index 134f02818..9732d1145 100644 --- a/gettext-tools/lib/Makefile.am +++ b/gettext-tools/lib/Makefile.am @@ -125,9 +125,10 @@ EXTRA_DIST += \ gen-lbrkprop.c 3level.h Combining.txt \ ChangeLog.0 -DEFS = -DEXEEXT=\"$(EXEEXT)\" @DEFS@ INCLUDES = -I. -I$(srcdir) -I.. -I../intl -I$(top_srcdir)/intl +DEFS = -DEXEEXT=\"$(EXEEXT)\" -DDEPENDS_ON_LIBINTL=1 -DDEPENDS_ON_LIBCONV=1 @DEFS@ + DISTCLEANFILES += fnmatch.h diff --git a/gettext-tools/lib/Makefile.msvc b/gettext-tools/lib/Makefile.msvc index 8fe5eb204..4e25206cb 100644 --- a/gettext-tools/lib/Makefile.msvc +++ b/gettext-tools/lib/Makefile.msvc @@ -58,7 +58,7 @@ OPTIMFLAGS = -Od -Z7 OPTIMFLAGS = -D_NDEBUG -O1 !endif -CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DEXEEXT=\".exe\" +CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -DDEPENDS_ON_LIBINTL=1 -DDEPENDS_ON_LIBCONV=1 INCLUDES = -I. -I.. -I..\intl -I..\windows -I$(includedir) diff --git a/gettext-tools/lib/relocatable.c b/gettext-tools/lib/relocatable.c index fb8e16ed3..16f79a528 100644 --- a/gettext-tools/lib/relocatable.c +++ b/gettext-tools/lib/relocatable.c @@ -45,13 +45,14 @@ # include "xmalloc.h" #endif -#ifndef NO_LIBRARIES -# if !defined IN_LIBICONV && HAVE_ICONV -# include -# endif -# if !defined IN_LIBINTL && !defined IN_LIBICONV && ENABLE_NLS -# include -# endif +#if DEPENDS_ON_LIBCHARSET +# include +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV +# include +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS +# include #endif /* Faked cheap 'bool'. */ @@ -139,14 +140,15 @@ set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); -#ifndef NO_LIBRARIES /* Now notify all dependent libraries. */ -# if !defined IN_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 +#if DEPENDS_ON_LIBCHARSET + libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); -# endif -# if !defined IN_LIBINTL && !defined IN_LIBICONV && ENABLE_NLS && defined libintl_set_relocation_prefix +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); -# endif #endif }