From 7835d90bdc5de6d82d14e98a570f8cc8300fcee2 Mon Sep 17 00:00:00 2001 From: pdurante Date: Sun, 31 Dec 2006 05:16:32 +0000 Subject: [PATCH] * Renamed pkg-config configuration file * Initial support for out-of-tree builds and crosscompilation (Robert Schwebel) git-svn-id: http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus@9043 30a43799-04e7-0310-8b2b-ea0d24f86d0e --- Makefile.am | 2 +- configure.ac | 19 ++++++++++++++++++- dbus-c++.pc.in => dbus-c++-1.pc.in | 0 examples/echo/Makefile.am | 2 +- examples/properties/Makefile.am | 2 +- tools/Makefile.am | 14 ++++++++++++-- 6 files changed, 33 insertions(+), 6 deletions(-) rename dbus-c++.pc.in => dbus-c++-1.pc.in (100%) diff --git a/Makefile.am b/Makefile.am index 6ad0347..fb858fc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = src tools data doc examples EXTRA_DIST = autogen.sh pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = dbus-c++.pc +pkgconfig_DATA = dbus-c++-1.pc MAINTAINERCLEANFILES = \ configure \ diff --git a/configure.ac b/configure.ac index 7385105..ccbf569 100644 --- a/configure.ac +++ b/configure.ac @@ -30,6 +30,9 @@ AC_LANG_CPLUSPLUS AC_PROG_CC AC_PROG_CXX +CXX_FOR_BUILD=${CXX_FOR_BUILD-${CXX}} +AC_SUBST(CXX_FOR_BUILD) + AM_PROG_LIBTOOL PKG_PROG_PKG_CONFIG @@ -92,6 +95,20 @@ fi AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes) AC_MSG_RESULT(yes) + +# For the tools/, we need libdbus-c++ for the "build" architecture as well + +AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes) + +AC_ARG_WITH(build-libdbus-cxx, + AS_HELP_STRING([--with-build-libdbus-cxx],[For cross compilation: path to + libdbus-cxx which was compiled for the 'build' system.]), + [ BUILD_LIBDBUS_CXX_DIR=${withval} ], + [ BUILD_LIBDBUS_CXX_DIR="\$(top_builddir)" ] +) +AC_SUBST(BUILD_LIBDBUS_CXX_DIR) + + # Save processed files AC_OUTPUT( @@ -105,5 +122,5 @@ AC_OUTPUT( examples/properties/Makefile examples/echo/Makefile examples/hal/Makefile - dbus-c++.pc + dbus-c++-1.pc ) diff --git a/dbus-c++.pc.in b/dbus-c++-1.pc.in similarity index 100% rename from dbus-c++.pc.in rename to dbus-c++-1.pc.in diff --git a/examples/echo/Makefile.am b/examples/echo/Makefile.am index ca24f85..b9b861c 100644 --- a/examples/echo/Makefile.am +++ b/examples/echo/Makefile.am @@ -14,7 +14,7 @@ BUILT_SOURCES = echo-glue.h CLEANFILES = $(BUILT_SOURCES) dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) + cd $(distdir); rm -f $(BUILT_SOURCES) MAINTAINERCLEANFILES = \ Makefile.in diff --git a/examples/properties/Makefile.am b/examples/properties/Makefile.am index 8ebfdcd..c0c9565 100644 --- a/examples/properties/Makefile.am +++ b/examples/properties/Makefile.am @@ -14,7 +14,7 @@ BUILT_SOURCES = props-glue.h CLEANFILES = $(BUILT_SOURCES) dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) + cd $(distdir); rm -f $(BUILT_SOURCES) MAINTAINERCLEANFILES = \ Makefile.in diff --git a/tools/Makefile.am b/tools/Makefile.am index 0db7866..73a0df9 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,15 +1,25 @@ +# hacky, but ... + +CXX = $(CXX_FOR_BUILD) + AM_CPPFLAGS = \ $(dbus_CFLAGS) \ -I$(top_srcdir)/include \ -DDBUS_API_SUBJECT_TO_CHANGE +if CROSS_COMPILING +libdbus_cxx_la = $(BUILD_LIBDBUS_CXX_DIR)/src/libdbus-c++-1.la +else +libdbus_cxx_la = $(top_builddir)/src/libdbus-c++-1.la +endif + bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect dbusxx_xml2cpp_SOURCES = xml2cpp.h xml2cpp.cpp -dbusxx_xml2cpp_LDADD = $(dbus_LIBS) $(top_builddir)/src/libdbus-c++-1.la +dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la) dbusxx_introspect_SOURCES = introspect.h introspect.cpp -dbusxx_introspect_LDADD = $(top_builddir)/src/libdbus-c++-1.la +dbusxx_introspect_LDADD = $(libdbus_cxx_la) MAINTAINERCLEANFILES = \ Makefile.in