If you happen to install the mingw-w64-x86_64-swig package on mingw64,
instead of just swig (the msys package), the swig lib is:
$ /mingw64/bin/swig -swiglib
C:\msys64\mingw64\bin\Lib
C:/msys64/mingw64/share/swig/4.1.1
rather than:
$ /usr/bin/swig -swiglib
/usr/share/swig/4.0.2
The two lines are printed with a \r\n between them, which is not handled
well by the current AX_PKG_SWIG macro. This results in this in
Makefiles:
SWIG_LIB = C:\msys64\mingw64\bin\Lib
C:/msys64/mingw64/share/swig/4.1.1
and these errors at the end of configure:
config.status:1764: $? = 2
config.status:1759: cd tests/param-validation && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
/tmp/GmbY8tiu:351: *** missing separator. Stop.
config.status:1764: $? = 2
config.status:1759: cd tests/plugins/src.ctf.fs/succeed && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
/tmp/Gmg5rHoG:346: *** missing separator. Stop.
config.status:1764: $? = 2
config.status:1759: cd tests/plugins/sink.ctf.fs/succeed && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
/tmp/GmxjJjqn:350: *** missing separator. Stop.
config.status:1764: $? = 2
config.status:1759: cd tests/plugins/flt.lttng-utils.debug-info && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
/tmp/GmA652OJ:370: *** missing separator. Stop.
config.status:1764: $? = 2
config.status:1759: cd tests/utils && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
/tmp/GmzIx4FT:388: *** missing separator. Stop.
config.status:1764: $? = 2
config.status:1759: cd tests/utils/tap && sed -e '/# am--include-marker/d' Makefile | make -f - am--depfiles
/tmp/GmtBtVgx:347: *** missing separator. Stop.
config.status:1764: $? = 2
config.status:1768: error: in `/c/cygwin64/home/Baube/src/babeltrace':
config.status:1770: error: Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE="gmake" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See `config.log' for more details
It was fixed here:
https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=
1168996c4cbf6d529d90f66bbf6b06e412bc4452
Import the latest version of the file as of today.
Change-Id: I19cdbdcca4fb3bd5a4ba3b54fbf3a29c2f4fc53f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/9583
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
# Copyright (c) 2008 Andrew Collier
# Copyright (c) 2011 Murray Cumming <murrayc@openismus.com>
+# Copyright (c) 2018 Reini Urban <rurban@cpan.org>
+# Copyright (c) 2021 Vincent Danjean <Vincent.Danjean@ens-lyon.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 13
+#serial 15
AC_DEFUN([AX_PKG_SWIG],[
# Find path to the "swig" executable.
AC_PATH_PROGS([SWIG],[swig swig3.0 swig2.0])
if test -z "$SWIG" ; then
m4_ifval([$3],[$3],[:])
- elif test -n "$1" ; then
+ elif test -z "$1" ; then
+ m4_ifval([$2],[$2],[:])
+ else
AC_MSG_CHECKING([SWIG version])
[swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
AC_MSG_RESULT([$swig_version])
if test -z "$required_major" ; then
[required_major=0]
fi
- [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+ [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`]
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_minor" ; then
[required_minor=0]
fi
- [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+ [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`]
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_patch" ; then
[required_patch=0]
m4_ifval([$3],[$3],[])
else
AC_MSG_CHECKING([for SWIG library])
- SWIG_LIB=`$SWIG -swiglib`
+ SWIG_LIB=`$SWIG -swiglib | tr '\r\n' ' '`
AC_MSG_RESULT([$SWIG_LIB])
m4_ifval([$2],[$2],[])
fi