configure: fix schver.h parsing

Related to #2890
This commit is contained in:
Matthew Flatt 2019-11-10 16:42:03 -06:00
parent 5eb04dfa9e
commit 19411c0dec
2 changed files with 28 additions and 2 deletions

View File

@ -6874,7 +6874,20 @@ if test "${enable_shared}" = "yes" ; then
if test "$INCLUDEDEP" = "-include" ; then
plt_lib_version="\$(FWVERSION)"
else
plt_lib_version=`grep " MZSCHEME_VERSION " ${srcdir}/racket/src/schvers.h | cut -d '"' -f 2`
VERSION_X=`grep 'define MZSCHEME_VERSION_X ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
VERSION_Y=`grep 'define MZSCHEME_VERSION_Y ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
VERSION_Z=`grep 'define MZSCHEME_VERSION_Z ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
VERSION_W=`grep 'define MZSCHEME_VERSION_W ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
if test "${VERSION_W}" != "0" ; then
plt_lib_version="${VERSION_X}.${VERSION_Y}.${VERSION_Z}.${VERSION_W}"
else
if test "${VERSION_Z}" != "0" ; then
plt_lib_version="${VERSION_X}.${VERSION_Y}.${VERSION_Z}"
else
plt_lib_version="${VERSION_X}.${VERSION_Y}"
fi
fi
fi
AR="${LIBTOOLPROG} --mode=link --tag=CC $CC${need_gcc_static_libgcc}${ar_libtool_no_undefined} -release ${plt_lib_version} -rpath ${abslibdir} \$(ARLIBFLAGS) -o"

View File

@ -1383,7 +1383,20 @@ if test "${enable_shared}" = "yes" ; then
if test "$INCLUDEDEP" = "-include" ; then
plt_lib_version="\$(FWVERSION)"
else
plt_lib_version=`grep " MZSCHEME_VERSION " ${srcdir}/racket/src/schvers.h | cut -d '"' -f 2`
VERSION_X=`grep 'define MZSCHEME_VERSION_X ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
VERSION_Y=`grep 'define MZSCHEME_VERSION_Y ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
VERSION_Z=`grep 'define MZSCHEME_VERSION_Z ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
VERSION_W=`grep 'define MZSCHEME_VERSION_W ' ${srcdir}/racket/src/schvers.h | cut -d ' ' -f 3`
if test "${VERSION_W}" != "0" ; then
plt_lib_version="${VERSION_X}.${VERSION_Y}.${VERSION_Z}.${VERSION_W}"
else
if test "${VERSION_Z}" != "0" ; then
plt_lib_version="${VERSION_X}.${VERSION_Y}.${VERSION_Z}"
else
plt_lib_version="${VERSION_X}.${VERSION_Y}"
fi
fi
fi
AR="${LIBTOOLPROG} --mode=link --tag=CC $CC${need_gcc_static_libgcc}${ar_libtool_no_undefined} -release ${plt_lib_version} -rpath ${abslibdir} \$(ARLIBFLAGS) -o"