Hello Werner,

> Is there an example package with automake and gnulib that uses both C
> and C++ similar to ttfautohint, and that I could use as a template?

I don't know of such an example package.

Basically, the steps are to

1) Create a lib/configure.ac that contains everything relevant to the
   C code (lib/ directory),
2) Create a frontend/configure.ac that contains everything relevant to the
   C++ code (frontend/ directory).
Each with a gnulib-tool invocation. The two gnulib-tool invocations can
share the same build-aux/ directory and gnulib-m4/ directories (at the
top-level directory, likely), but must not share the gnulib-lib/ directory.

3) Test each of these subpackages separately.

You'll have to adjust the -I options in order not to accidentally use
the other subpackage's config.h file.

4) From the top-level configure.ac, remove all that's in the sub-configure.acs.
Instead insert

  AC_CONFIG_SUBDIRS([lib frontend])

And, in case your subdir-configures define some options, you have to collect
them:

dnl Ensure that "configure --help" lists all the command line options that
dnl are usable with the subdir configures. Really AC_CONFIG_SUBDIRS should
dnl do it by itself.
dnl System types:
AC_CANONICAL_HOST
dnl Optional Features: AC_ARG_ENABLE calls
dnl Optional Packages: AC_ARG_WITH calls
dnl Some influential environment variables: AC_ARG_VAR calls
esyscmd([{ cd lib && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' 
--trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd 
frontend && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' 
--trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | 
sed -f build-aux/ac-help.sed ])

Where build-aux/ac-help.sed comes from GNU gettext [1].

I hope this is good enough to give you a good start?

Bruno

[1] 
http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob_plain;f=build-aux/ac-help.sed


Reply via email to