Fix GAtChat compilation and linking
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 24 Aug 2009 02:09:00 +0000 (19:09 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 24 Aug 2009 02:09:00 +0000 (19:09 -0700)
Makefile.am
Makefile.plugins

index d811c84feca09507460265928892cfa3b43f7af4..6579a818b649f310a26cd3e8fc6a712f532d3487 100644 (file)
@@ -22,11 +22,6 @@ local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
 
 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/object.c gdbus/watch.c
 
-gatchat_sources = gatchat/gatchat.h gatchat/gatchat.c \
-                               gatchat/gatresult.h gatchat/gatresult.c \
-                               gatchat/gatsyntax.h gatchat/gatsyntax.c \
-                               gatchat/ringbuffer.h gatchat/ringbuffer.c
-
 if DATAFILES
 dbusdir = @DBUS_DATADIR@
 
@@ -46,7 +41,7 @@ noinst_PROGRAMS =
 
 sbin_PROGRAMS = src/connmand
 
-src_connmand_SOURCES = $(gdbus_sources) $(gatchat_sources) $(builtin_sources) \
+src_connmand_SOURCES = $(gdbus_sources) $(builtin_sources) \
                        src/main.c src/connman.h src/log.c src/selftest.c \
                        src/error.c src/plugin.c src/task.c src/element.c \
                        src/device.c src/network.c src/connection.c \
@@ -88,8 +83,7 @@ AM_CFLAGS = @UDEV_CFLAGS@ @NETLINK_CFLAGS@ @DBUS_CFLAGS@ \
                                        -DSCRIPTDIR=\""$(scriptdir)"\" \
                                        -DSTORAGEDIR=\""$(storagedir)\""
 
-INCLUDES = -I$(top_builddir)/include -I$(top_builddir)/src \
-                               -I$(srcdir)/gdbus -I$(srcdir)/gatchat
+INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
 
 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf
 
@@ -167,7 +161,8 @@ src/builtin.h: src/genbuiltin $(builtin_sources)
        $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
 
 src/connman.exp: $(src_connmand_OBJECTS)
-       $(AM_V_GEN)nm -B $^ | awk '{ print $$3 }' | sort -u | grep -E -e '^connman_' > $@
+       $(AM_V_GEN)nm -B $^ | awk '{ print $$3 }' | sort -u | \
+                               grep -E -e '^connman_' -e '^g_dbus_' > $@
 
 src/connman.ver: src/connman.exp
        $(AM_V_at)echo "{ global:" > $@
index f1a75330541c859fc0593e907405c7d45db3a85f..29f9df71b4f04f20172e21142d305f43eaebe45a 100644 (file)
@@ -1,4 +1,12 @@
 
+noinst_LTLIBRARIES = plugins/libgatchat.la
+
+plugins_libgatchat_la_SOURCES = gatchat/gatchat.h gatchat/gatchat.c \
+                               gatchat/gatresult.h gatchat/gatresult.c \
+                               gatchat/gatsyntax.h gatchat/gatsyntax.c \
+                               gatchat/ringbuffer.h gatchat/ringbuffer.c
+
+
 plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
                                        @DBUS_CFLAGS@ @GLIB_CFLAGS@
 plugin_ldflags = -no-undefined -module -avoid-version
@@ -98,12 +106,14 @@ if HSO
 if HSO_BUILTIN
 builtin_modules += hso
 builtin_sources += plugins/hso.c plugins/modem.h plugins/modem.c
+builtin_cflags += -I$(srcdir)/gatchat
+builtin_libadd += plugins/libgatchat.la
 else
 plugin_LTLIBRARIES += plugins/hso.la
 plugin_objects += $(plugins_hso_la_OBJECTS)
-plugins_hso_la_SOURCES = $(gatchat_sources) \
-                       plugins/hso.c plugins/modem.h plugins/modem.c
+plugins_hso_la_SOURCES = plugins/hso.c plugins/modem.h plugins/modem.c
 plugins_hso_la_CFLAGS = $(plugin_cflags) -I$(srcdir)/gatchat
+plugins_hso_la_LIBADD = plugins/libgatchat.la
 plugins_hso_la_LDFLAGS = $(plugin_ldflags)
 endif
 endif
@@ -112,11 +122,14 @@ if MBM
 if MBM_BUILTIN
 builtin_modules += mbm
 builtin_sources += plugins/mbm.c
+builtin_cflags += -I$(srcdir)/gatchat
+builtin_libadd += plugins/libgatchat.la
 else
 plugin_LTLIBRARIES += plugins/mbm.la
 plugin_objects += $(plugins_mbm_la_OBJECTS)
-plugins_mbm_la_SOURCES = $(gatchat_sources) plugins/mbm.c
+plugins_mbm_la_SOURCES = plugins/mbm.c
 plugins_mbm_la_CFLAGS = $(plugin_cflags) -I$(srcdir)/gatchat
+plugins_mbm_la_LIBADD = plugins/libgatchat.la
 plugins_mbm_la_LDFLAGS = $(plugin_ldflags)
 endif
 endif