generate and install oping.pc file, for pkg-config oping
authorBarak A. Pearlmutter <barak+git@cs.nuim.ie>
Thu, 22 May 2014 22:12:53 +0000 (23:12 +0100)
committerBarak A. Pearlmutter <barak+git@cs.nuim.ie>
Thu, 22 May 2014 22:15:16 +0000 (23:15 +0100)
.gitignore
configure.ac
src/Makefile.am

index e39f4fb..c8c5e41 100644 (file)
@@ -28,6 +28,7 @@ src/mans/*.3
 src/mans/*.8
 src/oping
 src/noping
+src/oping.pc
 *.bs
 *.la
 *.lo
index ba73a31..e220822 100644 (file)
@@ -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
index 1326783..7278c68 100644 (file)
@@ -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