properly cross-compile
authorraster <raster>
Tue, 17 Feb 2004 07:11:28 +0000 (07:11 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 17 Feb 2004 07:11:28 +0000 (07:11 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/e17/libs/eet@9000 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.in
make_cross_compile_arm.sh
src/bin/Makefile.am
src/lib/Makefile.am

index 3dfb1cc..3a83123 100644 (file)
@@ -4,10 +4,13 @@ dnl Process this file with autoconf to produce a configure script.
 rm -f config.cache
 
 AC_INIT(configure.in)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+AC_ISC_POSIX
 AM_INIT_AUTOMAKE(eet, 0.9.0)
 AM_CONFIG_HEADER(config.h)
 
-AC_ISC_POSIX
 AC_PROG_CC
 AM_PROG_CC_STDC
 AC_HEADER_STDC
index 6f37ee2..0529da9 100755 (executable)
@@ -1,73 +1,75 @@
 #!/bin/sh
 
+PROJ="eet"
+
+SKIFF="/skiff/local"
+HOSTARCH="i686-pc-linux-gnu"
+TARGETCPU="arm"
+TARGETARCH=$TARGETCPU"-pc-linux-gnu"
+
 make clean distclean
-./configure
+export CC=$SKIFF"/bin/"$TARGETCPU"-linux-gcc"
+export CFLAGS=-O9
+./configure \
+--host=$HOSTARCH \
+--build=$TARGETARCH \
+--target=$TARGETARCH
+
+INST="/tmp/"$PROJ"-instroot"
+sudo rm -rf $INST
+
+make
 
-cp config.h config.h.bak
-grep -v HAVE_FMEMOPEN config.h.bak > config.h
-#cp config.h config.h.bak
-#grep -v HAVE_OPEN_MEMSTREAM config.h.bak > config.h
-rm config.h.bak
+for I in  find . -name "*.la" -print; do
+  sed s:"/usr/local":$INST:g < $I > "/tmp/.sed.tmp"
+  sudo cp "/tmp/.sed.tmp" $I
+  rm -f "/tmp/.sed.tmp"
+done
 
-CC="/skiff/local/bin/arm-linux-gcc"
-ST="/skiff/local/bin/arm-linux-strip"
-CFLAGS="-O2"
+sudo \
+make \
+prefix=$INST \
+exec_prefix=$INST \
+bindir=$INST"/bin" \
+sbindir=$INST"/sbin" \
+sysconfdir=$INST"/etc" \
+datadir=$INST"/share" \
+includedir=$INST"/include" \
+libdir=$INST"/lib" \
+libexecdir=$INST"/libexec" \
+localstatedir=$INST"/var/run" \
+mandir=$INST"/share/man" \
+infodir=$INST"/share/info" \
+install
 
-rm -rf "build"
-mkdir "build"
-DST=`pwd`"/build";
+## FIXUPS
+for I in $INST"/bin/"* $INST"/sbin/"* $INST"/libexec/"*; do
+  J=`echo $I | sed s:$TARGETARCH"-"::g`
+  sudo mv $I $J
+done
 
-mkdir $DST"/lib";
-mkdir $DST"/bin";
-mkdir $DST"/include";
-#mkdir $DST"/share";
-#mkdir $DST"/share/eet";
+CF=$INST"/bin/"$PROJ"-config"
+sed s:"/usr/local":$SKIFF"/"$TARGETCPU"-linux":g < $CF > "/tmp/.sed.tmp"
+sudo cp "/tmp/.sed.tmp" $CF
+rm -f "/tmp/.sed.tmp"
 
-pushd src
+for I in  $INST"/lib/"*.la; do
+  sed s:"/usr/local":$SKIFF"/"$TARGETCPU"-linux":g < $I > "/tmp/.sed.tmp"
+  sudo cp "/tmp/.sed.tmp" $I
+  rm -f "/tmp/.sed.tmp"  
+done
 
- pushd lib
-  LIB="eet"
-  $CC \
-  *.c \
-  $CFLAGS \
-  -I. \
-  -I../.. \
-  -I/skiff/local/include \
-  -shared -fPIC -DPIC \
-  -Wl,-soname -Wl,"lib"$LIB".so.0.0.1" \
-  -o "lib"$LIB".so.0.0.1"
-  $ST -g "lib"$LIB".so.0.0.1"
-  rm -f "lib"$LIB".so"
-  ln -s "lib"$LIB".so.0.0.1" "lib"$LIB".so"
-  rm -f "lib"$LIB".so.0"
-  ln -s "lib"$LIB".so.0.0.1" "lib"$LIB".so.0"
-  rm -f "lib"$LIB".so.0.0"
-  ln -s "lib"$LIB".so.0.0.1" "lib"$LIB".so.0.0"
-  cp -a "lib"$LIB".so"* $DST"/lib";
-  cp -a "Eet.h" $DST"/include";
- popd
+## package it all up
+PACK=$PROJ"-"$TARGETCPU"-inst.tar.gz"
 
- pushd bin
-  BIN="eet"
-   $CC "eet_main.c" \
-   -I../.. -I../lib \
-   -I. \
-   -I/skiff/local/include \
-   -L. -L../lib \
-   -L/skiff/local/lib \
-   -leet -ljpeg -lz -lm \
-   -o $BIN
-   $ST $BIN
-   cp -a $BIN $DST"/bin";
- popd
-popd
+DIR=$PWD
+cd $INST
+sudo tar zcvf $DIR"/"$PACK *
+sudo chown $USER $DIR"/"$PACK
+cd $DIR
+sudo rm -rf $INST
 
-#cp -ar data $DST"/share/eet"
+## install it in our skiff tree
+cd $SKIFF"/"$TARGETCPU"-linux"
+sudo tar zxvf $DIR"/"$PACK
 
-PD=`pwd`
-pushd "build"
- tar zcvf $PD"/data.tar.gz" *
- pushd /skiff/local
-  sudo tar zxvf $PD"/data.tar.gz"
- popd
-popd
index 2707ac9..591a433 100644 (file)
@@ -1,7 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-INCLUDES = \
-       -I../lib
+INCLUDES = -I$(top_srcdir)/src/lib
 
 bin_PROGRAMS = eet
 
index 217b062..5cd4003 100644 (file)
@@ -5,9 +5,11 @@ AUTOMAKE_OPTIONS     = 1.4 foreign
 # A list of all the files in the current directory which can be regenerated
 MAINTAINERCLEANFILES = Makefile.in
 
-LDFLAGS                     = -L/usr/local/lib
-INCLUDES            = -I/usr/local/include \
-                      -I$(includedir)
+LDFLAGS                     = 
+INCLUDES            = -I. \
+                       -I$(top_srcdir)/src/lib \
+                      -I$(top_srcdir)/src/lib/include 
+                                             
 
 lib_LTLIBRARIES      = libeet.la
 include_HEADERS      = Eet.h