Skip to content

Commit

Permalink
build: Use decimal notation for the version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaible committed Jun 24, 2017
1 parent efa79ba commit b5f07ea
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 25 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2017-06-24 Bruno Haible <[email protected]>

build: Use decimal notation for the version number.
* VERSION: Set to 1.13.
* configure.ac: Simplify AC_CONFIG_HEADERS invocations. Define
LIBFFCALL_VERSION as C macro, based on PACKAGE_VERSION.
* avcall/avcall.h.in (LIBFFCALL_VERSION): Use a plain #define, for
substitution by config.status.
* vacall/vacall.h.in: Likewise.
* trampoline/trampoline.h.in: Likewise.
* callback/callback.h.in: Likewise.
* callback/vacall_r/vacall_r.h.in: Likewise.
* callback/trampoline_r/trampoline_r.h.in: Likewise.

2017-06-24 Bruno Haible <[email protected]>

trampoline, callback: Make multithread-safe.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0x010D
1.13
3 changes: 2 additions & 1 deletion avcall/avcall.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
----------------------------------------------------------------------*/

#if !defined(LIBFFCALL_VERSION)
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
/* Version number of libffcall: (major<<8) + minor. */
# define LIBFFCALL_VERSION 0
#endif

/* These definitions are adjusted by ‘configure’ automatically. */
Expand Down
3 changes: 2 additions & 1 deletion callback/callback.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/

#if !defined(LIBFFCALL_VERSION)
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
/* Version number of libffcall: (major<<8) + minor. */
# define LIBFFCALL_VERSION 0
#endif

#include "vacall_r.h"
Expand Down
3 changes: 2 additions & 1 deletion callback/trampoline_r/trampoline_r.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/

#if !defined(LIBFFCALL_VERSION)
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
/* Version number of libffcall: (major<<8) + minor. */
# define LIBFFCALL_VERSION 0
#endif

#ifdef __cplusplus
Expand Down
3 changes: 2 additions & 1 deletion callback/vacall_r/vacall_r.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/

#if !defined(LIBFFCALL_VERSION)
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
/* Version number of libffcall: (major<<8) + minor. */
# define LIBFFCALL_VERSION 0
#endif

/* These definitions are adjusted by ‘configure’ automatically. */
Expand Down
42 changes: 24 additions & 18 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,12 @@ AM_INIT_AUTOMAKE([])
AC_CONFIG_SRCDIR([trampoline/trampoline.h.in])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([avcall/avcall.h],
[sed "s/@LIBFFCALL_VERSION@/${LIBFFCALL_VERSION}/" avcall/avcall.h > tmp && mv -f tmp avcall/avcall.h],
[LIBFFCALL_VERSION=$PACKAGE_VERSION])
AC_CONFIG_HEADERS([vacall/vacall.h],
[sed "s/@LIBFFCALL_VERSION@/${LIBFFCALL_VERSION}/" vacall/vacall.h > tmp && mv -f tmp vacall/vacall.h],
[LIBFFCALL_VERSION=$PACKAGE_VERSION])
AC_CONFIG_HEADERS([trampoline/trampoline.h],
[sed "s/@LIBFFCALL_VERSION@/${LIBFFCALL_VERSION}/" trampoline/trampoline.h > tmp && mv -f tmp trampoline/trampoline.h],
[LIBFFCALL_VERSION=$PACKAGE_VERSION])
AC_CONFIG_HEADERS([callback/callback.h],
[sed "s/@LIBFFCALL_VERSION@/${LIBFFCALL_VERSION}/" callback/callback.h > tmp && mv -f tmp callback/callback.h],
[LIBFFCALL_VERSION=$PACKAGE_VERSION])
AC_CONFIG_HEADERS([callback/vacall_r/vacall_r.h],
[sed "s/@LIBFFCALL_VERSION@/${LIBFFCALL_VERSION}/" callback/vacall_r/vacall_r.h > tmp && mv -f tmp callback/vacall_r/vacall_r.h],
[LIBFFCALL_VERSION=$PACKAGE_VERSION])
AC_CONFIG_HEADERS([callback/trampoline_r/trampoline_r.h],
[sed "s/@LIBFFCALL_VERSION@/${LIBFFCALL_VERSION}/" callback/trampoline_r/trampoline_r.h > tmp && mv -f tmp callback/trampoline_r/trampoline_r.h],
[LIBFFCALL_VERSION=$PACKAGE_VERSION])
AC_CONFIG_HEADERS([avcall/avcall.h])
AC_CONFIG_HEADERS([vacall/vacall.h])
AC_CONFIG_HEADERS([trampoline/trampoline.h])
AC_CONFIG_HEADERS([callback/callback.h])
AC_CONFIG_HEADERS([callback/vacall_r/vacall_r.h])
AC_CONFIG_HEADERS([callback/trampoline_r/trampoline_r.h])

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([gnulib-lib/Makefile])
Expand All @@ -51,6 +39,24 @@ AC_CONFIG_FILES([callback/Makefile])
AC_CONFIG_FILES([callback/vacall_r/Makefile])
AC_CONFIG_FILES([callback/trampoline_r/Makefile])

dnl Substitutable version number.
changequote(,)
sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
i\
0
q
'
sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
i\
0
q
'
changequote([,])
version_major=`echo "${PACKAGE_VERSION}" | sed -n -e "$sed_extract_major"`
version_minor=`echo "${PACKAGE_VERSION}" | sed -n -e "$sed_extract_minor"`
HEXVERSION=`printf '0x%02X%02X' $version_major $version_minor`
AC_DEFINE_UNQUOTED([LIBFFCALL_VERSION], [$HEXVERSION], [Version number: (major<<8) + minor])

AC_PROG_MAKE_SET

AC_PROG_CC
Expand Down
3 changes: 2 additions & 1 deletion trampoline/trampoline.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/

#if !defined(LIBFFCALL_VERSION)
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
/* Version number of libffcall: (major<<8) + minor. */
# define LIBFFCALL_VERSION 0
#endif

#ifdef __cplusplus
Expand Down
3 changes: 2 additions & 1 deletion vacall/vacall.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/

#if !defined(LIBFFCALL_VERSION)
# define LIBFFCALL_VERSION @LIBFFCALL_VERSION@
/* Version number of libffcall: (major<<8) + minor. */
# define LIBFFCALL_VERSION 0
#endif

/* These definitions are adjusted by ‘configure’ automatically. */
Expand Down

0 comments on commit b5f07ea

Please sign in to comment.