]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix link error when building statically on MacOS X.
authorBruno Haible <bruno@clisp.org>
Sat, 29 Jan 2005 15:21:42 +0000 (15:21 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:08 +0000 (12:12 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/Makefile.in
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/gettext.m4
gettext-tools/libuniname/ChangeLog
gettext-tools/libuniname/Makefile.am
gettext-tools/src/ChangeLog
gettext-tools/src/Makefile.am
gettext-tools/tests/ChangeLog
gettext-tools/tests/Makefile.am

index 64c19b41ef208c320347309d21dfa11b0ffb77fa..8b00bd401b139ad5672360ccb622a53d722652dd 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-29  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (libintl.la, libgnuintl.la): Use INTL_MACOSX_LIBS
+       instead of INTL_MACOSX_LDFLAGS.
+
 2004-09-08  Bruno Haible  <bruno@clisp.org>
 
        * vasnprintf.c (VASNPRINTF): Signal EOVERFLOW if the resulting length
index 71596178268369321b6d07500c8991404d491333..0fb5ad5f9913310a16dadc3ee34be3bf8d5828f0 100644 (file)
@@ -1,5 +1,5 @@
 # Makefile for directory with message catalog handling library of GNU gettext
-# Copyright (C) 1995-1998, 2000-2004 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998, 2000-2005 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Library General Public License as published
@@ -154,7 +154,7 @@ libintl.a libgnuintl.a: $(OBJECTS)
 libintl.la libgnuintl.la: $(OBJECTS)
        $(LIBTOOL) --mode=link \
          $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
-         $(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LDFLAGS@ $(LIBS) -lc \
+         $(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(LIBS) -lc \
          -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
          -rpath $(libdir) \
          -no-undefined
index 78d20a6152f5ec3977e520f5a86f7ffaff61f62c..85eb829081a87e14d2781a6392f815b9cc0bc87f 100644 (file)
@@ -1,3 +1,11 @@
+2005-01-29  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.m4 (gt_INTL_MACOSX): New macro, extracted from
+       AM_INTL_SUBDIR. Set INTL_MACOSX_LIBS instead of INTL_MACOSX_LDFLAGS.
+       (AM_GNU_GETTEXT): Invoke it. Add the INTL_MACOSX_LIBS contents to
+       LIBINTL and LTLIBINTL.
+       (AM_INTL_SUBDIR): Require gt_INTL_MACOSX.
+
 2005-01-19  Bruno Haible  <bruno@clisp.org>
 
        * ansi-c++.m4, codeset.m4, gettext.m4, glibc21.m4, glibc2.m4, iconv.m4:
index ae6752cb9971a02f3cdb8323aadcb321dff86654..368907a299373aee1727950fd7f8cebf6d67a5a4 100644 (file)
@@ -1,4 +1,4 @@
-# gettext.m4 serial 33 (gettext-0.14.2)
+# gettext.m4 serial 34 (gettext-0.14.2)
 dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -90,6 +90,9 @@ AC_DEFUN([AM_GNU_GETTEXT],
     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
   ])
 
+  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+  gt_INTL_MACOSX
+
   dnl Set USE_NLS.
   AM_NLS
 
@@ -243,6 +246,15 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
       fi
     ])
 
+    if test -n "$INTL_MACOSX_LIBS"; then
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Some extra flags are needed during linking.
+        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+      fi
+    fi
+
     if test "$gt_use_preinstalled_gnugettext" = "yes" \
        || test "$nls_cv_use_gnu_gettext" = "yes"; then
       AC_DEFINE(ENABLE_NLS, 1,
@@ -373,6 +385,7 @@ AC_DEFUN([AM_INTL_SUBDIR],
   AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
   AC_REQUIRE([gt_INTTYPES_PRI])dnl
   AC_REQUIRE([gl_XSIZE])dnl
+  AC_REQUIRE([gt_INTL_MACOSX])dnl
 
   AC_CHECK_TYPE([ptrdiff_t], ,
     [AC_DEFINE([ptrdiff_t], [long],
@@ -429,6 +442,47 @@ __fsetlocking])
     gt_LC_MESSAGES
   fi
 
+  if test -n "$INTL_MACOSX_LIBS"; then
+    CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
+  fi
+
+  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
+  dnl because plural.y uses bison specific features. It requires at least
+  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
+  dnl compile.
+  dnl bison is only needed for the maintainer (who touches plural.y). But in
+  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
+  dnl the rule in general Makefile. Now, some people carelessly touch the
+  dnl files or have a broken "make" program, hence the plural.c rule will
+  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
+  dnl present or too old.
+  AC_CHECK_PROGS([INTLBISON], [bison])
+  if test -z "$INTLBISON"; then
+    ac_verc_fail=yes
+  else
+    dnl Found it, now check the version.
+    AC_MSG_CHECKING([version of bison])
+changequote(<<,>>)dnl
+    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+    case $ac_prog_version in
+      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+changequote([,])dnl
+         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+    esac
+    AC_MSG_RESULT([$ac_prog_version])
+  fi
+  if test $ac_verc_fail = yes; then
+    INTLBISON=:
+  fi
+])
+
+
+dnl Checks for special options needed on MacOS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
   dnl Check for API introduced in MacOS X 10.2.
   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
     gt_cv_func_CFPreferencesCopyAppValue,
@@ -461,43 +515,11 @@ __fsetlocking])
     AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
       [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
   fi
-  INTL_MACOSX_LDFLAGS=
+  INTL_MACOSX_LIBS=
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
-    CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
-    INTL_MACOSX_LDFLAGS="-Wl,-framework -Wl,CoreFoundation"
-  fi
-  AC_SUBST([INTL_MACOSX_LDFLAGS])
-
-  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
-  dnl because plural.y uses bison specific features. It requires at least
-  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
-  dnl compile.
-  dnl bison is only needed for the maintainer (who touches plural.y). But in
-  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
-  dnl the rule in general Makefile. Now, some people carelessly touch the
-  dnl files or have a broken "make" program, hence the plural.c rule will
-  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
-  dnl present or too old.
-  AC_CHECK_PROGS([INTLBISON], [bison])
-  if test -z "$INTLBISON"; then
-    ac_verc_fail=yes
-  else
-    dnl Found it, now check the version.
-    AC_MSG_CHECKING([version of bison])
-changequote(<<,>>)dnl
-    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-    case $ac_prog_version in
-      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
-changequote([,])dnl
-         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-    esac
-    AC_MSG_RESULT([$ac_prog_version])
-  fi
-  if test $ac_verc_fail = yes; then
-    INTLBISON=:
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
   fi
+  AC_SUBST([INTL_MACOSX_LIBS])
 ])
 
 
