Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
Makefile.am | 3 +-
configure.ac | 5 ++-
pkgconfig/.gitignore | 1 +
pkgconfig/Makefile.am | 72 +++++++++++++++++++++++++++++++++++++++++++
pkgconfig/libtemplate.pc.in | 11 ++++++
5 files changed, 88 insertions(+), 4 deletions(-)
create mode 100644 pkgconfig/.gitignore
create mode 100644 pkgconfig/Makefile.am
create mode 100644 pkgconfig/libtemplate.pc.in
diff --git a/Makefile.am b/Makefile.am
index d88a6e2..f2107d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,8 +37,7 @@ ACLOCAL_AMFLAGS = -I m4
dist_doc_DATA = COPYING INSTALL README TODO
-SUBDIRS = include lib docs tests
-#pkgconfig
+SUBDIRS = include lib docs pkgconfig tests
install-exec-local:
$(INSTALL) -d $(DESTDIR)/${SOCKETDIR}
diff --git a/configure.ac b/configure.ac
index a3db919..f0541e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -357,10 +357,11 @@ AC_CONFIG_FILES([Makefile
include/Makefile
include/qb/Makefile
lib/Makefile
+ tests/Makefile
+ pkgconfig/Makefile
docs/Makefile
docs/man.dox
- docs/html.dox
- tests/Makefile])
+ docs/html.dox])
AC_OUTPUT
diff --git a/pkgconfig/.gitignore b/pkgconfig/.gitignore
new file mode 100644
index 0000000..6fd0ef0
--- /dev/null
+++ b/pkgconfig/.gitignore
@@ -0,0 +1 @@
+*.pc
diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am
new file mode 100644
index 0000000..8ddf6c0
--- /dev/null
+++ b/pkgconfig/Makefile.am
@@ -0,0 +1,72 @@
+# Copyright (c) 2009 Red Hat, Inc.
+#
+# All rights reserved.
+#
+# This software licensed under BSD license, the text of which follows:
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# - Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# - Neither the name of the MontaVista Software, Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR ENGINES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+MAINTAINERCLEANFILES = Makefile.in
+
+EXTRA_DIST = libtemplate.pc.in
+
+LIBS = qbipcc qbipcs qbhash qblogsys qbpoll qbtimer qbtsafe qbwthread qbutil
+
+qbipcc_LIBS = -lqbutil
+qbipcs_LIBS = -lqbutil
+qbhash_LIBS = -lqbutil
+qblogsys_LIBS = -lqbutil
+qbtimer_LIBS = -lqbutil
+qbpoll_LIBS = "-lqbutil -lrt"
+qbwthread_LIBS = -lqbutil
+qbtsafe_LIBS =
+qbutil_LIBS =
+
+target_LIBS = $(LIBS:%=lib%.pc)
+
+lib%.pc: libtemplate.pc.in Makefile
+ rm -f $@-t $@
+ sed \
+ -e 's#@''PREFIX@#$(exec_prefix)#g' \
+ -e 's#@''LIBDIR@#$(libdir)#g' \
+ -e 's#@''LIBVERSION@#$(VERSION)#g' \
+ -e 's#@''LIBNAME@#'$(*:lib%=%)'#g' \
+ -e 's#@''LIBS@#'-l$(*:lib%=%)\ $($(*:lib%=%)_LIBS)'#g' \
+ $< > $@-t
+ chmod a-w $@-t
+ mv $@-t $@
+
+all-local: $(target_LIBS)
+
+install-exec-local: $(target_LIBS) $(target_PACKAGE)
+ $(INSTALL) -d $(DESTDIR)/$(libdir)/pkgconfig
+ $(INSTALL) -m 644 $(target_LIBS) $(target_PACKAGE) $(DESTDIR)/$(libdir)/pkgconfig
+
+uninstall-local:
+ cd $(DESTDIR)/$(libdir)/pkgconfig && rm -f $(target_LIBS) $(target_PACKAGE)
+ rmdir $(DESTDIR)/$(libdir)/pkgconfig 2> /dev/null || :
+
+clean-local:
+ rm -f *.pc
diff --git a/pkgconfig/libtemplate.pc.in b/pkgconfig/libtemplate.pc.in
new file mode 100644
index 0000000..1938d84
--- /dev/null
+++ b/pkgconfig/libtemplate.pc.in
@@ -0,0 +1,11 @@
+prefix=@PREFIX@
+exec_prefix=${prefix}
+libdir=@LIBDIR@
+includedir=${prefix}/include
+
+Name: @LIBNAME@
+Version: @LIBVERSION@
+Description: @LIBNAME@
+Requires:
+Libs: -L${libdir} @LIBS@
+Cflags: -I${includedir}
--
1.6.6.1
Show replies by thread
Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
Makefile.am | 7 +------
docs/Makefile.am | 19 +++++++------------
2 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index f2107d9..fdf3275 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,11 +39,6 @@ dist_doc_DATA = COPYING INSTALL README TODO
SUBDIRS = include lib docs pkgconfig tests
-install-exec-local:
- $(INSTALL) -d $(DESTDIR)/${SOCKETDIR}
-
-uninstall-local:
- rmdir $(DESTDIR)/${SOCKETDIR} || :;
lint:
$(MAKE) -C lib lint
@@ -58,7 +53,7 @@ maintainer-clean-local:
rm -rf m4
clean-generic:
- rm -rf docs/html docs/man3 $(SPEC) $(TARFILE)
+ rm -rf $(SPEC) $(TARFILE)
## make rpm/srpm section.
diff --git a/docs/Makefile.am b/docs/Makefile.am
index b4e497c..234932a 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -20,23 +20,18 @@
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = man.dox html.dox
-dist_man_MANS = man3/qbtsafe.h.3 man3/qbhdb.h.3 man3/qblist.h.3 \
- man3/qbpoll.h.3 man3/qbtimer.h.3 man3/qbplugin.h.3 \
- man3/qbplugin_comp.h.3 man3/qbipcc.h.3 man3/qbipcs.h.3 \
- man3/qbqueue.h.3 man3/qbwthread.h.3 man3/qblogsys.h.3 \
- man3/qbhash.h.3 man3/qbipc_common.h.3 man3/qbutil.h.3
-
inc_dir = $(top_srcdir)/include/qb
-
-dependant_headers = $(inc_dir)/qbtsafe.h $(inc_dir)/qbhdb.h $(inc_dir)/qblist.h \
- $(inc_dir)/qbpoll.h $(inc_dir)/qbtimer.h $(inc_dir)/qbplugin.h \
- $(inc_dir)/qbplugin_comp.h $(inc_dir)/qbipcc.h $(inc_dir)/qbipc_common.h \
- $(inc_dir)/qbipcs.h $(inc_dir)/qbqueue.h $(inc_dir)/qbwthread.h \
- $(inc_dir)/qblogsys.h $(inc_dir)/qbhash.h $(inc_dir)/qbutil.h
+dependant_headers = $(wildcard $(inc_dir)/qb*.h)
+dist_man_MANS = $(addsuffix .3,$(subst $(inc_dir),man3,$(dependant_headers)))
$(dist_man_MANS): man.dox $(dependant_headers)
+ mkdir -p man3
doxygen man.dox
doxygen: html.dox
+ mkdir -p html
doxygen html.dox
+clean-generic:
+ rm -rf html man3
+
--
1.6.6.1