Skip to content

Commit

Permalink
Generated belcard.pc
Browse files Browse the repository at this point in the history
  • Loading branch information
Viish committed Aug 10, 2016
1 parent ce1b7d6 commit 7f6f604
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
EXTRA_DIST=CMakeLists.txt cmake/BelcardConfig.cmake config.h.cmake include/CMakeLists.txt src/CMakeLists.txt tester/CMakeLists.txt tools/CMakeLists.txt
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = belcard.pc

EXTRA_DIST=CMakeLists.txt cmake/BelcardConfig.cmake config.h.cmake include/CMakeLists.txt src/CMakeLists.txt tester/CMakeLists.txt tools/CMakeLists.txt belcard.pc.in

SUBDIRS=include src tester tools
9 changes: 9 additions & 0 deletions belcard.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This is a comment
prefix=@CMAKE_INSTALL_PREFIX@

Name: @PROJECT_NAME@
Description: Belcard is Belledonne Communications' vCard 4 parsing library
Version: @PROJECT_VERSION@
Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lbelcard
Libs.private: @LIBS_PRIVATE@
Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@
44 changes: 41 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,31 @@

AC_PREREQ([2.69])
AC_INIT([belcard], [0.0.1], [sylvain.berfini@belledonne-communications.com])

BELCARD_SO_CURRENT=0 dnl increment this number when you add/change/remove an interface
BELCARD_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
BELCARD_SO_AGE=1 dnl increment this number when you add an interface, set to 0 if you remove an interface

BELCARD_SO_VERSION=$BELCARD_SO_CURRENT:$BELCARD_SO_REVISION:$BELCARD_SO_AGE

AC_SUBST(BELCARD_SO_CURRENT, $BELCARD_SO_CURRENT)
AC_SUBST(BELCARD_SO_VERSION)

AC_CONFIG_SRCDIR([src/])

AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE
AC_CANONICAL_SYSTEM

LT_INIT([shared disable-static])

dnl initialize pkg-config so that we can use it within if else fi statements.
PKG_PROG_PKG_CONFIG()

AM_INIT_AUTOMAKE(subdir-objects)
AM_SILENT_RULES(yes)
LT_INIT(disable-static win32-dll)

# Checks for programs.
AC_PROG_CXX
Expand Down Expand Up @@ -62,7 +81,7 @@ dnl # Check for Belr
dnl ##################################################

dnl check belr
PKG_CHECK_MODULES(BELR, [libbelr],[libbelr_found=yes],foo=bar)
PKG_CHECK_MODULES(BELR, [belr],[libbelr_found=yes],foo=bar)
if test "$libbelr_found" != "yes" ; then
dnl Check the lib presence in case the PKG-CONFIG version is not found
AC_LANG_CPLUSPLUS
Expand Down Expand Up @@ -120,6 +139,24 @@ AM_CONDITIONAL(BUILD_TESTS,test x$found_bcunit = xyes)
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SSIZE_T

dnl substitute variables used by .pc files
if test "$prefix" = "NONE" ; then
install_prefix=/usr
else
install_prefix=$prefix
fi

PROJECT_VERSION=$VERSION
CMAKE_INSTALL_PREFIX=$install_prefix
CMAKE_INSTALL_FULL_LIBDIR=${install_prefix}/lib
CMAKE_INSTALL_FULL_INCLUDEDIR=${install_prefix}/include

AC_SUBST(PROJECT_VERSION)
AC_SUBST(CMAKE_INSTALL_PREFIX)
AC_SUBST(CMAKE_INSTALL_FULL_LIBDIR)
AC_SUBST(CMAKE_INSTALL_FULL_INCLUDEDIR)
AC_SUBST(TESTER_REQUIRES_PRIVATE)

# Checks for library functions.
AC_CONFIG_FILES(
Makefile
Expand All @@ -129,6 +166,7 @@ tools/Makefile
include/Makefile
include/belcard/Makefile
cmake/BelcardConfig.cmake
belcard.pc
)

AC_OUTPUT

0 comments on commit 7f6f604

Please sign in to comment.