Browse Source

luajit: imported patch to drop TARGET=arch

user/amery/next/luajit
Alejandro Mery 13 years ago
parent
commit
733486cff2
  1. 119
      lua/luajit/b61be299c9fc00e8d2252fa3f12c6005686783d6.patch

119
lua/luajit/b61be299c9fc00e8d2252fa3f12c6005686783d6.patch

@ -0,0 +1,119 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../luajit/b61be299c9fc00e8d2252fa3f12c6005686783d6.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
From b61be299c9fc00e8d2252fa3f12c6005686783d6 Mon Sep 17 00:00:00 2001
From: Mike Pall <mike>
Date: Thu, 15 Dec 2011 19:16:06 +0100
Subject: [PATCH] Auto-detect target arch via cross-compiler. Drop TARGET=arch.
---
doc/install.html | 10 +++++-----
src/Makefile | 9 +++++----
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/doc/install.html b/doc/install.html
index 4e226d1..07c55fa 100644
--- a/doc/install.html
+++ b/doc/install.html
@@ -355,7 +355,7 @@ EGLIBC). The <tt>CROSS</tt> prefix may vary depending on the
<tt>--target</tt> of the toolchain:
</p>
<pre class="code">
-make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabi- TARGET=arm
+make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabi-
</pre>
<p>
You can cross-compile for <b id="android">Android (ARM)</b> using the <a href="http://developer.android.com/sdk/ndk/index.html"><span class="ext">&raquo;</span>&nbsp;Android NDK</a>.
@@ -368,7 +368,7 @@ NDKABI=8
NDKVER=$NDK/toolchains/arm-linux-androideabi-4.4.3
NDKP=$NDKVER/prebuilt/linux-x86/bin/arm-linux-androideabi-
NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
-make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF" TARGET=arm
+make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF"
</pre>
<p>
You can cross-compile for <b id="ios">iOS 3.0+</b> (iPhone/iPad) using the <a href="http://developer.apple.com/devcenter/ios/index.action"><span class="ext">&raquo;</span>&nbsp;iOS SDK</a>.
@@ -387,7 +387,7 @@ ISDKVER=iPhoneOS4.3.sdk
ISDKP=$ISDK/usr/bin/
ISDKF="-arch armv6 -isysroot $ISDK/SDKs/$ISDKVER"
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" \
- TARGET=arm TARGET_SYS=iOS
+ TARGET_SYS=iOS
</pre>
<p>
You can cross-compile for a <b id="ppc">PPC target</b> or a
@@ -398,11 +398,11 @@ of the toolchain:
</p>
<pre class="code">
# PPC
-make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- TARGET=ppc
+make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu-
</pre>
<pre class="code">
# PPC/e500v2
-make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe- TARGET=ppcspe
+make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe-
</pre>
<p>
Whenever the <b>host OS and the target OS differ</b>, you need to specify
diff --git a/src/Makefile b/src/Makefile
index d4f8033..3e5b6dc 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -173,13 +173,11 @@ XCFLAGS=
#
# Cross-compilation examples:
# make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows
-# make HOST_CC="gcc -m32" CROSS=powerpc-e500v2-linux-gnuspe- TARGET=ppcspe
+# make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu-
CCOPTIONS= $(CCDEBUG) $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS)
LDOPTIONS= $(CCDEBUG) $(LDFLAGS)
-TARGET_ARCH= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET))
-
HOST_CC= $(CC)
HOST_RM= rm -f
# NOTE: The LuaJIT distribution comes with pre-generated buildvm_*.h files.
@@ -214,6 +212,7 @@ TARGET_DYNXLDOPTS=
TARGET_XCFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U_FORTIFY_SOURCE
TARGET_XLDFLAGS=
TARGET_XLIBS= -lm
+TARGET_TCFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS)
TARGET_ACFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_ARCH) $(TARGET_FLAGS) $(TARGET_CFLAGS)
TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAGS)
TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS)
@@ -223,7 +222,7 @@ ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs)))
TARGET_XCFLAGS+= -fno-stack-protector
endif
-TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_ACFLAGS) -E lj_arch.h -dM)
+TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_TCFLAGS) -E lj_arch.h -dM)
ifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH)))
TARGET_CCARCH= x64
TARGET_XCFLAGS+= $(CCOPT_X64)
@@ -251,6 +250,8 @@ endif
endif
endif
+TARGET_ARCH= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_CCARCH))
+
ifneq (,$(PREFIX))
ifneq (/usr/local,$(PREFIX))
TARGET_XCFLAGS+= -DLUA_XROOT=\"$(PREFIX)/\"
--
1.6.5.GIT
Loading…
Cancel
Save