Fix install for cross-builds.

This commit is contained in:
Mike Pall 2016-03-22 22:16:12 +01:00
parent ddadbe8099
commit 7e05355a08
2 changed files with 23 additions and 14 deletions

View File

@ -46,17 +46,18 @@ INSTALL_PKGCONFIG= $(INSTALL_LIB)/pkgconfig
INSTALL_TNAME= luajit-$(VERSION) INSTALL_TNAME= luajit-$(VERSION)
INSTALL_TSYMNAME= luajit INSTALL_TSYMNAME= luajit
INSTALL_ANAME= libluajit-$(ABIVER).a INSTALL_ANAME= libluajit-$(ABIVER).a
INSTALL_SONAME= libluajit-$(ABIVER).so.$(MAJVER).$(MINVER).$(RELVER) INSTALL_SOSHORT1= libluajit-$(ABIVER).so
INSTALL_SOSHORT= libluajit-$(ABIVER).so INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER)
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib INSTALL_SONAME= $(INSTALL_SOSHORT2).$(MINVER).$(RELVER)
INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib
INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib
INSTALL_PCNAME= luajit.pc INSTALL_PCNAME= luajit.pc
INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME) INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)
INSTALL_DYN= $(INSTALL_LIB)/$(INSTALL_SONAME) INSTALL_DYN= $(INSTALL_LIB)/$(INSTALL_SONAME)
INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_SOSHORT) INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_SOSHORT1)
INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_SOSHORT) INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_SOSHORT2)
INSTALL_T= $(INSTALL_BIN)/$(INSTALL_TNAME) INSTALL_T= $(INSTALL_BIN)/$(INSTALL_TNAME)
INSTALL_TSYM= $(INSTALL_BIN)/$(INSTALL_TSYMNAME) INSTALL_TSYM= $(INSTALL_BIN)/$(INSTALL_TSYMNAME)
INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME) INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME)
@ -87,12 +88,17 @@ FILES_JITLIB= bc.lua v.lua dump.lua dis_x86.lua dis_x64.lua dis_arm.lua \
dis_ppc.lua dis_mips.lua dis_mipsel.lua bcsave.lua vmdef.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua bcsave.lua vmdef.lua
ifeq (,$(findstring Windows,$(OS))) ifeq (,$(findstring Windows,$(OS)))
ifeq (Darwin,$(shell uname -s)) HOST_SYS:= $(shell uname -s)
INSTALL_SONAME= $(INSTALL_DYLIBNAME) else
INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_DYLIBSHORT1) HOST_SYS= Windows
INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_DYLIBSHORT2) endif
LDCONFIG= : TARGET_SYS?= $(HOST_SYS)
endif
ifeq (Darwin,$(TARGET_SYS))
INSTALL_SONAME= $(INSTALL_DYLIBNAME)
INSTALL_SOSHORT1= $(INSTALL_DYLIBSHORT1)
INSTALL_SOSHORT2= $(INSTALL_DYLIBSHORT2)
LDCONFIG= :
endif endif
############################################################################## ##############################################################################

View File

@ -344,9 +344,12 @@ target OS differ, or you'll get assembler or linker errors. E.g. if
you're compiling on a Windows or OSX host for embedded Linux or Android, you're compiling on a Windows or OSX host for embedded Linux or Android,
you need to add <tt>TARGET_SYS=Linux</tt> to the examples below. For a you need to add <tt>TARGET_SYS=Linux</tt> to the examples below. For a
minimal target OS, you may need to disable the built-in allocator in minimal target OS, you may need to disable the built-in allocator in
<tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>. The examples <tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>. Don't forget to
below only show some popular targets &mdash; please check the comments specify the same <tt>TARGET_SYS</tt> for the install step, too.
in <tt>src/Makefile</tt> for more details. </p>
<p>
The examples below only show some popular targets &mdash; please check
the comments in <tt>src/Makefile</tt> for more details.
</p> </p>
<pre class="code"> <pre class="code">
# Cross-compile to a 32 bit binary on a multilib x64 OS # Cross-compile to a 32 bit binary on a multilib x64 OS