Skip to content

Commit

Permalink
Move GAP kernel version to configure script
Browse files Browse the repository at this point in the history
This allow the version to be used in the ABI and allow it to be
more easily accessed by packages without parsing headers
  • Loading branch information
ChrisJefferson authored and fingolfin committed Sep 28, 2018
1 parent dbbe2b2 commit bd03ba1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ GC_SOURCES = @GC_SOURCES@
COMPAT_MODE = @COMPAT_MODE@
GAPARCH = @GAPARCH@

# GAP kernel version
GAP_KERNEL_MINOR_VERSION = @gap_kernel_minor_version@
GAP_KERNEL_MAJOR_VERSION = @gap_kernel_major_version@

# autoconf package metadata
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
Expand Down
3 changes: 3 additions & 0 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ sysinfo.gap: config.status $(srcdir)/Makefile.rules cnf/GAP-CFLAGS cnf/GAP-CPPFL
@echo "GAP_ABI=$(ABI)" >> $@
@echo "GAP_HPCGAP=$(HPCGAP)" >> $@
@echo "" >> $@
@echo "GAP_KERNEL_MAJOR_VERSION=$(GAP_KERNEL_MAJOR_VERSION)" >> $@
@echo "GAP_KERNEL_MINOR_VERSION=$(GAP_KERNEL_MINOR_VERSION)" >> $@
@echo "" >> $@
@echo "GAP_BIN_DIR=\"$(abs_builddir)\"" >> $@
@echo "GAP_LIB_DIR=\"$(abs_srcdir)\"" >> $@
@echo "" >> $@
Expand Down
16 changes: 14 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -541,13 +541,25 @@ AS_IF([test "x$with_gc" = xboehm],
]
)

dnl
dnl Define kernel version
dnl


gap_kernel_major_version=5
gap_kernel_minor_version=0
AC_SUBST([gap_kernel_major_version])
AC_SUBST([gap_kernel_minor_version])

AC_DEFINE_UNQUOTED([GAP_KERNEL_MAJOR_VERSION], $gap_kernel_major_version, [The major version of the kernel ABI])
AC_DEFINE_UNQUOTED([GAP_KERNEL_MINOR_VERSION], $gap_kernel_minor_version, [The minor version of the kernel ABI])

dnl
dnl User setting: Compatibility mode (on by default)
dnl
AS_IF([test "x$enable_hpcgap" = xyes],
[GAPARCH="$host-hpcgap${ABI}"],
[GAPARCH="$host-default${ABI}"])
[GAPARCH="$host-hpcgap${ABI}-kv${gap_kernel_major_version}"],
[GAPARCH="$host-default${ABI}-kv${gap_kernel_major_version}"])
AS_IF([test "x$ARCHEXT" != "x"],
[GAPARCH="$GAPARCH-$ARCHEXT"])
AS_IF([test "x$ARCH" != "x"],
Expand Down
5 changes: 3 additions & 2 deletions src/modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
**
*/

#define GAP_KERNEL_MAJOR_VERSION 5
#define GAP_KERNEL_MINOR_VERSION 0
// GAP_KERNEL_MAJOR_VERSION and GAP_KERNEL_MINOR_VERSION are defined in
// config.h

#define GAP_KERNEL_API_VERSION \
((GAP_KERNEL_MAJOR_VERSION)*1000 + (GAP_KERNEL_MINOR_VERSION))

Expand Down

0 comments on commit bd03ba1

Please sign in to comment.