build: return to standard use of 'autoconf'
Following http://sourceforge.net/p/opensc/mailman/message/32009859/ * 'configure.ac' is not mored created by bootstrap script, but present in source * 'version.m4' is introduced and contains the 'volatile' package settings: settings that can be changed for the needs of particular build (ex. change PACKAGE_SUFFIX using the Git 'describe' or 'commit' data) * 'bootstrap' script facilitate change of the package setting during the 'autoconf' phase
This commit is contained in:
parent
5f45739ecb
commit
4bed397fbc
25
bootstrap
25
bootstrap
|
@ -9,7 +9,7 @@ OpenSC bootstrap
|
|||
OPTIONS:
|
||||
-h Show this message
|
||||
-s Package suffix
|
||||
-S Use package suffix as 'git' appended with the date of last commit
|
||||
-S Use package suffix as 'g' appended with the date of last commit
|
||||
-r Package version revision
|
||||
-R Use package version revision as Git commit number from 'git describe' result
|
||||
-b Package branch
|
||||
|
@ -32,7 +32,7 @@ do
|
|||
SUFFIX=$OPTARG
|
||||
;;
|
||||
S)
|
||||
SUFFIX=git`git log -1 --pretty=fuller --date=iso | grep CommitDate: | sed -E 's/^CommitDate:\s(.*)/\1/' | sed -E 's/(.*)-(.*)-(.*) (.*):(.*):(.*)\s+.*/\1\2\3\4\5\6/'`
|
||||
SUFFIX=g`git log -1 --pretty=fuller --date=iso | grep CommitDate: | sed -E 's/^CommitDate:\s(.*)/\1/' | sed -E 's/(.*)-(.*)-(.*) (.*):(.*):(.*)\s+.*/\1\2\3\4\5\6/'`
|
||||
;;
|
||||
r)
|
||||
REVISION=$OPTARG
|
||||
|
@ -47,34 +47,33 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
if [ ! -f configure.ac ]; then
|
||||
cp configure.ac.in configure.ac
|
||||
fi
|
||||
|
||||
set -e
|
||||
set -x
|
||||
if [ -f Makefile ]; then
|
||||
make distclean
|
||||
fi
|
||||
rm -rf *~ *.cache *.m4 config.guess config.log config.status config.sub depcomp ltmain.sh configure.ac
|
||||
rm -rf *~ *.cache config.guess config.log config.status config.sub depcomp ltmain.sh
|
||||
|
||||
cp configure.ac.in configure.ac
|
||||
|
||||
if [ -n "$SUFFIX" ] || [ -n "$REVISION" ]
|
||||
then
|
||||
cp version.m4 version.m4.orig
|
||||
|
||||
if [ -n "$SUFFIX" ]
|
||||
then
|
||||
echo Set package suffix "$SUFFIX"
|
||||
sed 's/^define(\[PACKAGE_SUFFIX\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_SUFFIX\], \['$SUFFIX'\])/g' configure.ac > configure.ac.next
|
||||
mv configure.ac.next configure.ac
|
||||
sed 's/^define(\[PACKAGE_SUFFIX\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_SUFFIX\], \['$SUFFIX'\])/g' version.m4.orig > version.m4
|
||||
fi
|
||||
|
||||
if [ -n "$REVISION" ]
|
||||
then
|
||||
echo Set package revision "$REVISION"
|
||||
sed 's/^define(\[PACKAGE_VERSION_REVISION\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_VERSION_REVISION\], \['$REVISION'\])/g' configure.ac > configure.ac.next
|
||||
mv configure.ac.next configure.ac
|
||||
sed 's/^define(\[PACKAGE_VERSION_REVISION\],\s*\[\([-~]*[0-9a-zA-Z]*\)\])$/define(\[PACKAGE_VERSION_REVISION\], \['$REVISION'\])/g' version.m4.orig > version.m4
|
||||
fi
|
||||
fi
|
||||
|
||||
autoreconf --verbose --install --force
|
||||
autoreconf --verbose --install --force || true
|
||||
|
||||
if [ -f version.m4.orig ]; then
|
||||
mv version.m4.orig version.m4
|
||||
fi
|
||||
|
|
|
@ -2,13 +2,23 @@ dnl -*- mode: m4; -*-
|
|||
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
define([PRODUCT_NAME], [OpenSC])
|
||||
define([PRODUCT_TARNAME], [opensc])
|
||||
define([PRODUCT_BUGREPORT], [opensc-devel@lists.sourceforge.net])
|
||||
define([PACKAGE_VERSION_MAJOR], [0])
|
||||
define([PACKAGE_VERSION_MINOR], [13])
|
||||
define([PACKAGE_VERSION_FIX], [0])
|
||||
define([PACKAGE_SUFFIX], [])
|
||||
define([PACKAGE_VERSION_REVISION], [0])
|
||||
|
||||
AC_INIT([opensc],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX])
|
||||
define([VS_FF_LEGAL_COPYRIGHT], [OpenSC Project])
|
||||
define([VS_FF_LEGAL_COMPANY_NAME], [OpenSC Project])
|
||||
define([VS_FF_COMMENTS], [Provided under the terms of the GNU Lesser General Public License (LGPLv2.1+).])
|
||||
define([VS_FF_PRODUCT_NAME], [OpenSC smartcard framework])
|
||||
|
||||
m4_include(version.m4)
|
||||
|
||||
AC_INIT([PRODUCT_NAME],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX],[PRODUCT_BUGREPORT],[PRODUCT_TARNAME])
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
@ -19,10 +29,10 @@ OPENSC_VERSION_MINOR="PACKAGE_VERSION_MINOR"
|
|||
OPENSC_VERSION_FIX="PACKAGE_VERSION_FIX"
|
||||
OPENSC_VERSION_REVISION="PACKAGE_VERSION_REVISION"
|
||||
|
||||
OPENSC_VS_FF_LEGAL_COPYRIGHT="OpenSC Project"
|
||||
OPENSC_VS_FF_COMPANY_NAME="OpenSC Project"
|
||||
OPENSC_VS_FF_COMMENTS="Provided under the terms of the GNU Lesser General Public License (LGPLv2.1+)."
|
||||
OPENSC_VS_FF_PRODUCT_NAME="OpenSC smartcard framework"
|
||||
OPENSC_VS_FF_LEGAL_COPYRIGHT="VS_FF_LEGAL_COPYRIGHT"
|
||||
OPENSC_VS_FF_COMPANY_NAME="VS_FF_LEGAL_COMPANY_NAME"
|
||||
OPENSC_VS_FF_COMMENTS="VS_FF_COMMENTS"
|
||||
OPENSC_VS_FF_PRODUCT_NAME="VS_FF_PRODUCT_NAME"
|
||||
|
||||
# LT Version numbers, remember to change them just *before* a release.
|
||||
# (Code changed: REVISION++)
|
||||
|
@ -215,7 +225,7 @@ done
|
|||
if test "${reader_count}" != "x"; then
|
||||
AC_MSG_ERROR([Only one of --enable-pcsc, --enable-openct, --enable-ctapi can be specified!])
|
||||
fi
|
||||
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
|
@ -261,6 +271,15 @@ elif test "${xslstylesheetsdir}" != "no"; then
|
|||
fi
|
||||
AC_MSG_RESULT([${xslstylesheetsdir}])
|
||||
|
||||
AC_MSG_CHECKING([git checkout])
|
||||
GIT_CHECKOUT="no"
|
||||
if test -n "${GIT}" -a -d "${srcdir}/.git"; then
|
||||
AC_DEFINE([HAVE_CONFIG_VERSION_H], [1], [extra version available in config-version.h])
|
||||
GIT_CHECKOUT="yes"
|
||||
fi
|
||||
AC_MSG_RESULT([${GIT_CHECKOUT}])
|
||||
|
||||
|
||||
dnl C Compiler features
|
||||
AC_C_INLINE
|
||||
|
||||
|
@ -638,6 +657,7 @@ AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"])
|
|||
AM_CONDITIONAL([ENABLE_MINIDRIVER], [test "${enable_minidriver}" = "yes"])
|
||||
AM_CONDITIONAL([ENABLE_SM], [test "${enable_sm}" = "yes"])
|
||||
AM_CONDITIONAL([ENABLE_DNIE_UI], [test "${enable_dnie_ui}" = "yes"])
|
||||
AM_CONDITIONAL([GIT_CHECKOUT], [test "${GIT_CHECKOUT}" = "yes"])
|
||||
|
||||
if test "${enable_pedantic}" = "yes"; then
|
||||
enable_strict="yes";
|
||||
|
@ -698,6 +718,11 @@ Version: ${PACKAGE_VERSION}
|
|||
Version fix: ${OPENSC_VERSION_FIX}
|
||||
Version revision: ${OPENSC_VERSION_REVISION}
|
||||
|
||||
Copyright: ${OPENSC_VS_FF_LEGAL_COPYRIGHT}
|
||||
Company: ${OPENSC_VS_FF_COMPANY_NAME}
|
||||
Comments: ${OPENSC_VS_FF_COMMENTS}
|
||||
Product name: ${OPENSC_VS_FF_PRODUCT_NAME}
|
||||
|
||||
User binaries: $(eval eval eval echo "${bindir}")
|
||||
Configuration files: $(eval eval eval echo "${sysconfdir}")
|
||||
XSL stylesheets: ${xslstylesheetsdir}
|
|
@ -0,0 +1,11 @@
|
|||
dnl define the OpenVPN version
|
||||
define([PRODUCT_NAME], [OpenSC])
|
||||
define([PRODUCT_TARNAME], [opensc])
|
||||
define([PRODUCT_BUGREPORT], [opensc-devel@lists.sourceforge.net])
|
||||
define([PACKAGE_SUFFIX], [])
|
||||
|
||||
define([VS_FF_LEGAL_COPYRIGHT], [OpenSC Project])
|
||||
define([VS_FF_LEGAL_COMPANY_NAME], [OpenSC Project])
|
||||
define([VS_FF_COMMENTS], [Provided under the terms of the GNU Lesser General Public License (LGPLv2.1+).])
|
||||
define([VS_FF_PRODUCT_NAME], [OpenSC smartcard framework])
|
||||
|
Loading…
Reference in New Issue