Skip to content

Commit

Permalink
pkg-config support
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcook committed Dec 2, 2015
1 parent 157f988 commit acf2fea
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
12 changes: 9 additions & 3 deletions Makefile.in
Expand Up @@ -39,16 +39,17 @@ datarootdir=@datarootdir@
exec_prefix = @exec_prefix@
bindir = @bindir@
docdir = @docdir@
libdir = @libdir@

srcdir = @srcdir@
INSTALL = @INSTALL@

all : default @GETDNS_QUERY@
all : default @GETDNS_QUERY@

default:
cd src && $(MAKE) $@

install: all @INSTALL_GETDNS_QUERY@
install: all getdns.pc @INSTALL_GETDNS_QUERY@
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/AUTHORS $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/ChangeLog $(DESTDIR)$(docdir)
Expand All @@ -57,6 +58,8 @@ install: all @INSTALL_GETDNS_QUERY@
$(INSTALL) -m 644 $(srcdir)/LICENSE $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/NEWS $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/README.md $(DESTDIR)$(docdir)
$(INSTALL) -m 644 -d $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 644 getdns.pc $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)/spec
$(INSTALL) -m 644 $(srcdir)/spec/index.html $(DESTDIR)$(docdir)/spec
$(INSTALL) -m 644 $(srcdir)/spec/getdns*tgz $(DESTDIR)$(docdir)/spec || true
Expand Down Expand Up @@ -113,7 +116,7 @@ clean:
cd src && $(MAKE) $@
cd doc && $(MAKE) $@
cd spec/example && $(MAKE) $@
rm -f *.o
rm -f *.o *.pc

depend:
cd src && $(MAKE) $@
Expand Down Expand Up @@ -232,6 +235,9 @@ distcheck: $(distdir).tar.gz
rm -rf $(distdir)
@echo "*** Package $(distdir).tar.gz is ready for distribution"

getdns.pc: getdns.pc.in
./config.status $@

Makefile: $(srcdir)/Makefile.in config.status
./config.status $@

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -877,7 +877,7 @@ AC_SUBST(GETDNS_QUERY)
AC_SUBST(INSTALL_GETDNS_QUERY)
AC_SUBST(UNINSTALL_GETDNS_QUERY)

AC_CONFIG_FILES([Makefile src/Makefile src/version.c src/getdns/getdns.h src/getdns/getdns_extra.h spec/example/Makefile src/test/Makefile doc/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile src/version.c src/getdns/getdns.h src/getdns/getdns_extra.h spec/example/Makefile src/test/Makefile doc/Makefile getdns.pc])
if [ test -n "$DOXYGEN" ]
then AC_CONFIG_FILES([src/Doxyfile])
fi
Expand Down
11 changes: 11 additions & 0 deletions getdns.pc.in
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: getdns
Version: @GETDNS_VERSION@
Description: A modern asynchronous DNS library

Libs: -L${libdir} -lgetdns
Cflags: -I${includedir}

0 comments on commit acf2fea

Please sign in to comment.