Subject: Creating a Cross Compile package
To: None <tech-pkg@netbsd.org>
From: David Price <dprice@cs.nmsu.edu>
List: tech-pkg
Date: 08/11/2004 10:43:02
Hello,
         Im working on creating a package which uses the i386-linux package 
in cross
to make a linux compatible library that the sun-java jni interface can 
load
and work with.
The library comes with a configure script, which I pass the following 
options
to:

CONF_ARGS+=     --with-java=${PKG_JAVA_HOME}/include
CONF_ARGS+=     --with-javaos=${PKG_JAVA_HOME}/include/linux
CONF_ARGS+=     --bindir=${PREFIX}/bin
CONF_ARGS+=     --libdir=${PREFIX}/lib
CONF_ARGS+=     --x-libraries=${PREFIX}/emul/linux/usr/X11R6/lib/
CONF_ARGS+=     --host=i386-linux
CONF_ARGS+=     --build=i386-netbsd
CONF_ARGS+=     --prefix=${PREFIX}/cross/i386-linux/ (also tried 
${PREFIX}/cross/)

and then execute the command (CROSS_PKG is set to i386-linux):
cd ${WRKSRC} && ${PREFIX}/bin/cross-env ./configure ${CONF_ARGS}

The configure script excutes successfully and detects i386-linux-gcc.  So 
I
execute the makefile with: cd ${WRKSRC} && ${PREFIX}/bin/cross-env make

The library builds successfully, but when I go to do a make install, I 
get:
/home/dprice/pkg/lib/libajaxj.so:       -lc.6 => not found
*** The above programs/libs will not find the listed shared libraries
     at runtime. Please fix the package (add -Wl,-R.../lib in the right
places)!

To fix this, I added -Wl,-R/${PREFIX}/cross/i386-linux/lib/ to CFLAGS.
This fixed the error, but I got a new one:

/home/dprice/pkg/lib/libajaxj.so:        ld-linux.so.2 => not found
*** The above programs/libs will not find the listed shared libraries
     at runtime. Please fix the package (add -Wl,-R.../lib in the right
places)!
*** Error code 1

ld-linux.so.2 exists in the same directory that libc does
(${PREFIX}/cross/i386-linux/lib/).
ld-linux.so.2 exists as a symlink to ld-2.0.7.so (which exists in
${PREFIX}/cross/i386-linux/lib/ as well).

Obviously I must have my cross compile environment incorrectly setup, but 
Im
not sure where.  Any help would be greatly appreciated.

Thanks,
David