13

I have problems linking to a lot of libraries with a cross-compiler. Is it possible to dump the file conftest.c to a safe location each time it's being generated?

I tried to uncomment the lines

rm -f conftest

from the configure script, but it continues like it means nothing.

John Smith
  • 131
  • 1
  • 3

2 Answers2

10

Check the config.log, it includes the failed program Something like:

...
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "libogg"
| #define VERSION "1.2.2"
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
...
1

For me it prints the code on failure but to force it I created a wrapper script:

#!/bin/sh

for i in "$@"; do
  if echo "$i" | grep -q '\.c$'; then
     echo printing $i
     cat "$i"
  fi
done

exec cc "$@"

Then run with

$ CC=$PWD/cc.sh ./configure
Tristan Hill
  • 171
  • 1
  • 3