Commit d7fbfe15 by Steve Frécinaux Committed by Shawn O. Pearce

Add pkg-config support.

The libgit2.pc is generated on make install and installed, to allow
using the lib through the pkg-config helper.

Signed-off-by: Steve Frécinaux <code@istique.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
parent 5ddbd5ed
/apidocs
/trash-*.exe
/libgit2.pc
*.o
*.a
*.exe
......@@ -46,16 +46,19 @@ install-headers: $(PUBLIC_HEADERS)
@mkdir -p /tmp/gitinc/git
@for i in $^; do cat .HEADER $$i > /tmp/gitinc/$${i##src/}; done
install: $(GIT_LIB) $(PUBLIC_HEADERS)
install: $(GIT_LIB) $(PUBLIC_HEADERS) libgit2.pc
@mkdir -p $(prefix)/include/git
@for i in $(PUBLIC_HEADERS); do \
cat .HEADER $$i > $(prefix)/include/$${i##src/}; \
done
@mkdir -p $(prefix)/lib
@cp -f $(GIT_LIB) $(prefix)/lib/libgit2.a
@mkdir -p $(prefix)/lib/pkgconfig
@cp -f libgit2.pc $(prefix)/lib/pkgconfig/libgit2.pc
uninstall:
@rm -f $(prefix)/lib/libgit2.a
@rm -f $(prefix)/lib/pkgconfig/libgit2.pc
@for i in $(PUBLIC_HEADERS); do \
rm -f $(prefix)/include/$${i##src/}; \
done
......@@ -105,6 +108,9 @@ $(TEST_RUN): tests/%.run: tests/%.exe
else rmdir $$t; exit 1; \
fi
libgit2.pc: libgit2.pc.in
sed 's#@prefix@#$(prefix)#' $< > $@
.PHONY: all
.PHONY: clean
.PHONY: test $(TEST_RUN)
......
prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: libgit2
Description: The git library, take 2
Version: 0.0.1
Requires:
Libs: -L${libdir} -lgit2
Cflags: -I${includedir}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment