bin_PROGRAMS = libt2n-codegen
-pkgdata_DATA = clientlib.pc.in codegen.make
+pkgdata_DATA = clientlib.pc.in
# needed because we use old automake not supporting dist_ prefix
- remove support for LIBT2N_EXPORT_GROUP(group) (this will simplify the generator a lot)
- add option similar to gccs -MD (at the moment it is a fixed set of files generated and
- they are handled in the makefile)
+ they are handled in the makefile snippet [codegen.make])
open questions:
- should projects using the codegen depend on installed version of ... or ship their own version?
- * codegen binary: no
- * Makefile snippet: no
- * codegen-stubhead.hxx
-- get rid of codegen-stubhead.hxx or include a "copy" in each project
+- get rid of codegen-stubhead.hxx or include a "copy" in each project?
+ first we said yes but now i say no because the lib depends on the libt2n headers anyway
- makefile snippet must work for builds outside of libt2n
- (=> some variables must be set by configure, the snippet must be installed
- => pc file template must be installed, too)
-
- the variables which must be set:
+ => some variables must be set by configure
+ the variables which must be set:
LIBT2N_CODEGEN="\$(top_builddir)/codegen/libt2n-codegen"
LIBT2N_CLIENT_PCTEMPLATE="\$(top_srcdir)/codegen/clientlib.pc.in"
LIBT2N_CODEGEN_MAKESNIPPET="include \$(top_srcdir)/codegen/codegen.make"
- LIBT2N_CODEGEN will be handled by AC_PATH_PROG
- the other two? can't we use pkgconfig?!
- perhaps best provide a m4 macro for use with autoconf?
-
- AC_DEFUN([LIBT2N_CODEGEN ...
-
- alternatively we could add a option --datadir to codegen which prints out the
- path to clientlib.pc.in and codegen.make
- (first solution is the better one)
-
- we can use pkg-config => best solution
+ we store the variables in the .pc file of libt2n
+ maybe wrap the calls to pkg-config in a m4 macro
+ (=> projects using libt2n-codegen need only one line in configure.in)
- it would really be much nicer if the client lib includes would not depend upon boost serialization
i thought a solution would be to provide this optionally by wrapping the corresponding includes in a #ifdef
but this does not work since command.hxx is included which depends on boost serialization headers anyway
=> we do not provide this for now
+- add example using a generated client library
+ (=> depends on installed example)
LIBT2N_LIBS="\$(top_builddir)/src/libt2n.la @BOOST_SERIALIZATION_LIB@ @BOOST_LDFLAGS@"
LIBT2N_CODEGEN="\$(top_builddir)/codegen/libt2n-codegen"
LIBT2N_CLIENT_PCTEMPLATE="\$(top_srcdir)/codegen/clientlib.pc.in"
-LIBT2N_CODEGEN_MAKESNIPPET="include \$(top_srcdir)/codegen/codegen.make"
AC_SUBST(LIBT2N_CFLAGS)
AC_SUBST(LIBT2N_LIBS)
AC_SUBST(LIBT2N_CODEGEN)
AC_SUBST(LIBT2N_CLIENT_PCTEMPLATE)
-AC_SUBST(LIBT2N_CODEGEN_MAKESNIPPET)
dnl todo: do not create .pc file in configure but in make
dnl see also autoconf manual "Installation Directory Variables"
# not a GNU package. You can remove this line, if
-# have all needed files, that a GNU package needs
+# you have all needed files, that a GNU package needs
AUTOMAKE_OPTIONS = foreign 1.4
INCLUDES = @LIBT2N_CFLAGS@
EXTRA_DIST = $(TESTS) configure.in
-# we have got an old automake version (1.4-p5) which doesn't support nodist_
-# => you might want to use the dist-hook to remove generated files
-dist-hook:
- rm -vf $(foreach i, $(LIBT2N_CODEGEN_BUILT), $(distdir)/$(i))
-
# if you use libt2n-codegen you should add this
-@LIBT2N_CODEGEN_MAKESNIPPET@
-
-CLEANFILES = $(LIBT2N_SUGGESTED_CLEANFILES)
-
+# (i did not find a nice way to let libt2n install this makefile snippet
+# and let projects using libt2n use the installed version.
+# the core of the problem is:
+# the makefile snippet is already needed when automake is run
+# => no way to let configure locate the snippet)
+include codegen.make
- dist-hook in included makefile does not work (because automake doesn't see it!)
- CLEANFILES doesn't work in included makefile either
+
+BUG:
+- first time builds without dependency files fail (.P)!
+ maybe yet another problem caused by automake?
+ probably yes
+ AHH:
+ automake supports include
+ the real problem is: at the time automake runs there is no include!
+ (since it is "added" by the configure script)
+
+ => the real problem:
+ configure should find the make file snippet
+ Makefile.am should include it
+ automake is run before configure (on the Makefile.am)
+
include_HEADERS += $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx)
-#IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j)))
+# not needed but nice to have
+# IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j)))
-include $(foreach i, $(CMDGROUPS), libt2ngroup_$(i).P)
-libt2ngroup_%.P : Makefile
+libt2ngroup_%.P : Makefile.am
echo $@ : $($*_GROUP) > libt2ngroup_$*.P
%.libt2nstamp : libt2ngroup_%.P $(LIBT2N_CODEGEN)
-e 's,\@includedir\@,$(includedir),g' \
$< >$*.pc
-LIBT2N_SUGGESTED_CLEANFILES = $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
-
-# doesn't work
-# CLEANFILES = $(LIBT2N_SUGGESTED_CLEANFILES)
+CLEANFILES += $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
# didn't work (same problem as with _LTLIBRARIES [parsing by automake],
# this time _OBJECTS was not correct)
# we have got an old automake version (1.4-p5) which doesn't support nodist_
# => we use the dist-hook
-# unfortunately dist-hook only works if directly visible for automake (=> not in this include)
-#dist-hook:
-# rm -vf $(foreach i, $(BUILT_SOURCES), $(distdir)/$(i))
+dist-hook:
+ rm -vf $(foreach i, $(LIBT2N_CODEGEN_BUILT), $(distdir)/$(i))
+
+EXTRA_DIST += codegen.make
LIBT2N_CODEGEN=`$PKG_CONFIG --variable libt2n_codegen libt2n`
LIBT2N_DATADIR=`$PKG_CONFIG --variable libt2n_datadir libt2n`
LIBT2N_CLIENT_PCTEMPLATE="$LIBT2N_DATADIR/clientlib.pc.in"
-LIBT2N_CODEGEN_MAKESNIPPET="include $LIBT2N_DATADIR/codegen.make"
AC_SUBST(LIBT2N_CODEGEN)
AC_SUBST(LIBT2N_CLIENT_PCTEMPLATE)
-AC_SUBST(LIBT2N_CODEGEN_MAKESNIPPET)
AC_OUTPUT(Makefile)