operating system
CentOS 6 with gcc 4.9.2.
curl/libcurl version
upstream (commit 94ced8e)
I did this
-
Add this line between 64-65 and 275-276 in configure.ac:
echo "Compiler info: $compiler_id, $compiler_num\n"
-
./buildconf && ./configure --enable-werror
I expected the following
Some compiler id and version number (492) in output
I got
Empty $compiler_id, $compiler_num at first echo
And wierd $compiler_num (= 409) at second
Problems and possible solutions:
- Condition in configure.ac:68:
if test "$compiler_num" -ge "500"; then
is always false, because compiler_num and compiler_id will defined only after CURL_CHECK_COMPILER macro.
As solution: put code about CURL_CFLAG_EXTRAS after CURL_CHECK_COMPILER.
- Code in m4/curl-compilers.m4:165-167 determine gcc version wierd. In my view it must be like:
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4
index c64db4bc6..9eb68f698 100644
--- a/m4/curl-compilers.m4
+++ b/m4/curl-compilers.m4
@@ -164,8 +164,9 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [
compiler_id="GNU_C"
gccver=`$CC -dumpversion`
gccvhi=`echo $gccver | cut -d . -f1`
- gccvlo=`echo $gccver | cut -d . -f2`
- compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
+ gccvme=`echo $gccver | cut -d . -f2`
+ gccvlo=`echo $gccver | cut -d . -f3`
+ compiler_num=`(expr $gccvhi "*" 100 + $gccvme "*" 10 + $gccvlo) 2>/dev/null`
flags_dbg_all="-g -g0 -g1 -g2 -g3"
flags_dbg_all="$flags_dbg_all -ggdb"
flags_dbg_all="$flags_dbg_all -gstabs"
operating system
CentOS 6 with gcc 4.9.2.
curl/libcurl version
upstream (commit 94ced8e)
I did this
Add this line between 64-65 and 275-276 in configure.ac:
echo "Compiler info: $compiler_id, $compiler_num\n"./buildconf && ./configure --enable-werror
I expected the following
Some compiler id and version number (492) in output
I got
Empty $compiler_id, $compiler_num at first echo
And wierd $compiler_num (= 409) at second
Problems and possible solutions:
if test "$compiler_num" -ge "500"; thenis always false, because compiler_num and compiler_id will defined only after CURL_CHECK_COMPILER macro.
As solution: put code about CURL_CFLAG_EXTRAS after CURL_CHECK_COMPILER.