Przeglądaj źródła

Add .pc file support for corosync libs

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1755 fd59a12c-fef9-0310-b244-a6a79926bd2f
Fabio M. Di Nitto 17 lat temu
rodzic
commit
8ea72786c3
4 zmienionych plików z 86 dodań i 16 usunięć
  1. 6 16
      Makefile
  2. 19 0
      Makefile.inc
  3. 50 0
      pkgconfig/Makefile
  4. 11 0
      pkgconfig/libtemplate.pc.in

+ 6 - 16
Makefile

@@ -46,22 +46,6 @@ INCLUDEDIR_LCR=$(PREFIX)/include/corosync/lcr
 INCLUDEDIR_ENGINE=$(PREFIX)/include/corosync/engine
 INCLUDEDIR_ENGINE=$(PREFIX)/include/corosync/engine
 MANDIR=$(PREFIX)/share/man
 MANDIR=$(PREFIX)/share/man
 ETCDIR=/etc
 ETCDIR=/etc
-ARCH=$(shell uname -p)
-
-ifeq (,$(findstring 64,$(ARCH)))
-LIBDIR=$(PREFIX)/lib/corosync
-else
-LIBDIR=$(PREFIX)/lib64/corosync
-endif
-ifeq (s390,$(ARCH))
-LIBDIR=$(PREFIX)/lib/corosync
-endif
-ifeq (s390x,$(ARCH))
-LIBDIR=$(PREFIX)/lib64/corosync
-endif
-ifeq (ia64,$(ARCH))
-LIBDIR=$(PREFIX)/lib/corosync
-endif
 
 
 SUBDIRS:=$(builddir)lcr $(builddir)lib $(builddir)tools $(builddir)exec $(builddir)test $(builddir)services
 SUBDIRS:=$(builddir)lcr $(builddir)lib $(builddir)tools $(builddir)exec $(builddir)test $(builddir)services
 sub_make = srcdir=$(srcdir) builddir=$(builddir) subdir=$(1)/ $(MAKE) -I$(srcdir)$(1) -f $(srcdir)$(1)/Makefile $(2)
 sub_make = srcdir=$(srcdir) builddir=$(builddir) subdir=$(1)/ $(MAKE) -I$(srcdir)$(1) -f $(srcdir)$(1)/Makefile $(2)
@@ -73,6 +57,7 @@ all: $(SUBDIRS)
 	@(cd $(builddir)tools; echo ==== `pwd` ===;  $(call sub_make,tools,all));
 	@(cd $(builddir)tools; echo ==== `pwd` ===;  $(call sub_make,tools,all));
 	@(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,all));
 	@(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,all));
 	@(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,all));
 	@(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,all));
+	@(cd $(builddir)pkgconfig; echo ==== `pwd` ===; $(call sub_make,pkgconfig,all));
 
 
 # subdirs are not phony
 # subdirs are not phony
 .PHONY: all clean install doxygen
 .PHONY: all clean install doxygen
@@ -113,6 +98,8 @@ clean:
 	(cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,clean));
 	(cd $(builddir)exec; echo ==== `pwd` ===; $(call sub_make,exec,clean));
 	(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,clean));
 	(cd $(builddir)services; echo ==== `pwd` ===; $(call sub_make,services,clean));
 	(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,clean));
 	(cd $(builddir)test; echo ==== `pwd` ===; $(call sub_make,test,clean));
+	(cd $(builddir)pkgconfig; echo ==== `pwd` ===; $(call sub_make,pkgconfig,clean));
+
 	rm -rf $(builddir)doc/api
 	rm -rf $(builddir)doc/api
 
 
 lint:
 lint:
@@ -141,6 +128,7 @@ install: all
 	mkdir -p $(DESTDIR)$(MANDIR)/man5
 	mkdir -p $(DESTDIR)$(MANDIR)/man5
 	mkdir -p $(DESTDIR)$(MANDIR)/man8
 	mkdir -p $(DESTDIR)$(MANDIR)/man8
 	mkdir -p $(DESTDIR)$(ETCDIR)/ld.so.conf.d
 	mkdir -p $(DESTDIR)$(ETCDIR)/ld.so.conf.d
+	mkdir -p $(DESTDIR)$(PKGCONFIGDIR)
 
 
 
 
 	for eLib in $(EXEC_LIBS); do					\
 	for eLib in $(EXEC_LIBS); do					\
@@ -209,5 +197,7 @@ install: all
 	install -m 644 $(srcdir)man/*.5 $(DESTDIR)$(MANDIR)/man5
 	install -m 644 $(srcdir)man/*.5 $(DESTDIR)$(MANDIR)/man5
 	install -m 644 $(srcdir)man/*.8 $(DESTDIR)$(MANDIR)/man8
 	install -m 644 $(srcdir)man/*.8 $(DESTDIR)$(MANDIR)/man8
 
 
+	install -m 644 $(builddir)/pkgconfig/*.pc $(DESTDIR)$(PKGCONFIGDIR)
+
 doxygen:
 doxygen:
 	mkdir -p doc/api && doxygen
 	mkdir -p doc/api && doxygen

+ 19 - 0
Makefile.inc

@@ -3,6 +3,25 @@ PREFIX=/usr
 DESTDIR=
 DESTDIR=
 LCRSODIR=$(PREFIX)/libexec/lcrso
 LCRSODIR=$(PREFIX)/libexec/lcrso
 
 
+ARCH=$(shell uname -p)
+ifeq (,$(findstring 64,$(ARCH)))
+PRELIBDIR=$(PREFIX)/lib
+else
+PRELIBDIR=$(PREFIX)/lib64
+endif
+ifeq (s390,$(ARCH))
+PRELIBDIR=$(PREFIX)/lib
+endif
+ifeq (s390x,$(ARCH))
+PRELIBDIR=$(PREFIX)/lib64
+endif
+ifeq (ia64,$(ARCH))
+PRELIBDIR=$(PREFIX)/lib
+endif
+
+LIBDIR=$(PRELIBDIR)/corosync
+PKGCONFIGDIR=$(PRELIBDIR)/pkgconfig
+
 # Do not modify below this line
 # Do not modify below this line
 
 
 # Basic OS detection
 # Basic OS detection

+ 50 - 0
pkgconfig/Makefile

@@ -0,0 +1,50 @@
+# 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.
+
+# Include configuration
+#
+srcdir ?= $(CURDIR)/../
+subdir ?= pkgconfig
+
+include $(srcdir)/Makefile.inc
+
+LIBS = evs cpg cfg coroutil confdb quorum votequorum totem_pg logsys
+
+all:
+	for i in $(LIBS); do \
+		cat ${srcdir}/pkgconfig/libtemplate.pc.in | sed \
+			-e 's#@PREFIX@#$(PREFIX)#g' \
+			-e 's#@LIBDIR@#$(LIBDIR)#g' \
+			-e 's#@LIB@#'$${i}'#g' \
+		> lib$${i}.pc; \
+	done;
+
+clean:
+	rm -f *.pc

+ 11 - 0
pkgconfig/libtemplate.pc.in

@@ -0,0 +1,11 @@
+prefix=@PREFIX@
+exec_prefix=${prefix}
+libdir=@LIBDIR@
+includedir=${prefix}/include
+
+Name: @LIB@
+Version: trunk
+Description: @LIB@
+Requires:
+Libs: -L${libdir} -l@LIB@
+Cflags: -I${includedir}