Checking libz using standard configure

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Shazz
Posts: 244
Joined: Tue Aug 31, 2004 11:42 pm
Location: Somewhere over the rainbow
Contact:

Checking libz using standard configure

Post by Shazz »

Using this configuration line :

Code: Select all

LDFLAGS="-L`psp-config --pspsdk-path`/lib -lz -lc -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lpsputility -lpspuser -lpspkernel" CFLAGS="-G0 -I`psp-config --pspsdk-path`/include -I`psp-config --pspdev-path`/psp/include" ./configure --host psp --prefix=`psp-config --psp-prefix`
the zlib check failed :

Code: Select all

$ psp-gcc -o libz.o -G0 -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include -DHAVE_CONFIG_CONFIG68_H=1 -DNO_FALLBACK_CONFIG
=1 -Wall -O3 -fomit-frame-pointer  -DHAVE_CONFIG_CONFIG68_H=1 -DNO_FALLBACK_CONFIG=1 -Wall -O3 -fomit-frame-pointer -L/usr/local/pspdev/psp
/sdk/lib -lc -lpspkernel -lz -lc -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lpsputility -lpspuser -lpspkernel libz.c -
lz
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `gzsetparams':
gzio.c:(.text+0x90): undefined reference to `fwrite'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `gz_open':
gzio.c:(.text+0x6f8): undefined reference to `fdopen'
gzio.c:(.text+0x724): undefined reference to `ftell'
gzio.c:(.text+0x7b0): undefined reference to `fprintf'
gzio.c:(.text+0x7cc): undefined reference to `fopen'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `gzwrite':
gzio.c:(.text+0xe04): undefined reference to `fwrite'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `gzprintf':
gzio.c:(.text+0xedc): undefined reference to `vsnprintf'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `do_flush':
gzio.c:(.text+0x10cc): undefined reference to `fwrite'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `gzrewind':
gzio.c:(.text+0x11e0): undefined reference to `fseek'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `gzseek':
gzio.c:(.text+0x13d4): undefined reference to `fseek'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `putLong':
gzio.c:(.text+0x146c): undefined reference to `fputc'
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/libz.a(gzio.o): In function `gzerror':
gzio.c:(.text+0x15d0): undefined reference to `strcat'
gzio.c:(.text+0x15dc): undefined reference to `strcat'
collect2: ld returned 1 exit status
the zlib checking failed as it seems -lc -lpspkernel should be added at the end of the compilation chain :

Code: Select all

psp-gcc -o libz.o -G0 -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include -DHAVE_CONFIG_CONFIG68_H=1 -DNO_FALLBACK_CONFIG=1 -Wall -O3 -fomit-frame-pointer  -DHAVE_CONFIG_CONFIG68_H=1 -DNO_FALLBACK_CONFIG=1 -Wall -O3 -fomit-frame-pointer -L/usr/local/pspdev/psp/sdk/lib -lc -lpspkernel -lz -lc -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lpsputility -lpspuser -lpspkernel libz.c -lz -lc -lpspkernel
While trying using this test :

Code: Select all

configure: failed program was:
| #line 8501 "configure"
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "sc68"
| #define PACKAGE_TARNAME "sc68"
| #define PACKAGE_VERSION "2.2.1"
| #define PACKAGE_STRING "sc68 2.2.1"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| 
| /* Override any gcc2 internal prototype to avoid an error.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
|    builtin and then its argument prototype would still apply.  */
| char gzdopen ();
| int
| main ()
| {
| gzdopen ();
|   ;
|   return 0;
| }
But as configure is responsible to manage that... how can I do to have this compilation working (or to have -lc and -lpspkernel added at the end) ?

Thanks
- TiTAN Art Division -
http://www.titandemo.org
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Add "-Wl,--start-group" to the beginning of your LDFLAGS.
User avatar
Shazz
Posts: 244
Joined: Tue Aug 31, 2004 11:42 pm
Location: Somewhere over the rainbow
Contact:

Post by Shazz »

Perfect :D

Thanks Jim !
- TiTAN Art Division -
http://www.titandemo.org
Post Reply