From 1d82d1d86a4a1fd9d4f2754688e7f8e0ca36c294 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Mon, 23 Jun 2008 14:09:38 +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++/src/Makefile.am | 4 ++-- contrib/ldapc++/version.sh | 10 ++++++++++ contrib/ldapc++/version.var | 13 +++++++++++++ 5 files changed, 35 insertions(+), 6 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++/src/Makefile.am b/contrib/ldapc++/src/Makefile.am index dcc242f3f0..6586d1ef9b 100644 --- a/contrib/ldapc++/src/Makefile.am +++ b/contrib/ldapc++/src/Makefile.am @@ -1,7 +1,7 @@ # $OpenLDAP$ ### -# Copyright 2000, OpenLDAP Foundation, All Rights Reserved. +# Copyright 2000-2008, OpenLDAP Foundation, All Rights Reserved. # COPYING RESTRICTIONS APPLY, see COPYRIGHT file ## @@ -95,5 +95,5 @@ noinst_HEADERS = LDAPAddRequest.h \ LDAPSearchRequest.h libldapcpp_la_LIBADD = -lldap -llber -libldapcpp_la_LDFLAGS = -version-info 0:5:0 +libldapcpp_la_LDFLAGS = -version-info @OPENLDAP_CPP_API_VERSION@ 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