anaxamander
05-04-2005, 01:21 AM
Well, I'll use another example. Open up the configure file, and search for a distinctive word in your error: executables. I'll use a small configure script from an entirely different program (but they are still just shell scripts - most are strikingly similar). And behold, I can see that same error. I see just before that exact error: "if test $ac_cv_prog_cc_works = no; then", so now I look for the variable: ac_cv_prog_cc_works
I come across a test where if it does... something, it becomes yes, and no when it fails:
if { (eval echo configure:911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
else
echo "configure: failed program was:" >&5
ac_cv_prog_cc_works=no
fi
?so in this test there is some echoing, and then another variable (ac_link); another command to eval ac_link; and if successful (anything after they && means it gets executed if the stuff before it worked without error) then "test -s conftest${ac_exeext}"
and then we see that ac_link is:
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
which you can quickly translate as: "issue the gcc command, -o output to some conftest_thingy, with $CFLAGS and $CPPFLAGS and $LDFLAGS another conftest.thingy and $LIBS some_doohicky_thingy".
Boiling it down to the essence, test the compiler with some simple conftest.c file with the full complement of CompilerFLAGs, C_PreProcessorFLAGS, and Link_eDitorFLAGS, output to conftest.thingy_input and tack on LIBraries, and route the stuff to purgutory (1>&5). The files used in this test (conftest.c, .h, confdefs.h) get created inside the configure script (cat > conftest.var << EOF stuff EOF is where it happens), and that gets compiled as your test. If it doesn't complain with an error (like most things), then its fine.
If you don't have a compiler its the same as if you typed "dombaya" - you'll get some kind of error. The same thing happens if one of those flags riding along with the compile command have an error in them: something will come back. SILENCE is what is wanted; smooth compiling. For example:
gcc -fno-commet -o conftest conftest.c
cc1: error: unrecognized command line option "-fno-commet"
so an executable is NOT formed (one would have been had I spelled it right with -fno-common), and essentially it tells you what you see. Not that you don't HAVE a compiler, but that there is some(thing) (FLAG) standing in its way if you do have one ($CFLAGS $CPPFLAGS $LDFLAGS $LIBS).... or that you really don't have a compiler.
----------------------
And to wind up the last part of initial if-then statement: test -s conftest${ac_exeext}
we can see (by "man test") that the last part that can fail is "True if conftest (ac_exeext is blank) exists and is size greater than zero". Well, if there was an error along the way, that small worthless executable (created during the ac_link part) would not exist. THEN ac_cv_prog_cc_works becomes "no" and then you see the error you see, and then it exits.
Check your flags! - brought to you by the Better Gcc Bureau (the BGB)
------------------
setenv is a csh/tcsh command; export is how it is done in bash:
export LDFLAGS=-L/opt/local/lib && export
you can also change which shell Terminal.app uses as a default, or when the need arises, just type "tcsh" and you'll be in that shell - setenv all you want. type "exit, back to bash".
I come across a test where if it does... something, it becomes yes, and no when it fails:
if { (eval echo configure:911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
else
echo "configure: failed program was:" >&5
ac_cv_prog_cc_works=no
fi
?so in this test there is some echoing, and then another variable (ac_link); another command to eval ac_link; and if successful (anything after they && means it gets executed if the stuff before it worked without error) then "test -s conftest${ac_exeext}"
and then we see that ac_link is:
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
which you can quickly translate as: "issue the gcc command, -o output to some conftest_thingy, with $CFLAGS and $CPPFLAGS and $LDFLAGS another conftest.thingy and $LIBS some_doohicky_thingy".
Boiling it down to the essence, test the compiler with some simple conftest.c file with the full complement of CompilerFLAGs, C_PreProcessorFLAGS, and Link_eDitorFLAGS, output to conftest.thingy_input and tack on LIBraries, and route the stuff to purgutory (1>&5). The files used in this test (conftest.c, .h, confdefs.h) get created inside the configure script (cat > conftest.var << EOF stuff EOF is where it happens), and that gets compiled as your test. If it doesn't complain with an error (like most things), then its fine.
If you don't have a compiler its the same as if you typed "dombaya" - you'll get some kind of error. The same thing happens if one of those flags riding along with the compile command have an error in them: something will come back. SILENCE is what is wanted; smooth compiling. For example:
gcc -fno-commet -o conftest conftest.c
cc1: error: unrecognized command line option "-fno-commet"
so an executable is NOT formed (one would have been had I spelled it right with -fno-common), and essentially it tells you what you see. Not that you don't HAVE a compiler, but that there is some(thing) (FLAG) standing in its way if you do have one ($CFLAGS $CPPFLAGS $LDFLAGS $LIBS).... or that you really don't have a compiler.
----------------------
And to wind up the last part of initial if-then statement: test -s conftest${ac_exeext}
we can see (by "man test") that the last part that can fail is "True if conftest (ac_exeext is blank) exists and is size greater than zero". Well, if there was an error along the way, that small worthless executable (created during the ac_link part) would not exist. THEN ac_cv_prog_cc_works becomes "no" and then you see the error you see, and then it exits.
Check your flags! - brought to you by the Better Gcc Bureau (the BGB)
------------------
setenv is a csh/tcsh command; export is how it is done in bash:
export LDFLAGS=-L/opt/local/lib && export
you can also change which shell Terminal.app uses as a default, or when the need arises, just type "tcsh" and you'll be in that shell - setenv all you want. type "exit, back to bash".
