[build] Adding pkg-config support
This commit is contained in:
@@ -1 +1,4 @@
|
||||
SUBDIRS = src test
|
||||
SUBDIRS = src test
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libpostal.pc
|
||||
|
||||
18
README.md
18
README.md
@@ -201,12 +201,12 @@ Before you install, make sure you have the following prerequisites:
|
||||
|
||||
**On Linux (Debian)**
|
||||
```
|
||||
sudo apt-get install libsnappy-dev autoconf automake libtool
|
||||
sudo apt-get install libsnappy-dev autoconf automake libtool pkg-config
|
||||
```
|
||||
|
||||
**On Mac OSX**
|
||||
```
|
||||
sudo brew install snappy autoconf automake libtool
|
||||
sudo brew install snappy autoconf automake libtool pkg-config
|
||||
```
|
||||
|
||||
Then to install the C library:
|
||||
@@ -223,6 +223,20 @@ sudo make install
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
libpostal has support for pkg-config, so you can use the pkg-config to print the flags needed to link your program against it:
|
||||
|
||||
```
|
||||
pkg-config --cflags libpostal # print compiler flags
|
||||
pkg-config --libs libpostal # print linker flags
|
||||
pkg-config --cflags --libs libpostal # print both
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
gcc app.c `pkg-config --cflags --libs libpostal`
|
||||
```
|
||||
|
||||
Bindings
|
||||
--------
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS([getcwd gettimeofday memmove memset munmap regcomp setlocale sqrt strdup strndup])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
libpostal.pc
|
||||
src/Makefile
|
||||
src/sparkey/Makefile
|
||||
test/Makefile])
|
||||
|
||||
11
libpostal.pc.in
Normal file
11
libpostal.pc.in
Normal file
@@ -0,0 +1,11 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libpostal
|
||||
Description: Fast international street address parsing and normalization using statistical NLP.
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: -L${libdir} -lpostal
|
||||
Libs.private: @LIBS@
|
||||
Cflags: -I${includedir}
|
||||
Reference in New Issue
Block a user