add pkg-config support

This commit is contained in:
Amir Taaki 2014-05-07 06:10:08 +00:00 committed by Cory Fields
parent 78fb796997
commit c7ee71f792
3 changed files with 20 additions and 1 deletions

View File

@ -32,6 +32,8 @@ noinst_HEADERS += src/field_gmp_impl.h
noinst_HEADERS += src/field.h noinst_HEADERS += src/field.h
noinst_HEADERS += src/field_impl.h noinst_HEADERS += src/field_impl.h
pkgconfig_DATA = libsecp256k1.pc
if USE_ASM if USE_ASM
libsecp256k1_la_SOURCES += src/field_5x52_asm.asm libsecp256k1_la_SOURCES += src/field_5x52_asm.asm
endif endif

View File

@ -15,6 +15,11 @@ AC_PROG_INSTALL
AC_PROG_SED AC_PROG_SED
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
[Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
AC_PROG_CC_C99 AC_PROG_CC_C99
if test x"$ac_cv_prog_cc_c99" == x"no"; then if test x"$ac_cv_prog_cc_c99" == x"no"; then
AC_MSG_ERROR([c99 compiler support required]) AC_MSG_ERROR([c99 compiler support required])
@ -284,7 +289,7 @@ AC_MSG_NOTICE([Using field implementation: $set_field])
AC_MSG_NOTICE([Using bignum implementation: $set_bignum]) AC_MSG_NOTICE([Using bignum implementation: $set_bignum])
AC_CONFIG_HEADERS([src/libsecp256k1-config.h]) AC_CONFIG_HEADERS([src/libsecp256k1-config.h])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile libsecp256k1.pc])
AC_SUBST(SECP_INCLUDES) AC_SUBST(SECP_INCLUDES)
AC_SUBST(SECP_LIBS) AC_SUBST(SECP_LIBS)
AC_SUBST(SECP_TEST_LIBS) AC_SUBST(SECP_TEST_LIBS)

12
libsecp256k1.pc.in Normal file
View File

@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libsecp256k1
Description: Optimized C library for EC operations on curve secp256k1
URL: https://github.com/bitcoin/secp256k1
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir}