From e334c48314062ac1a1843c741ac4f925ac7e2db2 Mon Sep 17 00:00:00 2001 From: Date: Fri, 10 Apr 2009 05:49:58 +0000 Subject: [PATCH] Generation of pkg-config metadata file. Thanks Tomasz for this contribution! git-svn-id: https://google-glog.googlecode.com/svn/trunk@46 eb4d4688-79bd-11dd-afb4-1d65580434c0 --- Makefile.am | 4 +++ Makefile.in | 48 +++++++++++++++++++++++++-------- configure | 3 +++ configure.ac | 2 +- libglog.pc.in | 10 +++++++ packages/deb/libgoogle-glog-dev.dirs | 1 + packages/deb/libgoogle-glog-dev.install | 2 ++ packages/rpm/rpm.spec | 1 + 8 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 libglog.pc.in diff --git a/Makefile.am b/Makefile.am index 302c8a8..d9fde84 100644 --- a/Makefile.am +++ b/Makefile.am @@ -231,3 +231,7 @@ EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb src/windows/glog/raw_logging.h src/windows/glog/stl_logging.h \ src/windows/glog/vlog_is_on.h \ $(WINDOWS_PROJECTS) + +# Add pkgconfig file +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libglog.pc diff --git a/Makefile.in b/Makefile.in index 109ba84..eb12de9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,8 +52,8 @@ noinst_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \ $(gloginclude_HEADERS) $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure \ - $(top_srcdir)/src/config.h.in \ + $(srcdir)/Makefile.in $(srcdir)/libglog.pc.in \ + $(top_srcdir)/configure $(top_srcdir)/src/config.h.in \ $(top_srcdir)/src/glog/logging.h.in \ $(top_srcdir)/src/glog/raw_logging.h.in \ $(top_srcdir)/src/glog/stl_logging.h.in \ @@ -76,7 +76,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = src/glog/logging.h src/glog/raw_logging.h \ - src/glog/vlog_is_on.h src/glog/stl_logging.h + src/glog/vlog_is_on.h src/glog/stl_logging.h libglog.pc am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -84,7 +84,8 @@ am__vpath_adj = case $$p in \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \ - "$(DESTDIR)$(glogincludedir)" "$(DESTDIR)$(glogincludedir)" + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(glogincludedir)" \ + "$(DESTDIR)$(glogincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = @@ -279,7 +280,8 @@ DIST_SOURCES = $(libglog_la_SOURCES) $(demangle_unittest_SOURCES) \ $(stacktrace_unittest_SOURCES) $(stl_logging_unittest_SOURCES) \ $(symbolize_unittest_SOURCES) $(utilities_unittest_SOURCES) dist_docDATA_INSTALL = $(INSTALL_DATA) -DATA = $(dist_doc_DATA) +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_doc_DATA) $(pkgconfig_DATA) glogincludeHEADERS_INSTALL = $(INSTALL_HEADER) nodist_glogincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(gloginclude_HEADERS) $(nodist_gloginclude_HEADERS) \ @@ -578,6 +580,10 @@ EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb src/windows/glog/vlog_is_on.h \ $(WINDOWS_PROJECTS) + +# Add pkgconfig file +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libglog.pc all: all-am .SUFFIXES: @@ -640,6 +646,8 @@ src/glog/vlog_is_on.h: $(top_builddir)/config.status $(top_srcdir)/src/glog/vlog cd $(top_builddir) && $(SHELL) ./config.status $@ src/glog/stl_logging.h: $(top_builddir)/config.status $(top_srcdir)/src/glog/stl_logging.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ +libglog.pc: $(top_builddir)/config.status $(srcdir)/libglog.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @@ -984,6 +992,23 @@ uninstall-dist_docDATA: echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ rm -f "$(DESTDIR)$(docdir)/$$f"; \ done +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done install-glogincludeHEADERS: $(gloginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(glogincludedir)" || $(MKDIR_P) "$(DESTDIR)$(glogincludedir)" @@ -1280,7 +1305,7 @@ check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \ $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(glogincludedir)" "$(DESTDIR)$(glogincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(glogincludedir)" "$(DESTDIR)$(glogincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1330,7 +1355,7 @@ info: info-am info-am: install-data-am: install-dist_docDATA install-glogincludeHEADERS \ - install-nodist_glogincludeHEADERS + install-nodist_glogincludeHEADERS install-pkgconfigDATA install-dvi: install-dvi-am @@ -1369,7 +1394,8 @@ ps: ps-am ps-am: uninstall-am: uninstall-dist_docDATA uninstall-glogincludeHEADERS \ - uninstall-libLTLIBRARIES uninstall-nodist_glogincludeHEADERS + uninstall-libLTLIBRARIES uninstall-nodist_glogincludeHEADERS \ + uninstall-pkgconfigDATA .MAKE: install-am install-strip @@ -1386,13 +1412,13 @@ uninstall-am: uninstall-dist_docDATA uninstall-glogincludeHEADERS \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man \ install-nodist_glogincludeHEADERS install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-dist_docDATA \ uninstall-glogincludeHEADERS uninstall-libLTLIBRARIES \ - uninstall-nodist_glogincludeHEADERS + uninstall-nodist_glogincludeHEADERS uninstall-pkgconfigDATA @ENABLE_FRAME_POINTERS_FALSE@@X86_64_TRUE@ # TODO(csilvers): check if -fomit-frame-pointer might be in $(CXXFLAGS), @ENABLE_FRAME_POINTERS_FALSE@@X86_64_TRUE@ # before setting this. diff --git a/configure b/configure index 10cd737..f780080 100755 --- a/configure +++ b/configure @@ -24630,6 +24630,8 @@ fi # Write generated configuration file ac_config_files="$ac_config_files Makefile src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h" +ac_config_files="$ac_config_files libglog.pc" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -25249,6 +25251,7 @@ do "src/glog/raw_logging.h") CONFIG_FILES="$CONFIG_FILES src/glog/raw_logging.h" ;; "src/glog/vlog_is_on.h") CONFIG_FILES="$CONFIG_FILES src/glog/vlog_is_on.h" ;; "src/glog/stl_logging.h") CONFIG_FILES="$CONFIG_FILES src/glog/stl_logging.h" ;; + "libglog.pc") CONFIG_FILES="$CONFIG_FILES libglog.pc" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} diff --git a/configure.ac b/configure.ac index 9cae651..9281743 100644 --- a/configure.ac +++ b/configure.ac @@ -230,4 +230,4 @@ AC_SUBST(GMOCK_LIBS) # Write generated configuration file AC_CONFIG_FILES([Makefile src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h]) -AC_OUTPUT +AC_OUTPUT(libglog.pc) diff --git a/libglog.pc.in b/libglog.pc.in new file mode 100644 index 0000000..ad2b077 --- /dev/null +++ b/libglog.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libglog +Description: Google Log (glog) C++ logging framework +Version: @VERSION@ +Libs: -L${libdir} -lglog +Cflags: -I${includedir} diff --git a/packages/deb/libgoogle-glog-dev.dirs b/packages/deb/libgoogle-glog-dev.dirs index d2a9fbc..bddfbf5 100644 --- a/packages/deb/libgoogle-glog-dev.dirs +++ b/packages/deb/libgoogle-glog-dev.dirs @@ -1,3 +1,4 @@ usr/lib +usr/lib/pkgconfig usr/include usr/include/glog diff --git a/packages/deb/libgoogle-glog-dev.install b/packages/deb/libgoogle-glog-dev.install index 8190546..9c61e86 100644 --- a/packages/deb/libgoogle-glog-dev.install +++ b/packages/deb/libgoogle-glog-dev.install @@ -2,7 +2,9 @@ usr/include/glog/* usr/lib/lib*.so usr/lib/lib*.a usr/lib/*.la +usr/lib/pkgconfig/* debian/tmp/usr/include/glog/* debian/tmp/usr/lib/lib*.so debian/tmp/usr/lib/lib*.a debian/tmp/usr/lib/*.la +debian/tmp/usr/lib/pkgconfig/* diff --git a/packages/rpm/rpm.spec b/packages/rpm/rpm.spec index b279982..c2edc83 100644 --- a/packages/rpm/rpm.spec +++ b/packages/rpm/rpm.spec @@ -69,3 +69,4 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/lib/libglog.a %{prefix}/lib/libglog.la %{prefix}/lib/libglog.so +%{prefix}/lib/pkgconfig/libglog.pc -- 2.7.4