gettext: configure.ac
1
1 13.4.5 ‘configure.ac’ at top level
1 ----------------------------------
1
1 ‘configure.ac’ or ‘configure.in’ - this is the source from which
1 ‘autoconf’ generates the ‘configure’ script.
1
1 1. Declare the package and version.
1
1 This is done by a set of lines like these:
1
1 PACKAGE=gettext
1 VERSION=0.19.8.1
1 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
1 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
1 AC_SUBST(PACKAGE)
1 AC_SUBST(VERSION)
1
1 or, if you are using GNU ‘automake’, by a line like this:
1
1 AM_INIT_AUTOMAKE(gettext, 0.19.8.1)
1
1 Of course, you replace ‘gettext’ with the name of your package, and
1 ‘0.19.8.1’ by its version numbers, exactly as they should appear in
1 the packaged ‘tar’ file name of your distribution
1 (‘gettext-0.19.8.1.tar.gz’, here).
1
1 2. Check for internationalization support.
1
1 Here is the main ‘m4’ macro for triggering internationalization
1 support. Just add this line to ‘configure.ac’:
1
1 AM_GNU_GETTEXT
1
1 This call is purposely simple, even if it generates a lot of
1 configure time checking and actions.
1
1 If you have suppressed the ‘intl/’ subdirectory by calling
1 ‘gettextize’ without ‘--intl’ option, this call should read
1
1 AM_GNU_GETTEXT([external])
1
1 3. Have output files created.
1
1 The ‘AC_OUTPUT’ directive, at the end of your ‘configure.ac’ file,
1 needs to be modified in two ways:
1
1 AC_OUTPUT([EXISTING CONFIGURATION FILES intl/Makefile po/Makefile.in],
1 [EXISTING ADDITIONAL ACTIONS])
1
1 The modification to the first argument to ‘AC_OUTPUT’ asks for
1 substitution in the ‘intl/’ and ‘po/’ directories. Note the ‘.in’
1 suffix used for ‘po/’ only. This is because the distributed file
1 is really ‘po/Makefile.in.in’.
1
1 If you have suppressed the ‘intl/’ subdirectory by calling
1 ‘gettextize’ without ‘--intl’ option, then you don’t need to add
1 ‘intl/Makefile’ to the ‘AC_OUTPUT’ line.
1
1 If, after doing the recommended modifications, a command like
1 ‘aclocal -I m4’ or ‘autoconf’ or ‘autoreconf’ fails with a trace similar
1 to this:
1
1 configure.ac:44: warning: AC_COMPILE_IFELSE was called before AC_GNU_SOURCE
1 ../../lib/autoconf/specific.m4:335: AC_GNU_SOURCE is expanded from...
1 m4/lock.m4:224: gl_LOCK is expanded from...
1 m4/gettext.m4:571: gt_INTL_SUBDIR_CORE is expanded from...
1 m4/gettext.m4:472: AM_INTL_SUBDIR is expanded from...
1 m4/gettext.m4:347: AM_GNU_GETTEXT is expanded from...
1 configure.ac:44: the top level
1 configure.ac:44: warning: AC_RUN_IFELSE was called before AC_GNU_SOURCE
1
1 you need to add an explicit invocation of ‘AC_GNU_SOURCE’ in the
1 ‘configure.ac’ file - after ‘AC_PROG_CC’ but before ‘AM_GNU_GETTEXT’,
1 most likely very close to the ‘AC_PROG_CC’ invocation. This is
1 necessary because of ordering restrictions imposed by GNU autoconf.
1