From 841cc138ef9153d376d11d219450298dd80a60c7 Mon Sep 17 00:00:00 2001 From: "Barak A. Pearlmutter" Date: Thu, 22 May 2014 23:12:53 +0100 Subject: [PATCH] generate and install oping.pc file, for pkg-config oping --- .gitignore | 1 + configure.ac | 3 +++ src/Makefile.am | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/.gitignore b/.gitignore index e39f4fb..c8c5e41 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ src/mans/*.3 src/mans/*.8 src/oping src/noping +src/oping.pc *.bs *.la *.lo diff --git a/configure.ac b/configure.ac index ba73a31..e220822 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,9 @@ AC_ARG_VAR(PERL, [Perl interpreter command]) # configure libtool LT_INIT([dlopen]) +# pkg-config interface +PKG_INSTALLDIR + # Checks for header files. AC_HEADER_STDC AC_HEADER_TIME diff --git a/src/Makefile.am b/src/Makefile.am index 1326783..7278c68 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,6 +33,24 @@ if BUILD_WITH_LIBXNET liboping_la_LIBADD += -lxnet endif +oping.pc: + echo 'prefix=$(prefix)' > $@ + echo 'exec_prefix=$(exec_prefix)' >> $@ + echo 'includedir=$(includedir)' >> $@ + echo 'libdir=$(libdir)' >> $@ + echo >> $@ + echo 'Name: $(PACKAGE_TARNAME)' >> $@ + echo 'Description: $(PACKAGE_NAME)' >> $@ + echo 'URL: $(PACKAGE_URL)' >> $@ + echo 'Version: $(PACKAGE_VERSION)' >> $@ + echo 'Cflags: -I${includedir}' >> $@ + echo 'Libs: -L${libdir} -loping' >> $@ + echo 'Libs.private: $(AM_LDFLAGS) $(LIBS) $(liboping_la_LIBADD)' >> $@ + +pkgconfig_DATA = oping.pc + +MOSTLYCLEANFILES = $(pkgconfig_DATA) + bin_PROGRAMS = oping oping_SOURCES = oping.c -- 2.30.2