From 458d5141819df3fb4e24378338dc6893f040af83 Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Wed, 9 Jul 2008 23:59:44 +0000 Subject: [PATCH] Define library version/release in version.var to avoid regenerating Makefile.in with every release. (works similar to OpenLDAP's main version.sh/version.var) --- contrib/ldapc++/Makefile.am | 1 - contrib/ldapc++/configure.in | 13 ++++++++++--- contrib/ldapc++/version.sh | 10 ++++++++++ contrib/ldapc++/version.var | 13 +++++++++++++ 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100755 contrib/ldapc++/version.sh create mode 100644 contrib/ldapc++/version.var diff --git a/contrib/ldapc++/Makefile.am b/contrib/ldapc++/Makefile.am index 7a1bc26eed..db530e7b82 100644 --- a/contrib/ldapc++/Makefile.am +++ b/contrib/ldapc++/Makefile.am @@ -5,6 +5,5 @@ # COPYING RESTRICTIONS APPLY, see COPYRIGHT file ## -EXTRA_DIST = BUGS SUBDIRS = src examples diff --git a/contrib/ldapc++/configure.in b/contrib/ldapc++/configure.in index 57c030dc99..6f149b6cdc 100644 --- a/contrib/ldapc++/configure.in +++ b/contrib/ldapc++/configure.in @@ -13,6 +13,15 @@ AC_CONFIG_SRCDIR(src/LDAPConnection.h) AM_INIT_AUTOMAKE(foreign) AM_CONFIG_HEADER(src/config.h) +eval `$ac_aux_dir/version.sh` +if test -z "$OL_CPP_API_RELEASE"; then + AC_MSG_ERROR([could not determine version]) +fi + +VERSION=$OL_CPP_API_RELEASE +OPENLDAP_CPP_API_VERSION=$OL_CPP_API_VERSION +AC_SUBST(VERSION) +AC_SUBST(OPENLDAP_CPP_API_VERSION) dnl Checks for programs. AC_PROG_INSTALL dnl AC_PROG_CC @@ -24,9 +33,7 @@ dnl AC_PROG_MAKE_SET AC_ARG_ENABLE(debug,[ --enable-debug],[ CXXFLAGS="-g -O0 -Wall" AC_DEFINE(WITH_DEBUG,[],[Define to 1 ot enable debug logging]) - ],[ - CXXFLAGS="-O0" - ] + ], ) AC_ARG_WITH(libldap,[ --with-libldap=DIR Path to the libldap library [/usr/local/lib]],[ diff --git a/contrib/ldapc++/version.sh b/contrib/ldapc++/version.sh new file mode 100755 index 0000000000..7a5e4c3622 --- /dev/null +++ b/contrib/ldapc++/version.sh @@ -0,0 +1,10 @@ +#! /bin/sh +# $OpenLDAP$ +# +# Copyright 2008, OpenLDAP Foundation, All Rights Reserved. +# COPYING RESTRICTIONS APPLY, see COPYRIGHT file +DIR=`dirname $0` +. $DIR/version.var + +echo OL_CPP_API_VERSION=$ol_cpp_api_current:$ol_cpp_api_revision:$ol_cpp_api_age +echo OL_CPP_API_RELEASE=$ol_cpp_api_rel_major.$ol_cpp_api_rel_minor.$ol_cpp_api_rel_patch diff --git a/contrib/ldapc++/version.var b/contrib/ldapc++/version.var new file mode 100644 index 0000000000..a03fa4da7f --- /dev/null +++ b/contrib/ldapc++/version.var @@ -0,0 +1,13 @@ +#! /bin/sh +# $OpenLDAP$ +# +# Copyright 2008, OpenLDAP Foundation, All Rights Reserved. +# COPYING RESTRICTIONS APPLY, see COPYRIGHT file + +ol_cpp_api_rel_major=0 +ol_cpp_api_rel_minor=0 +ol_cpp_api_rel_patch=0 + +ol_cpp_api_current=0 +ol_cpp_api_revision=0 +ol_cpp_api_age=0 -- 2.39.5