index 9674a3db745318a8247d24a9d873e163a6b5f0b8..79acf5bd39b5a26dcf78e7cfb9fc8b5dfa5f395e 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-29  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (test_names_LDADD): Add INTL_MACOSX_LIBS.
+
 2004-01-29  Bruno Haible  <bruno@clisp.org>
 
        * gettext-0.14.1 released.
index d6a59b1da489e3e8b1aad88cef7e754096b929a9..efeaa7e983e2541aa1a966d418609900ebdc32db 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for libuniname directory in GNU gettext package.
-## Copyright (C) 2002-2003 Free Software Foundation, Inc.
+## Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -34,7 +34,9 @@ TESTS = test-names.sh
 TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) $(SHELL)
 
 noinst_PROGRAMS = test-names
-test_names_LDADD = libuniname.a ../lib/libgettextlib.la
+# INTL_MACOSX_LIBS is needed because libgettextlib.la depends on libintl.la
+# but libtool doesn't put -Wl,-framework options into .la files.
+test_names_LDADD = libuniname.a ../lib/libgettextlib.la @INTL_MACOSX_LIBS@
 
 EXTRA_DIST += $(TESTS) UnicodeDataNames.txt
 
index e28b2587e4f6d4587cf62d1646a4daa4a44d0b87..8ba07bb4dfe1530d80ecb4552c8eea485e941a50 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-29  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (msgcmp_LDADD, msgfmt_LDADD, msgmerge_LDADD,
+       msgunfmt_LDADD, xgettext_LDADD, msgattrib_LDADD, msgcat_LDADD,
+       msgcomm_LDADD, msgconv_LDADD, msgen_LDADD, msgexec_LDADD,
+       msgfilter_LDADD, msggrep_LDADD, msguniq_LDADD): Add INTL_MACOSX_LIBS.
+
 2005-01-27  Bruno Haible  <bruno@clisp.org>
 
        * msgfmt.c (formatstring_error_logger): Cast the fprrintf argument,
