# # patch "ChangeLog" # from [9593950beb4e191745e0eea67086df8e5de148e0] # to [9484f40af68ab6aec049283cbabb332d445dfaed] # # patch "Makefile.am" # from [3dbc9762de07d32c70441ccfb482d0206231fcf9] # to [249874a82193a2a731f3ecb76aa4184504bab09e] # # patch "configure.ac" # from [1d0b3138e1d0675690d6985d7efc105a1079bbd3] # to [2271ae5eec684f302df5c57ad4befd7c360250dc] # # patch "po/Makevars" # from [9f9d9179aaa8771ab4ddd5300c063d6a2f9e2f11] # to [b7932c12cc74a68355f76de073505ff1fdfd1ead] # ======================================================================== --- ChangeLog 9593950beb4e191745e0eea67086df8e5de148e0 +++ ChangeLog 9484f40af68ab6aec049283cbabb332d445dfaed @@ -1,3 +1,8 @@ +2005-11-26 Julio M. Merino Vidal
+ + * configure.ac, Makefile.am, po/Makevars: Avoid using xgettext's + --flag option on versions that do not support it. + 2005-11-26 Grahame Bowland * automate.cc (automate_stdio) add wrapper function to read() ======================================================================== --- Makefile.am 3dbc9762de07d32c70441ccfb482d0206231fcf9 +++ Makefile.am 249874a82193a2a731f3ecb76aa4184504bab09e @@ -400,7 +400,7 @@ mostlyclean-local: rm -rf testsuite.dir testsuite.log package_full_revision_dist.txt -DISTCLEANFILES = tests/atconfig mt-stdint.h +DISTCLEANFILES = tests/atconfig mt-stdint.h xgettext.opts # distcheck stuff ======================================================================== --- configure.ac 1d0b3138e1d0675690d6985d7efc105a1079bbd3 +++ configure.ac 2271ae5eec684f302df5c57ad4befd7c360250dc @@ -49,6 +49,29 @@ AM_ICONV AC_LANG_POP() +# Check whether xgettext supports the --flag option. We generate the +# xgettext.opts file that holds the options to be used when calling this +# utility. These options are later added to po/Makefile. +# +# Yes, this is a big hack, but due to the way po/Makefile is generated, +# there is no other way to do this in a dynamic fashion. +AC_MSG_CHECKING([whether xgettext supports --flag]) +echo 'int main(void) { return 0; }' >> conftest.c +if ${XGETTEXT} --flag printf:1:c-format -o conftest.po conftest.c \ + >/dev/null 2>&1 +then + XGETTEXT_OPTIONS="--keyword=F --keyword=FP:1,2 --keyword=_ --keyword=N_ \ + --flag=F:1:c-format --flag=FP:1:c-format \ + --flag=FP:2:c-format" + xgettext_has_flag=yes +else + XGETTEXT_OPTIONS="--keyword=F --keyword=FP:1,2 --keyword=_ --keyword=N_" + xgettext_has_flag=no +fi +rm -f conftest.c conftest.po +echo "XGETTEXT_OPTIONS = ${XGETTEXT_OPTIONS}" >xgettext.opts +AC_MSG_RESULT(${xgettext_has_flag}) + # Checks for idna stuff AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h errno.h) @@ -433,5 +456,6 @@ AC_SUBST(LIB3RDPARTY_CFLAGS) AC_SUBST(LIB3RDPARTY_CXXFLAGS) -AC_CONFIG_FILES([Makefile tests/atlocal po/Makefile.in]) +AC_CONFIG_FILES([Makefile tests/atlocal]) +AC_CONFIG_FILES([po/Makefile.in], [cat xgettext.opts >>po/Makefile.in]) AC_OUTPUT ======================================================================== --- po/Makevars 9f9d9179aaa8771ab4ddd5300c063d6a2f9e2f11 +++ po/Makevars b7932c12cc74a68355f76de073505ff1fdfd1ead @@ -7,9 +7,10 @@ subdir = po top_builddir = .. -# These options get passed to xgettext. -# the second --flag=FP option is ineffective, because of a bug in gettext. -XGETTEXT_OPTIONS = --keyword=F --keyword=FP:1,2 --keyword=_ --keyword=N_ --flag=F:1:c-format --flag=FP:1:c-format --flag=FP:2:c-format +# These options get passed to xgettext. They are defined in configure.ac +# because they are dynamically generated depending on the xgettext version +# in use. +#XGETTEXT_OPTIONS = # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding