How to dump conftest.c?
Asked Answered
Y

2

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.

Yuonneyup answered 4/6, 2013 at 18:0 Comment(2)
The config.log file generated by configure has the contents of conftest.c for each test, compiler command invocation and other stuff.Sotos
@Sotos - While building mpfr, I could not find the contents of conftest.c in config.log, or elsewhere.Subglacial
F
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
...
Fidelis answered 26/8, 2013 at 10:4 Comment(1)
No, sometimes it does not.Bunk
A
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
Alleras answered 21/7, 2018 at 11:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.