index 2e54ded8e5c5cdd5e8024affa071ad0116fdb063..01bebb819241fe228e377620cdbfe1aa2ac24e1a 100644 (file)
@@ -182,22 +182,25 @@ libgettextpo_la_LDFLAGS = \
 libgettextpo_la_DEPENDENCIES = libgettextsrc.la
 
 # Link dependencies.
-msgcmp_LDADD = libgettextsrc.la
-msgfmt_LDADD = libgettextsrc.la
-msgmerge_LDADD = libgettextsrc.la
-msgunfmt_LDADD = libgettextsrc.la
-xgettext_LDADD = $(LIBUNINAME) libgettextsrc.la @LTLIBEXPAT@
-msgattrib_LDADD = libgettextsrc.la
-msgcat_LDADD = libgettextsrc.la
-msgcomm_LDADD = libgettextsrc.la
-msgconv_LDADD = libgettextsrc.la
-msgen_LDADD = libgettextsrc.la
-msgexec_LDADD = libgettextsrc.la
-msgfilter_LDADD = libgettextsrc.la
-msggrep_LDADD = $(LIBGREP) libgettextsrc.la
+# INTL_MACOSX_LIBS is needed because the programs depend on libintl.la
+# but libtool doesn't put -Wl,-framework options into .la files.
+# For msginit, it is also needed because of localename.c.
+msgcmp_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgfmt_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgmerge_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgunfmt_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+xgettext_LDADD = $(LIBUNINAME) libgettextsrc.la @INTL_MACOSX_LIBS@ @LTLIBEXPAT@
+msgattrib_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgcat_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgcomm_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgconv_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgen_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgexec_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msgfilter_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
+msggrep_LDADD = $(LIBGREP) libgettextsrc.la @INTL_MACOSX_LIBS@
 msginit_LDADD = ../intl/localename.@INTL_LIBTOOL_SUFFIX_PREFIX@o \
-                @INTL_MACOSX_LDFLAGS@ libgettextsrc.la
-msguniq_LDADD = libgettextsrc.la
+                libgettextsrc.la @INTL_MACOSX_LIBS@
+msguniq_LDADD = libgettextsrc.la @INTL_MACOSX_LIBS@
 
 # Specify installation directory, for --enable-relocatable.
 msgcmp_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
index e405398e5516258992e8b394d104d9615019fb50..9747ab2d3306e020c6f463b75b9993f227c8751c 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-29  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (LDADD_yes): Add INTL_MACOSX_LIBS.
+
 2005-01-20  Bruno Haible  <bruno@clisp.org>
 
        * lang-guile: Make it work.
index a57272cf524da1751dd349f7142a9579f755b5c4..44454c42c4fa30f5cb75f39924ed5e95db540568 100644 (file)
@@ -165,8 +165,10 @@ AM_CPPFLAGS = \
   -I../lib -I$(top_srcdir)/lib \
   -I../intl
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+# INTL_MACOSX_LIBS is needed because the programs depend on libintl.la
+# but libtool doesn't put -Wl,-framework options into .la files.
 LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@)
-LDADD_yes = ../intl/libintl.la
+LDADD_yes = ../intl/libintl.la @INTL_MACOSX_LIBS@
 LDADD_no = ../intl/libgnuintl.la @LTLIBINTL@
 noinst_PROGRAMS = tstgettext tstngettext testlocale cake fc3 fc4 fc5
 tstgettext_SOURCES = tstgettext.c setlocale.c