commit 7191d4d09f1646adc6c3ed6998c7b1c8511ccd73
parent a20cf6d459ed983f6eb561d8cecb93b91d461cbc
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 12 Jul 2014 17:05:33 +0000
elinks: cross-compile
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/elinks/elinks-configure.patch b/elinks/elinks-configure.patch
@@ -0,0 +1,24 @@
+--- elinks-0.12pre6/configure
++++ configure
+@@ -2124,10 +2124,6 @@
+ if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- test "$cross_compiling" = yes &&
+- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+- { (exit 1); exit 1; }; }
+ if test -r ""$srcdir/$features""; then
+ eval "$as_ac_File=yes"
+ else
+@@ -2147,10 +2143,6 @@
+ if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- test "$cross_compiling" = yes &&
+- { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+- { (exit 1); exit 1; }; }
+ if test -r ""$builddir/$features""; then
+ eval "$as_ac_File=yes"
+ else
diff --git a/elinks/elinks.mk b/elinks/elinks.mk
@@ -9,6 +9,8 @@ elinks:QV:
export CFLAGS="$CFLAGS $DEPS_CFLAGS -DVA_COPY=va_copy"
export LDFLAGS="$LDFLAGS $DEPS_LDFLAGS"
CC="$CC -static" ./configure \
+ --build="${TOOLCHAIN_TRIPLET}" \
+ --host="${HOST_TOOLCHAIN_TRIPLET}" \
--prefix="$PREFIX" \
--mandir="$ROOT/share/man" \
--disable-shared \
@@ -37,15 +39,21 @@ elinks:QV:
# NOTES:
# - LD is set to "ld", not gcc, because Makefile.lib specifies:
# ld -r -o ...
+ # use $TOOLCHAIN-ld ($LD can be set to $CC).
+ printf '%s' "$LD" | grep -q 'ld' || export LD="`$CC -dumpmachine`-ld"
# - X_CFLAGS is set to blank, it's set to "-I/usr/include" which breaks
# builds outside emul.
make -j$nprocs \
V="1" CC="${CC} -static" \
X_CFLAGS=" " \
- LD="${TOOLCHAIN_TRIPLET}-ld" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
+ LD="$LD" \
+ CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
install:QV:
+ # use $TOOLCHAIN-ld ($LD can be set to $CC).
+ printf '%s' "$LD" | grep -q 'ld' || export LD="`$CC -dumpmachine`-ld"
make -j$nprocs install DESTDIR="$ROOT" \
V="1" CC="${CC} -static" \
X_CFLAGS=" " \
- LD="${TOOLCHAIN_TRIPLET}-ld" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
+ LD="$LD" \
+ CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
diff --git a/elinks/mkfile b/elinks/mkfile
@@ -4,3 +4,5 @@
src = elinks-$v
url = http://elinks.or.cz/download/elinks-$v.tar.bz2
mkfile = ../elinks.mk
+patches = \
+ ../elinks-configure.patch