Ok, I did the modifications suggested and the results were not very exciting: There is nothing wrong with the c code.
However ,there is a caveat. This is the c code of my own own test.c, not the one used by configure. So there is chance the cause is in the small differences between my test.c and the conftest.c. This seems unlikely, as the values printed in it or before, indicates that the values are correct and as expected. Still, would be nice if I could figure out a way print the values of conftest.c on the screen during configure's execution.
Another possibility is that the limitations of my system of running 32bit c or c++ programs are causing it. (this is a cross compilation attempt) However, these issues also showed up when trying to run configure to build a 64bit zsnes. So I discarded that for now.
All that added together leads to two possibilities:
1)Problem is happening in the shell script code that precedes the conftest.c code
2)Problem is happening in the shell script code that follows the conftest.c code.
As I already added a lot of checking statements in the preceding code (such as
echo "printing variable a: $vara"
and the values showed by them makes sense, the chances are greater that the problem lies in the following code. I still did not check the final part of the previous code, though.
As the following code is more difficult to understand than in the preceding code, I still did not make any substantial testing on it. As soon as I find more spare time, I will try to test it.
In the case anyone has interest, I pasted the full configure test below. Note my "ECHOs" after the CFLAGS line. To answer about the error messages, here is the output of configure related to zlib (from ZLIB:
1 2 3 4 5 6 7 8 9
|
checking for zlib - version >= 1.2.3... ZLIB_CFLAGS: -I/media/34GB/Arquivos-de-Programas-Linux-32bit/Zlib-1.2.4/
ZLIB_LIBS: -L/media/34GB/Arquivos-de-Programas-Linux-32bit/Zlib-1.2.4/ -lz
ZLIB_VERSION:
min_zlib_version: 1.2.3
LIBS: -L/media/34GB/Arquivos-de-Programas-Linux-32bit/Zlib-1.2.4/ -lz
CFLAGS: -m32 -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__ -I/media/34GB/Arquivos-de-Programas-Linux-32bit/Zlib-1.2.4/
cross-compiling
configure: WARNING: Assuming zlib is available
configure: error: zlib >= 1.2.3 is required
| |
Note that there is nothing after
ZLIB_VERSION:
. That is because the value is pulled from zlib.h. Values printed during the executing of my test.c shows it is correct.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
if test "${with_zlib_prefix+set}" = set; then
withval=$with_zlib_prefix; zlib_prefix="$withval"
else
zlib_prefix=""
fi
min_zlib_version=1.2.3
{ echo "$as_me:$LINENO: checking for zlib - version >= $min_zlib_version" >&5
echo $ECHO_N "checking for zlib - version >= $min_zlib_version... $ECHO_C" >&6; }
tempLIBS="$LIBS"
tempCFLAGS="$CFLAGS"
if test x$zlib_prefix != x ; then
ZLIB_LIBS="-L$zlib_prefix"
ZLIB_CFLAGS="-I$zlib_prefix"
fi
ZLIB_LIBS="$ZLIB_LIBS -lz"
LIBS="$LIBS $ZLIB_LIBS"
CFLAGS="$CFLAGS $ZLIB_CFLAGS"
echo "ZLIB_CFLAGS: $ZLIB_CFLAGS"
echo "ZLIB_LIBS: $ZLIB_LIBS"
echo "ZLIB_VERSION: $ZLIB_VERSION"
echo "min_zlib_version: $min_zlib_version"
echo "LIBS: $LIBS"
echo "CFLAGS: $CFLAGS"
if test "$cross_compiling" = yes; then
{ echo "$as_me:$LINENO: result: cross-compiling" >&5
echo "${ECHO_T}cross-compiling" >&6; }
with_zlib=""
{ echo "$as_me:$LINENO: WARNING: Assuming zlib is available" >&5
echo "$as_me: WARNING: Assuming zlib is available" >&2;}
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <zlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro, zlib_major_version, zlib_minor_version, zlib_micro_version;
char *zlibver, *tmp_version;
zlibver = ZLIB_VERSION;
FILE *fp = fopen("conf.zlibtest", "a");
if ( fp ) {
fprintf(fp, "%s", zlibver);
fclose(fp);
}
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_zlib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string for\n\tmin_zlib_version... ", "$min_zlib_version");
exit(1);
}
if (sscanf(zlibver, "%d.%d.%d", &zlib_major_version, &zlib_minor_version, &zlib_micro_version) != 3) {
printf("%s, bad version string given\n", zlibver);
puts("\tby zlib, sometimes due to very old zlibs that didnt correctly");
printf("\tdefine their version. Please upgrade if you are running an\n\told zlib... ");
exit(1);
}
if ((zlib_major_version > major) ||
((zlib_major_version == major) && (zlib_minor_version > minor)) ||
((zlib_major_version == major) && (zlib_minor_version == minor) && (zlib_micro_version >= micro)))
{
return 0;
}
else
{
return 1;
}
}
_ACEOF
cp conf.zlibtest conf.zlibtest2
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
with_zlib=yes
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
with_zlib=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test x$with_zlib != x; then
{ echo "$as_me:$LINENO: result: $with_zlib" >&5
echo "${ECHO_T}$with_zlib" >&6; }
fi
if test x$with_zlib = xyes; then
ZLIB_VERSION=$(<conf.zlibtest)
:
else
ZLIB_CFLAGS=""
ZLIB_LIBS=""
ZLIB_VERSION=""
{ { echo "$as_me:$LINENO: error: zlib >= 1.2.3 is required" >&5
echo "$as_me: error: zlib >= 1.2.3 is required" >&2;}
{ (exit 1); exit 1; }; }
fi
LIBS="$tempLIBS"
CFLAGS="$tempCFLAGS"
rm conf.zlibtest
| |
***EDITED***. Configure parameters:
CFLAGS=-m32 ./configure --host=i686-gnu-linux --with-sdl-prefix=/media/34GB/Arquivos-de-Programas-Linux-32bit/Sdl-1.2.15/ --with-zlib-prefix=/media/34GB/Arquivos-de-Programas-Linux-32bit/Zlib-1.2.4/