mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Add support for multilib distro builds.
This commit is contained in:
parent
b2a13ddd74
commit
519ef0cba7
6
Makefile
6
Makefile
@ -25,11 +25,12 @@ ABIVER= 5.1
|
|||||||
# the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path!
|
# the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path!
|
||||||
#
|
#
|
||||||
export PREFIX= /usr/local
|
export PREFIX= /usr/local
|
||||||
|
export MULTILIB= lib
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
DPREFIX= $(DESTDIR)$(PREFIX)
|
DPREFIX= $(DESTDIR)$(PREFIX)
|
||||||
INSTALL_BIN= $(DPREFIX)/bin
|
INSTALL_BIN= $(DPREFIX)/bin
|
||||||
INSTALL_LIB= $(DPREFIX)/lib
|
INSTALL_LIB= $(DPREFIX)/$(MULTILIB)
|
||||||
INSTALL_SHARE= $(DPREFIX)/share
|
INSTALL_SHARE= $(DPREFIX)/share
|
||||||
INSTALL_INC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)
|
INSTALL_INC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)
|
||||||
|
|
||||||
@ -73,7 +74,8 @@ INSTALL_X= install -m 0755
|
|||||||
INSTALL_F= install -m 0644
|
INSTALL_F= install -m 0644
|
||||||
UNINSTALL= $(RM)
|
UNINSTALL= $(RM)
|
||||||
LDCONFIG= ldconfig -n
|
LDCONFIG= ldconfig -n
|
||||||
SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|"
|
SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
|
||||||
|
-e "s|^multilib=.*|multilib=$(MULTILIB)|"
|
||||||
|
|
||||||
FILE_T= luajit
|
FILE_T= luajit
|
||||||
FILE_A= libluajit.a
|
FILE_A= libluajit.a
|
||||||
|
@ -565,9 +565,11 @@ for a regular distribution build:
|
|||||||
<ul>
|
<ul>
|
||||||
<li><tt>PREFIX</tt> overrides the installation path and should usually
|
<li><tt>PREFIX</tt> overrides the installation path and should usually
|
||||||
be set to <tt>/usr</tt>. Setting this also changes the module paths and
|
be set to <tt>/usr</tt>. Setting this also changes the module paths and
|
||||||
the <tt>-rpath</tt> of the shared library.</li>
|
the paths needed to locate the shared library.</li>
|
||||||
<li><tt>DESTDIR</tt> is an absolute path which allows you to install
|
<li><tt>DESTDIR</tt> is an absolute path which allows you to install
|
||||||
to a shadow tree instead of the root tree of the build system.</li>
|
to a shadow tree instead of the root tree of the build system.</li>
|
||||||
|
<li><tt>MULTILIB</tt> sets the architecture-specific library path component
|
||||||
|
for multilib systems. The default is <tt>lib</tt>.</li>
|
||||||
<li>Have a look at the top-level <tt>Makefile</tt> and <tt>src/Makefile</tt>
|
<li>Have a look at the top-level <tt>Makefile</tt> and <tt>src/Makefile</tt>
|
||||||
for additional variables to tweak. The following variables <em>may</em> be
|
for additional variables to tweak. The following variables <em>may</em> be
|
||||||
overridden, but it's <em>not</em> recommended, except for special needs
|
overridden, but it's <em>not</em> recommended, except for special needs
|
||||||
|
@ -6,13 +6,14 @@ version=${majver}.${minver}.${relver}
|
|||||||
abiver=5.1
|
abiver=5.1
|
||||||
|
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
multilib=lib
|
||||||
exec_prefix=${prefix}
|
exec_prefix=${prefix}
|
||||||
libdir=${exec_prefix}/lib
|
libdir=${exec_prefix}/${multilib}
|
||||||
libname=luajit-${abiver}
|
libname=luajit-${abiver}
|
||||||
includedir=${prefix}/include/luajit-${majver}.${minver}
|
includedir=${prefix}/include/luajit-${majver}.${minver}
|
||||||
|
|
||||||
INSTALL_LMOD=${prefix}/share/lua/${abiver}
|
INSTALL_LMOD=${prefix}/share/lua/${abiver}
|
||||||
INSTALL_CMOD=${prefix}/lib/lua/${abiver}
|
INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver}
|
||||||
|
|
||||||
Name: LuaJIT
|
Name: LuaJIT
|
||||||
Description: Just-in-time compiler for Lua
|
Description: Just-in-time compiler for Lua
|
||||||
|
13
src/Makefile
13
src/Makefile
@ -188,9 +188,10 @@ TARGET_LD= $(CROSS)$(CC)
|
|||||||
TARGET_AR= $(CROSS)ar rcus
|
TARGET_AR= $(CROSS)ar rcus
|
||||||
TARGET_STRIP= $(CROSS)strip
|
TARGET_STRIP= $(CROSS)strip
|
||||||
|
|
||||||
|
TARGET_LIBPATH= $(or $(PREFIX),/usr/local)/$(or $(MULTILIB),lib)
|
||||||
TARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER)
|
TARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER)
|
||||||
TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib
|
TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib
|
||||||
TARGET_DYLIBPATH= $(or $(PREFIX),/usr/local)/lib/$(TARGET_DYLIBNAME)
|
TARGET_DYLIBPATH= $(TARGET_LIBPATH)/$(TARGET_DYLIBNAME)
|
||||||
TARGET_DLLNAME= lua$(NODOTABIVER).dll
|
TARGET_DLLNAME= lua$(NODOTABIVER).dll
|
||||||
TARGET_XSHLDFLAGS= -shared -fPIC -Wl,-soname,$(TARGET_SONAME)
|
TARGET_XSHLDFLAGS= -shared -fPIC -Wl,-soname,$(TARGET_SONAME)
|
||||||
TARGET_DYNXLDOPTS=
|
TARGET_DYNXLDOPTS=
|
||||||
@ -249,12 +250,18 @@ TARGET_ARCH+= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_LJARCH))
|
|||||||
|
|
||||||
ifneq (,$(PREFIX))
|
ifneq (,$(PREFIX))
|
||||||
ifneq (/usr/local,$(PREFIX))
|
ifneq (/usr/local,$(PREFIX))
|
||||||
TARGET_XCFLAGS+= -DLUA_XROOT=\"$(PREFIX)/\"
|
TARGET_XCFLAGS+= -DLUA_ROOT=\"$(PREFIX)\"
|
||||||
ifneq (/usr,$(PREFIX))
|
ifneq (/usr,$(PREFIX))
|
||||||
TARGET_DYNXLDOPTS= -Wl,-rpath,$(PREFIX)/lib
|
TARGET_DYNXLDOPTS= -Wl,-rpath,$(TARGET_LIBPATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifneq (,$(MULTILIB))
|
||||||
|
TARGET_XCFLAGS+= -DLUA_MULTILIB=\"$(MULTILIB)\"
|
||||||
|
endif
|
||||||
|
ifneq (,$(LMULTILIB))
|
||||||
|
TARGET_XCFLAGS+= -DLUA_LMULTILIB=\"$(LMULTILIB)\"
|
||||||
|
endif
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# System detection.
|
# System detection.
|
||||||
|
@ -23,26 +23,40 @@
|
|||||||
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
|
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
** Note to distribution maintainers: do NOT patch the following line!
|
** Note to distribution maintainers: do NOT patch the following lines!
|
||||||
** Please read ../doc/install.html#distro and pass PREFIX=/usr instead.
|
** Please read ../doc/install.html#distro and pass PREFIX=/usr instead.
|
||||||
*/
|
*/
|
||||||
#define LUA_ROOT "/usr/local/"
|
#ifndef LUA_MULTILIB
|
||||||
#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
|
#define LUA_MULTILIB "lib"
|
||||||
#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
|
|
||||||
#ifdef LUA_XROOT
|
|
||||||
#define LUA_JDIR LUA_XROOT "share/luajit-2.0.2/"
|
|
||||||
#define LUA_XPATH \
|
|
||||||
";" LUA_XROOT "share/lua/5.1/?.lua;" LUA_XROOT "share/lua/5.1/?/init.lua"
|
|
||||||
#define LUA_XCPATH LUA_XROOT "lib/lua/5.1/?.so;"
|
|
||||||
#else
|
|
||||||
#define LUA_JDIR LUA_ROOT "share/luajit-2.0.2/"
|
|
||||||
#define LUA_XPATH
|
|
||||||
#define LUA_XCPATH
|
|
||||||
#endif
|
#endif
|
||||||
#define LUA_PATH_DEFAULT \
|
#ifndef LUA_LMULTILIB
|
||||||
"./?.lua;" LUA_JDIR"?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua" LUA_XPATH
|
#define LUA_LMULTILIB "lib"
|
||||||
#define LUA_CPATH_DEFAULT \
|
#endif
|
||||||
"./?.so;" LUA_CDIR"?.so;" LUA_XCPATH LUA_CDIR"loadall.so"
|
#define LUA_LROOT "/usr/local"
|
||||||
|
#define LUA_LUADIR "/lua/5.1/"
|
||||||
|
#define LUA_LJDIR "/luajit-2.0.2/"
|
||||||
|
|
||||||
|
#ifdef LUA_ROOT
|
||||||
|
#define LUA_JROOT LUA_ROOT
|
||||||
|
#define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR
|
||||||
|
#define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR
|
||||||
|
#define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua"
|
||||||
|
#define LUA_RCPATH ";" LUA_RCDIR "?.so"
|
||||||
|
#else
|
||||||
|
#define LUA_JROOT LUA_LROOT
|
||||||
|
#define LUA_RLPATH
|
||||||
|
#define LUA_RCPATH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua"
|
||||||
|
#define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR
|
||||||
|
#define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR
|
||||||
|
#define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua"
|
||||||
|
#define LUA_LCPATH1 ";" LUA_LCDIR "?.so"
|
||||||
|
#define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so"
|
||||||
|
|
||||||
|
#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH
|
||||||
|
#define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Environment variable names for path overrides and initialization code. */
|
/* Environment variable names for path overrides and initialization code. */
|
||||||
|
Loading…
Reference in New Issue
Block a user