Re: Intltoolize doesn't create po/Makefile.in ...



2009/8/12 Sever P A <gnu sever gmail com>:
> Thanks again, Daniel,
>
> I tried to insert your autogen.sh script into my project but...
> doesn't work !, and also, I don't know what must change...
>
> Could you or anyone else give me some more help ?

I got it working for a project of mine (see
http://github.com/rhdunn/orator/commit/926a63177eb8e546b3455ec5f73532c8bb73dfc6).

Specifically...

1/ In the Makefile.am (or Makefile.in) file...

a/ add po to the SUBDIRS variable

e.g.
    SUBDIRS = po src

b/ create an INTLTOOL_FILES variable as follows...

INTLTOOL_FILES = \
  intltool-extract.in \
  intltool-merge.in \
  intltool-update.in

c/ create a DISTCLEANFILES variable (if not defined already, or add to
it if it already exists) as follows...

DISTCLEANFILES = \
  intltool-extract \
  intltool-merge \
  intltool-update \
  po/.intltool-merge-cache

2/ add the following to configure.ac (or configure.in)...

IT_PROG_INTLTOOL([0.35.0])

GETTEXT_PACKAGE=my-package

AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
                   [The domain to use with gettext])
AM_GLIB_GNU_GETTEXT

PROGRAMNAME_LOCALEDIR=[${datadir}/locale]
AC_SUBST(PROGRAMNAME_LOCALEDIR)

3/ and the following at the end...

AC_CONFIG_FILES(po/Makefile.in)

4/ add the following to the Makefile.am (or Makefile.in) files in your
source directories...

AM_CPPFLAGS = -DPROGRAMNAME_LOCALEDIR=\"${PROGRAMNAME_LOCALEDIR}\"

5/ make sure your autogen.sh script looks like the following...

----- 8< -----
#!/bin/sh

mkdir -p m4

echo "Creating m4/aclocal.m4 ..."
test -r m4/aclocal.m4 || touch m4/aclocal.m4

echo "Running glib-gettextize... Ignore non-fatal messages."
echo "no" | glib-gettextize --force --copy

echo "Making m4/aclocal.m4 writable ..."
test -r m4/aclocal.m4 && chmod u+w m4/aclocal.m4

echo "Running intltoolize..."
intltoolize --force --copy --automake || return 1

echo "Running aclocal..."
aclocal || return 1

echo "Running libtoolize..."
libtoolize || return 1

echo "Running autoheader..."
autoheader || return 1

echo "Running autoconf..."
autoconf || return 1

echo "Running automake..."
automake --add-missing || return 1

echo "Running configure..."
./configure "$@"
----- >8 -----

That should, in theory, be enough for it to work.

HTH,
- Reece


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]