This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

autoconf/configure-based linkage/include paths.


Ok, this is driving me nuts.

I've got a package (Konq/E) that I've been working on, fixed or stubbed all the current bugs, and now I'm down at the linking stage.
I get errors trying to link to the host's libraries (/usr/lib/...), that they aren't the right endianness, etc... typical couldn't-find-target-libraries error.


I've done this quite a few times before with other packages, and know that there is some finagling to let configure know what include and library paths to use.

1.) prefix refers to a place in which $prefix/lib has libraries for the target platform
2.) ditto for buildprefix
3.) I also pass --with-extra-libs pointing to a place with the libraries for the target platform reside.


What am I doing wrong?
Can someone give me a list of all the various ways,places, etc that autoconf/configure looks for using include paths?


Oh, and I do indeed see a correct -L argument to the failing g++ command... Someone mentioned that it might have something to do with the libtool archive files. Can someone explain this to me?

Included is my build output, as well as the scripts I use for configuration.

Thank you,
Keith Kyzivat

Attachment: build.out.bz2
Description: Binary data

#!/bin/sh
QTDIR=/home/keithel/tmp/src/qt-embedded-free-3.1.2
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
CXXFLAGS=-DQT_NO_CLIPBOARD
export QTDIR LD_LIBRARY CXXFLAGS

xconfigure ./configure --with-extra-libs=/usr/local/ppc860-linux/lib --prefix=$HOME/tmp --without-ssl --enable-qt-embedded --enable-embedded --disable-threading --with-qt-dir=$QTDIR --disable-pcre --disable-bookmarks --with-javascript=dynamic
#!/bin/bash
#########################################################################
# wrapper for calling automake configuration files in a cross-compile
# environment
#########################################################################

#########################################################################
# set environment
#########################################################################
# for the picky ones
#prefix=${PREFIX:=/usr/arm-cross}
#target=${TARGET:=arm-linux}
#prefix=${PREFIX:=/usr/local/ppc860-linux}
prefix=${PREFIX:=/exports/rpx860/2.4.7-timesys-3.1.254/usr/local}
buildprefix=${BUILDPREFIX:=/usr/local/ppc860-linux}

target=${TARGET:=powerpc-linux}
cc=${CC:=$target-gcc}
gcc=${GCC:=$target-gcc}
ccc=${CCC:=$target-g++}
cxx=${CXX:=$target-g++}
arch=${ARCH:="cpu=ppc860"}
xlibs=${XLIBS:=$prefix/X11R6/lib}
as=${AS:=$target-as}
ld=${LD:=$target-ld}
ar=${AR:=$target-ar}
ranlib=${RANLIB:=$target-ranlib}
strip=${STRIP:=$target-strip}

set_host="--host=i386-pc-linux-gnu"
set_prefix="--prefix=$prefix"
set_target="--target=$target"
#set_libs="--libdir=$prefix/$target/lib"
set_libs="--libdir=$buildprefix/lib"
set_xlibs="--x-libraries=$xlibs"
#set_inc="--includedir=$prefix/$target/include"
set_inc="--includedir=$buildprefix/include"
set_oinc="--oldincludedir=$prefix/include"
#set_einc="--with-extra-includes=$prefix/include"
set_einc="--with-extra-includes=$buildprefix/include"
#set_elib="--with-extra-libs=$prefix/lib"
set_elib="--with-extra-libs=$buildprefix/lib"

CROSS_COMPILE=1
BUILD_CC=gcc

#########################################################################
# usage function
#########################################################################
usage() {
  cat <<EOF
usage: $0 [path-to-configure-script] [configure options]

default options:
    --prefix=$prefix
    --target=$target
    --x-libraries=$xlibs

default environment:
    CROSS_COMPILE: $CROSS_COMPILE
    CFLAGS:        $CFLAGS
    LDFLAGS:       $LDFLAGS
    ARCH:          $ARCH
EOF
}

#########################################################################
# check path
#########################################################################
case "$PATH" in
    *$prefix/bin*) ;;
    *)             PATH="$PATH:$prefix/bin"
                   ;;
esac

#########################################################################
# set cflags
#########################################################################
case "$CFLAGS" in
    "") CFLAGS="-Os -pipe -m$arch -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
	;;
    *)  case "$CFLAGS" in
	    *-m*) ;;
	    *)    CFLAGS="$CFLAGS -m$arch"
		  ;;
        esac
	;;
esac

export CC GCC CXX AS LD AR BUILD_CC CFLAGS CROSS_COMPILE PATH

#########################################################################
# first parameter no option => must be the path to original
# configure script
#########################################################################
call_configure="./configure"
if [ -n "$1" ]
then
    case "$1" in
	--*) ;;
	*/configure) call_configure=$1
	             shift
	             ;;
        *)           call_configure="$1/configure"
	             shift
                     ;;
    esac
fi

#########################################################################
# configure script found/executable?
#########################################################################
if [ ! -x "$call_configure" ]
then
    echo "configure script not found or not executable" >&2
    usage
    exit 1
fi

for opt in $@
do
    case "$opt" in
	--prefix=*) set_prefix=
		   ;;
        --target=*) set_target=
	           ;;
        --host=*) set_host=
	           ;;
        --libdir=*) set_libs=
	           ;;
        --x-libraries=*) set_xlibs=
	           ;;
	--includedir=*) set_inc=
	           ;;
	--oldincludedir=*) set_oinc=
	           ;;
    esac
done


#########################################################################
# call the original configure script
#########################################################################

$call_configure $set_prefix $set_target $set_host $set_libs $set_xlibs $set_inc $set_oinc $set_einc $set_elib $@

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe at sources dot redhat dot com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]