From 1d987ef7422a107305d21f8b0c4903e7b7b6d93f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 21 Oct 2007 23:39:22 +0000 Subject: Merge Sjoerd Simon's Avahi/GObject patch git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1557 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-glib/Makefile.am | 85 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 4 deletions(-) (limited to 'avahi-glib/Makefile.am') diff --git a/avahi-glib/Makefile.am b/avahi-glib/Makefile.am index 69bd51e..a507529 100644 --- a/avahi-glib/Makefile.am +++ b/avahi-glib/Makefile.am @@ -1,7 +1,7 @@ # $Id$ # # This file is part of avahi. -# +# # avahi is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2 of the @@ -28,10 +28,17 @@ avahiincludedir=$(includedir)/avahi-glib avahiinclude_HEADERS = \ glib-watch.h \ - glib-malloc.h + glib-malloc.h \ + ga-client.h \ + ga-entry-group.h \ + ga-enums.h \ + ga-errors.h \ + ga-record-browser.h \ + ga-service-browser.h \ + ga-service-resolver.h lib_LTLIBRARIES = \ - libavahi-glib.la + libavahi-glib.la if ENABLE_TESTS @@ -40,9 +47,33 @@ noinst_PROGRAMS = \ endif +BUILT_SOURCES = \ + signals-marshal.list \ + signals-marshal.h \ + signals-marshal.c \ + ga-client-enumtypes.h \ + ga-client-enumtypes.c \ + ga-entry-group-enumtypes.h \ + ga-entry-group-enumtypes.c \ + ga-enums-enumtypes.h \ + ga-enums-enumtypes.c + + +CORE_SOURCES = \ + ga-client.c ga-client.h \ + ga-entry-group.c ga-entry-group.h \ + ga-enums.h \ + ga-errors.c ga-errors.h \ + ga-record-browser.c ga-record-browser.h \ + ga-service-browser.c ga-service-browser.h \ + ga-service-resolver.c ga-service-resolver.h + libavahi_glib_la_SOURCES = \ glib-watch.c glib-watch.h \ - glib-malloc.h glib-malloc.c + glib-malloc.h glib-malloc.c \ + $(CORE_SOURCES) \ + $(BUILT_SOURCES) + libavahi_glib_la_CFLAGS = $(AM_CFLAGS) $(GLIB20_CFLAGS) libavahi_glib_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(GLIB20_LIBS) libavahi_glib_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info $(LIBAVAHI_GLIB_VERSION_INFO) @@ -53,4 +84,50 @@ glib_watch_test_SOURCES = \ glib_watch_test_CFLAGS = $(AM_CFLAGS) $(GLIB20_CFLAGS) glib_watch_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(GLIB20_LIBS) + +# correctly clean the generated source files +CLEANFILES = $(BUILT_SOURCES) + +dist-hook: + $(shell for x in $(BUILT_SOURCES); do rm -f $(distdir)/$$x ; done) + +signals-marshal.list: $(CORE_SOURCES) Makefile.am + ( cd $(srcdir) && \ + sed -n -e 's/.*ga_signals_marshal_\([A-Z]*__[A-Z_]*\).*/\1/p' \ + $(CORE_SOURCES) ) \ + | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp + if cmp -s $@.tmp $@; then \ + rm $@.tmp; \ + else \ + mv $@.tmp $@; \ + fi + +signals-marshal.h: signals-marshal.list + glib-genmarshal --header --prefix=ga_signals_marshal $< > $@ + +signals-marshal.c: signals-marshal.list + glib-genmarshal --body --prefix=ga_signals_marshal $< > $@ + + +# rules for making the glib enum objects +%-enumtypes.h: %.h Makefile.in + glib-mkenums \ + --fhead "#ifndef __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n#define __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ + --fprod "/* enumerations from \"@filename@\" */\n" \ + --vhead "GType @enum_name@_get_type (void);\n#define $(shell echo $* | tr [:lower:]- [:upper:]_ | sed 's/_.*//')_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ + --ftail "G_END_DECLS\n\n#endif /* __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__ */" \ + $< > $@ + +%-enumtypes.c: %.h Makefile.in + glib-mkenums \ + --fhead "#include <$*.h>" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@VALUENAME@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ + $< > $@ + endif + +indent: + indent -brf -nbbo -nbc -ip0 -cs -nbfde -npsl -br -brs -bap -i4 -bs -cdw -ce -npcs -hnl -cli4 -nut -ci8 ga-*.[ch] -- cgit