build: install .pc files & non-existing docs, honour libdir for plugins.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Tue, 17 Apr 2012 13:30:19 +0000 (16:30 +0300)
committerKrisztian Litkey <kli@iki.fi>
Tue, 17 Apr 2012 21:50:00 +0000 (00:50 +0300)
Generate and install pkgconfig files. Honour ${libdir} in the default
plugin directory and make ${libdir} available also as a macro. Install
(the non-existing) documentation.

Makefile.am
configure.ac
doc/Makefile.am [new file with mode: 0644]
src/Makefile.am
src/common/murphy-common.pc.in [new file with mode: 0644]
src/core/murphy-core.pc.in [new file with mode: 0644]
src/core/plugin.h

index af437a6..f27bdd2 100644 (file)
@@ -1 +1,2 @@
-SUBDIRS = src
+SUBDIRS  = src doc .
+doc_DATA = AUTHORS ChangeLog COPYING INSTALL NEWS README
index 4af1c2a..a3cbc6f 100644 (file)
@@ -101,11 +101,17 @@ fi
 AC_SUBST(WARNING_CFLAGS)
 
 
+# Set up murphy CFLAGS and LIBS.
 MURPHY_CFLAGS="$GLIB_CFLAGS $DBUS_CFLAGS"
 MURPHY_LIBS="$GLIB_LIBS $DBUS_LIBS"
 AC_SUBST(MURPHY_CFLAGS)
 AC_SUBST(MURPHY_LIBS)
 
+# Add LIBDIR to config.h.
+AC_MSG_CHECKING([libdir])
+AC_MSG_RESULT([$libdir])
+AC_SUBST(LIBDIR, [$libdir])
+
 # Check which plugins should be built in.
 AC_ARG_WITH(builtin-plugins,
             [  --with-builtin-plugins=<plugin-list>  specify which plugins to link in],
@@ -188,6 +194,9 @@ AC_CONFIG_FILES([build-aux/shave
                 src/common/tests/Makefile
                 src/core/tests/Makefile
                 src/daemon/tests/Makefile
+                src/common/murphy-common.pc
+                src/core/murphy-core.pc
+                doc/Makefile
                 ])
 AC_OUTPUT
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644 (file)
index 0000000..7b32ccc
--- /dev/null
@@ -0,0 +1 @@
+doc_DATA = CODING-STYLE
index 1d6179c..a0bde36 100644 (file)
@@ -1,5 +1,5 @@
 SUBDIRS         = . common/tests core/tests daemon/tests
-AM_CFLAGS       = $(WARNING_CFLAGS) -I$(top_builddir)
+AM_CFLAGS       = $(WARNING_CFLAGS) -I$(top_builddir) -DLIBDIR=\"@LIBDIR@\"
 MURPHY_CFLAGS   = 
 pkgconfigdir    = ${libdir}/pkgconfig
 
@@ -15,7 +15,7 @@ EXTRA_DIST      =
 
 lib_LTLIBRARIES += libmurphy-common.la
 EXTRA_DIST      += common/murphy-common.pc
-#pkgconfig_DATA += common/murphy-common.pc
+pkgconfig_DATA  += common/murphy-common.pc
 
 
 libmurphy_common_ladir      =          \
@@ -65,7 +65,7 @@ linker-script.common: $(libmurphy_common_la_HEADERS)
 
 lib_LTLIBRARIES += libmurphy-core.la
 EXTRA_DIST      += core/murphy-core.pc
-#pkgconfig_DATA  += core/murphy-core.pc
+pkgconfig_DATA  += core/murphy-core.pc
 
 
 libmurphy_core_ladir      =            \
@@ -105,7 +105,7 @@ BUILTIN_CFLAGS     = -D__MURPHY_BUILTIN_PLUGIN__ $(AM_CFLAGS)
 BUILTIN_LIBS       =
 
 plugin_LTLIBRARIES = 
-plugindir          = $(libdir)/murphy
+plugindir          = $(libdir)/murphy/plugins
 
 
 # test plugin
diff --git a/src/common/murphy-common.pc.in b/src/common/murphy-common.pc.in
new file mode 100644 (file)
index 0000000..6a486b3
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: murphy-common
+Description: Murphy policy framework, common library.
+Requires:
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lsysinfo-common @GLIB_LIBS@ @DBUS_LIBS@
+Cflags: -I${includedir} @GLIB_CFLAGS@ @DBUS_CFLAGS@ 
diff --git a/src/core/murphy-core.pc.in b/src/core/murphy-core.pc.in
new file mode 100644 (file)
index 0000000..32c71a1
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: murphy-core
+Description: Murphy policy framework, core library.
+Requires: murphy-common @PACKAGE_VERSION@
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lmurphy-common
+Cflags: -I${includedir}
index f0633a4..ade43a2 100644 (file)
@@ -11,7 +11,7 @@
 #include <murphy/core/context.h>
 
 #ifndef MRP_DEFAULT_PLUGIN_DIR
-#    define MRP_DEFAULT_PLUGIN_DIR "/usr/lib/murphy/plugins"
+#    define MRP_DEFAULT_PLUGIN_DIR LIBDIR"/murphy/plugins"
 #endif
 
 #define MRP_PLUGIN_DESCRIPTOR "mrp_get_plugin_descriptor"