I'm trying to compile an autotools project in C++ (djvulibre) and lots of tests are failing because linking fails. For example, looking for -lm:
Code: Select all
$ CXXFLAGS="-I`psp-config -p`/include -I`psp-config -P`/include -G0 -fno-rtti" LDFLAGS="-L`psp-config -P`/lib -L`psp-config -p`/lib -lc -lpspuser" ./configure --host=psp --prefix=`psp-config -P` --disable-shared --enable-static --without-x --without-qt
...
checking for sqrt in -lm... no
...
Code: Select all
configure:22109: checking for sqrt in -lm
configure:22144: psp-g++ -o conftest -I/Users/paulo/pspdev/psp/sdk/include -I/Users/paulo/pspdev/psp/include -G0 -fno-rtti -L/Users/paulo/pspdev/psp/lib -L/Users/paulo/pspdev/psp/sdk/lib -lc -lpspuser conftest.cpp -lm -lc -lpspuser >&5
/Users/paulo/pspdev/psp/lib/libc.a(_write.o): In function `_write':
libcglue.c:(.text+0x84): undefined reference to `sceIoWrite'
...
Code: Select all
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char sqrt ();
int
main ()
{
return sqrt ();
;
return 0;
}
Code: Select all
$ cp conftest.cpp conftest.c
$ psp-gcc -o conftest -I/Users/paulo/pspdev/psp/sdk/include -I/Users/paulo/pspdev/psp/include -G0 -fno-rtti -L/Users/paulo/pspdev/psp/lib -L/Users/paulo/pspdev/psp/sdk/lib -lc -lpspuser conftest.c -lm -lc -lpspuser
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
conftest.c:4: warning: conflicting types for built-in function ‘sqrt’
I'm probably doing something wrong here, but I don't know what... I've tried changing the linking order of the libs, adding more libs, all to no avail. Any suggestions?
Thanks.