diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-06-18 11:23:43 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-06-18 11:23:43 +0000 |
commit | c594597e3480253f361154c71491adf03bc896d3 (patch) | |
tree | 4f656c0861c6ccf00118df41fc5e224bfc4e31b9 /Build/source/libs | |
parent | 352dcc581b20e25d7cc394cf602b3617cd305369 (diff) |
LuaTeX: Somewhat better handling of Lua52/LuaJIT
git-svn-id: svn://tug.org/texlive/trunk@34278 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-0.9.29/src/hb-ot-cmap-table.hh | 380 | ||||
-rw-r--r-- | Build/source/libs/lua52/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/libs/lua52/Makefile.am | 8 | ||||
-rw-r--r-- | Build/source/libs/lua52/Makefile.in | 3 | ||||
-rwxr-xr-x | Build/source/libs/lua52/configure | 2 | ||||
-rw-r--r-- | Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-05-LuaJITTeX | 16 | ||||
-rw-r--r-- | Build/source/libs/luajit/LuaJIT-2.0.3/src/lj_str.c | 10 | ||||
-rw-r--r-- | Build/source/libs/luajit/Makefile.am | 4 | ||||
-rwxr-xr-x | Build/source/libs/luajit/configure | 18 | ||||
-rw-r--r-- | Build/source/libs/luajit/configure.ac | 13 | ||||
-rw-r--r-- | Build/source/libs/luajit/native/Makefile.in | 1 | ||||
-rw-r--r-- | Build/source/libs/luajit/native/aclocal.m4 | 1 | ||||
-rwxr-xr-x | Build/source/libs/luajit/native/configure | 6 | ||||
-rw-r--r-- | Build/source/libs/luajit/native/configure.ac | 9 |
15 files changed, 440 insertions, 41 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-0.9.29/src/hb-ot-cmap-table.hh b/Build/source/libs/harfbuzz/harfbuzz-0.9.29/src/hb-ot-cmap-table.hh new file mode 100644 index 00000000000..b0f01e120fc --- /dev/null +++ b/Build/source/libs/harfbuzz/harfbuzz-0.9.29/src/hb-ot-cmap-table.hh @@ -0,0 +1,380 @@ +/* + * Copyright © 2014 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_CMAP_TABLE_HH +#define HB_OT_CMAP_TABLE_HH + +#include "hb-open-type-private.hh" + + +namespace OT { + + +/* + * cmap -- Character To Glyph Index Mapping Table + */ + +#define HB_OT_TAG_cmap HB_TAG('c','m','a','p') + + +struct CmapSubtableFormat0 +{ + friend struct CmapSubtable; + + private: + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + hb_codepoint_t gid = codepoint < 256 ? glyphIdArray[codepoint] : 0; + if (!gid) + return false; + *glyph = gid; + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) { + TRACE_SANITIZE (this); + return TRACE_RETURN (c->check_struct (this)); + } + + protected: + USHORT format; /* Format number is set to 0. */ + USHORT length; /* Byte length of this subtable. */ + USHORT language; /* Ignore. */ + BYTE glyphIdArray[256];/* An array that maps character + * code to glyph index values. */ + public: + DEFINE_SIZE_STATIC (6 + 256); +}; + +struct CmapSubtableFormat4 +{ + friend struct CmapSubtable; + + private: + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + unsigned int segCount; + const USHORT *endCount; + const USHORT *startCount; + const USHORT *idDelta; + const USHORT *idRangeOffset; + const USHORT *glyphIdArray; + unsigned int glyphIdArrayLength; + + segCount = this->segCountX2 / 2; + endCount = this->values; + startCount = endCount + segCount + 1; + idDelta = startCount + segCount; + idRangeOffset = idDelta + segCount; + glyphIdArray = idRangeOffset + segCount; + glyphIdArrayLength = (this->length - 16 - 8 * segCount) / 2; + + /* Custom bsearch. */ + int min = 0, max = (int) segCount - 1; + unsigned int i; + while (min <= max) + { + int mid = (min + max) / 2; + if (codepoint < startCount[mid]) + max = mid - 1; + else if (codepoint > endCount[mid]) + min = mid + 1; + else + { + i = mid; + goto found; + } + } + return false; + + found: + hb_codepoint_t gid; + unsigned int rangeOffset = idRangeOffset[i]; + if (rangeOffset == 0) + gid = codepoint + idDelta[i]; + else + { + /* Somebody has been smoking... */ + unsigned int index = rangeOffset / 2 + (codepoint - startCount[i]) + i - segCount; + if (unlikely (index >= glyphIdArrayLength)) + return false; + gid = glyphIdArray[index]; + if (unlikely (!gid)) + return false; + gid += idDelta[i]; + } + + *glyph = gid & 0xFFFF; + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) { + TRACE_SANITIZE (this); + return TRACE_RETURN (c->check_struct (this) && + c->check_range (this, length) && + 16 + 4 * (unsigned int) segCountX2 < length); + } + + protected: + USHORT format; /* Format number is set to 4. */ + USHORT length; /* This is the length in bytes of the + * subtable. */ + USHORT language; /* Ignore. */ + USHORT segCountX2; /* 2 x segCount. */ + USHORT searchRange; /* 2 * (2**floor(log2(segCount))) */ + USHORT entrySelector; /* log2(searchRange/2) */ + USHORT rangeShift; /* 2 x segCount - searchRange */ + + USHORT values[VAR]; +#if 0 + USHORT endCount[segCount]; /* End characterCode for each segment, + * last=0xFFFF. */ + USHORT reservedPad; /* Set to 0. */ + USHORT startCount[segCount]; /* Start character code for each segment. */ + SHORT idDelta[segCount]; /* Delta for all character codes in segment. */ + USHORT idRangeOffset[segCount];/* Offsets into glyphIdArray or 0 */ + USHORT glyphIdArray[VAR]; /* Glyph index array (arbitrary length) */ +#endif + + public: + DEFINE_SIZE_ARRAY (14, values); +}; + +struct CmapSubtableLongGroup +{ + friend struct CmapSubtableFormat12; + friend struct CmapSubtableFormat13; + + int cmp (hb_codepoint_t codepoint) const + { + if (codepoint < startCharCode) return -1; + if (codepoint > endCharCode) return +1; + return 0; + } + + inline bool sanitize (hb_sanitize_context_t *c) { + TRACE_SANITIZE (this); + return TRACE_RETURN (c->check_struct (this)); + } + + private: + ULONG startCharCode; /* First character code in this group. */ + ULONG endCharCode; /* Last character code in this group. */ + ULONG glyphID; /* Glyph index; interpretation depends on + * subtable format. */ + public: + DEFINE_SIZE_STATIC (12); +}; + +template <typename UINT> +struct CmapSubtableTrimmed +{ + friend struct CmapSubtable; + + private: + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + /* Rely on our implicit array bound-checking. */ + hb_codepoint_t gid = glyphIdArray[codepoint - startCharCode]; + if (!gid) + return false; + *glyph = gid; + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) { + TRACE_SANITIZE (this); + return TRACE_RETURN (c->check_struct (this) && glyphIdArray.sanitize (c)); + } + + protected: + UINT formatReserved; /* Subtable format and (maybe) padding. */ + UINT length; /* Byte length of this subtable. */ + UINT language; /* Ignore. */ + UINT startCharCode; /* First character code covered. */ + GenericArrayOf<UINT, GlyphID> + glyphIdArray; /* Array of glyph index values for character + * codes in the range. */ + public: + DEFINE_SIZE_ARRAY (5 * sizeof (UINT), glyphIdArray); +}; + +struct CmapSubtableFormat6 : CmapSubtableTrimmed<USHORT> {}; +struct CmapSubtableFormat10 : CmapSubtableTrimmed<ULONG > {}; + +template <typename T> +struct CmapSubtableLongSegmented +{ + friend struct CmapSubtable; + + private: + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + int i = groups.search (codepoint); + if (i == -1) + return false; + *glyph = T::group_get_glyph (groups[i], codepoint); + return true; + } + + inline bool sanitize (hb_sanitize_context_t *c) { + TRACE_SANITIZE (this); + return TRACE_RETURN (c->check_struct (this) && groups.sanitize (c)); + } + + protected: + USHORT format; /* Subtable format; set to 12. */ + USHORT reserved; /* Reserved; set to 0. */ + ULONG length; /* Byte length of this subtable. */ + ULONG language; /* Ignore. */ + LongArrayOf<CmapSubtableLongGroup> + groups; /* Groupings. */ + public: + DEFINE_SIZE_ARRAY (16, groups); +}; + +struct CmapSubtableFormat12 : CmapSubtableLongSegmented<CmapSubtableFormat12> +{ + static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u) + { return group.glyphID + (u - group.startCharCode); } +}; + +struct CmapSubtableFormat13 : CmapSubtableLongSegmented<CmapSubtableFormat13> +{ + static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u HB_UNUSED) + { return group.glyphID; } +}; + +struct CmapSubtable +{ + /* Note: We intentionally do NOT implement subtable formats 2 and 8. */ + + inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + { + switch (u.format) { + case 0: return u.format0 .get_glyph(codepoint, glyph); + case 4: return u.format4 .get_glyph(codepoint, glyph); + case 6: return u.format6 .get_glyph(codepoint, glyph); + case 10: return u.format10.get_glyph(codepoint, glyph); + case 12: return u.format12.get_glyph(codepoint, glyph); + case 13: return u.format13.get_glyph(codepoint, glyph); + default:return false; + } + } + + inline bool sanitize (hb_sanitize_context_t *c) { + TRACE_SANITIZE (this); + if (!u.format.sanitize (c)) return TRACE_RETURN (false); + switch (u.format) { + case 0: return TRACE_RETURN (u.format0 .sanitize (c)); + case 4: return TRACE_RETURN (u.format4 .sanitize (c)); + case 6: return TRACE_RETURN (u.format6 .sanitize (c)); + case 10: return TRACE_RETURN (u.format10.sanitize (c)); + case 12: return TRACE_RETURN (u.format12.sanitize (c)); + case 13: return TRACE_RETURN (u.format13.sanitize (c)); + default:return TRACE_RETURN (true); + } + } + + protected: + union { + USHORT format; /* Format identifier */ + CmapSubtableFormat0 format0; + CmapSubtableFormat4 format4; + CmapSubtableFormat6 format6; + CmapSubtableFormat10 format10; + CmapSubtableFormat12 format12; + CmapSubtableFormat13 format13; + } u; + public: + DEFINE_SIZE_UNION (2, format); +}; + + +struct EncodingRecord +{ + int cmp (const EncodingRecord &other) const + { + int ret; + ret = other.platformID.cmp (platformID); + if (ret) return ret; + ret = other.encodingID.cmp (encodingID); + if (ret) return ret; + return 0; + } + + inline bool sanitize (hb_sanitize_context_t *c, void *base) { + TRACE_SANITIZE (this); + return TRACE_RETURN (c->check_struct (this) && + subtable.sanitize (c, base)); + } + + USHORT platformID; /* Platform ID. */ + USHORT encodingID; /* Platform-specific encoding ID. */ + LongOffsetTo<CmapSubtable> + subtable; /* Byte offset from beginning of table to the subtable for this encoding. */ + public: + DEFINE_SIZE_STATIC (8); +}; + +struct cmap +{ + static const hb_tag_t tableTag = HB_OT_TAG_cmap; + + inline const CmapSubtable *find_subtable (unsigned int platform_id, + unsigned int encoding_id) const + { + EncodingRecord key; + key.platformID.set (platform_id); + key.encodingID.set (encoding_id); + + int result = encodingRecord.search (key); + if (result == -1) + return NULL; + + return &(this+encodingRecord[result].subtable); + } + + inline bool sanitize (hb_sanitize_context_t *c) { + TRACE_SANITIZE (this); + return TRACE_RETURN (c->check_struct (this) && + likely (version == 0) && + encodingRecord.sanitize (c, this)); + } + + USHORT version; /* Table version number (0). */ + ArrayOf<EncodingRecord> encodingRecord; /* Encoding tables. */ + public: + DEFINE_SIZE_ARRAY (4, encodingRecord); +}; + + +} /* namespace OT */ + + +#endif /* HB_OT_CMAP_TABLE_HH */ diff --git a/Build/source/libs/lua52/ChangeLog b/Build/source/libs/lua52/ChangeLog index 1098c44d2dc..cb0a43c5918 100644 --- a/Build/source/libs/lua52/ChangeLog +++ b/Build/source/libs/lua52/ChangeLog @@ -1,3 +1,7 @@ +2014-06-02 Peter Breitenlohner <peb@mppmu.mpg.de> + + * Makefile.am (AM_CPPFLAGS): Drop LUAI_HASHLIMIT. + 2014-03-21 Peter Breitenlohner <peb@mppmu.mpg.de> * configure.ac: Add -DHAVE_UNISTD_H to LUA52_DEFINES because diff --git a/Build/source/libs/lua52/Makefile.am b/Build/source/libs/lua52/Makefile.am index 7b53e991372..3eb696515d6 100644 --- a/Build/source/libs/lua52/Makefile.am +++ b/Build/source/libs/lua52/Makefile.am @@ -1,4 +1,4 @@ -## Proxy Makefile.am to build lua52 for TeX Live. +## Proxy Makefile.am to build Lua52 for TeX Live. ## ## Copyright (C) 2013, 2014 Peter Breitenlohner <tex-live@tug.org> ## @@ -6,9 +6,7 @@ ## gives unlimited permission to copy and/or distribute it, ## with or without modifications, as long as this notice is preserved. ## -ACLOCAL_AMFLAGS = -I ../../m4 - -## We want to re-distribute the whole original zlib source tree. +## We want to re-distribute the whole Lua52 source tree. ## EXTRA_DIST = $(LUA52_TREE) @@ -22,7 +20,7 @@ dist-hook: SUBDIRS = . include -AM_CPPFLAGS = -I$(top_srcdir)/$(LUA52_TREE)/src $(LUA52_DEFINES) -DLUAI_HASHLIMIT=6 +AM_CPPFLAGS = -I$(top_srcdir)/$(LUA52_TREE)/src $(LUA52_DEFINES) AM_CFLAGS = $(WARNING_CFLAGS) noinst_LIBRARIES = liblua52.a diff --git a/Build/source/libs/lua52/Makefile.in b/Build/source/libs/lua52/Makefile.in index e85871336dd..c15bfae71af 100644 --- a/Build/source/libs/lua52/Makefile.in +++ b/Build/source/libs/lua52/Makefile.in @@ -574,10 +574,9 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -ACLOCAL_AMFLAGS = -I ../../m4 EXTRA_DIST = $(LUA52_TREE) $(LUA52_TREE)-PATCHES error.exp SUBDIRS = . include -AM_CPPFLAGS = -I$(top_srcdir)/$(LUA52_TREE)/src $(LUA52_DEFINES) -DLUAI_HASHLIMIT=6 +AM_CPPFLAGS = -I$(top_srcdir)/$(LUA52_TREE)/src $(LUA52_DEFINES) AM_CFLAGS = $(WARNING_CFLAGS) noinst_LIBRARIES = liblua52.a nodist_liblua52_a_SOURCES = \ diff --git a/Build/source/libs/lua52/configure b/Build/source/libs/lua52/configure index bdb379d9a7c..c7e30434d3d 100755 --- a/Build/source/libs/lua52/configure +++ b/Build/source/libs/lua52/configure @@ -5170,7 +5170,7 @@ fi done -LUA52_DEFINES=-DLUA_COMPAT_MODULE +LUA52_DEFINES='-DLUA_COMPAT_MODULE -DLUAI_HASHLIMIT=6' if test "x$kpse_cv_have_win32" = xno; then LUA52_DEFINES="$LUA52_DEFINES -DLUA_USE_POSIX" diff --git a/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/ChangeLog b/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/ChangeLog index f57e15b4b73..0fa9944f9df 100644 --- a/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/ChangeLog +++ b/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/ChangeLog @@ -1,3 +1,9 @@ +2014-06-01 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-05-LuaJITTeX (lj_str_new): Replace '6' by LUAI_HASHLIMIT + and use '#define LUAI_HASHLIMIT 5' as default as in + ../../libs/lua52/lua-5.2.3/src/lstring.c. + 2014-03-14 Peter Breitenlohner <peb@mppmu.mpg.de> Import LuaJIT-2.0.3. diff --git a/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-05-LuaJITTeX b/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-05-LuaJITTeX index d1e95b59f06..a33bf70ea4e 100644 --- a/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-05-LuaJITTeX +++ b/Build/source/libs/luajit/LuaJIT-2.0.3-PATCHES/patch-05-LuaJITTeX @@ -12,17 +12,25 @@ diff -ur -x lbitlib.c LuaJIT-2.0.3.orig/src/lj_def.h LuaJIT-2.0.3/src/lj_def.h #define LJ_STACK_EXTRA 5 /* Extra stack space (metamethods). */ diff -ur -x lbitlib.c LuaJIT-2.0.3.orig/src/lj_str.c LuaJIT-2.0.3/src/lj_str.c --- LuaJIT-2.0.3.orig/src/lj_str.c 2014-03-12 13:10:00.000000000 +0100 -+++ LuaJIT-2.0.3/src/lj_str.c 2014-03-14 10:04:14.540946490 +0100 -@@ -90,6 +90,8 @@ ++++ LuaJIT-2.0.3/src/lj_str.c 2014-06-02 14:10:04.000000000 +0200 +@@ -90,6 +90,16 @@ g->strhash = newhash; } ++/* ++** Lua will use at most ~(2^LUAI_HASHLIMIT) bytes from a string to ++** compute its hash ++*/ ++#if !defined(LUAI_HASHLIMIT) ++#define LUAI_HASHLIMIT 5 ++#endif ++ +#define cast(t, exp) ((t)(exp)) +int luajittex_choose_hash_function = 0 ; /* Intern a string and return string object. */ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx) { -@@ -98,27 +100,44 @@ +@@ -98,27 +108,44 @@ GCobj *o; MSize len = (MSize)lenx; MSize a, b, h = len; @@ -37,7 +45,7 @@ diff -ur -x lbitlib.c LuaJIT-2.0.3.orig/src/lj_str.c LuaJIT-2.0.3/src/lj_str.c + if (luajittex_choose_hash_function==0) { + /* Lua 5.1.5 hash function */ + /* for 5.2 max methods we also need to patch the vm eq */ -+ step = (len>>6)+1; /* if string is too long, don't hash all its chars Was 5, we try 6*/ ++ step = (len>>LUAI_HASHLIMIT)+1; /* if string is too long, don't hash all its chars */ + for (l1=len; l1>=step; l1-=step) /* compute hash */ + h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1])); + } else { diff --git a/Build/source/libs/luajit/LuaJIT-2.0.3/src/lj_str.c b/Build/source/libs/luajit/LuaJIT-2.0.3/src/lj_str.c index 62ad5e891f5..b5fd45e5004 100644 --- a/Build/source/libs/luajit/LuaJIT-2.0.3/src/lj_str.c +++ b/Build/source/libs/luajit/LuaJIT-2.0.3/src/lj_str.c @@ -90,6 +90,14 @@ void lj_str_resize(lua_State *L, MSize newmask) g->strhash = newhash; } +/* +** Lua will use at most ~(2^LUAI_HASHLIMIT) bytes from a string to +** compute its hash +*/ +#if !defined(LUAI_HASHLIMIT) +#define LUAI_HASHLIMIT 5 +#endif + #define cast(t, exp) ((t)(exp)) int luajittex_choose_hash_function = 0 ; /* Intern a string and return string object. */ @@ -111,7 +119,7 @@ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx) if (luajittex_choose_hash_function==0) { /* Lua 5.1.5 hash function */ /* for 5.2 max methods we also need to patch the vm eq */ - step = (len>>6)+1; /* if string is too long, don't hash all its chars Was 5, we try 6*/ + step = (len>>LUAI_HASHLIMIT)+1; /* if string is too long, don't hash all its chars */ for (l1=len; l1>=step; l1-=step) /* compute hash */ h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1])); } else { diff --git a/Build/source/libs/luajit/Makefile.am b/Build/source/libs/luajit/Makefile.am index 344e7f60f45..e32186a5f79 100644 --- a/Build/source/libs/luajit/Makefile.am +++ b/Build/source/libs/luajit/Makefile.am @@ -1,10 +1,10 @@ -## Makefile.am for the TeX Live subdirectory libs/luajit/native/ +## Proxy Makefile.am to build LuaJIT for TeX Live. ## ## Copyright (C) 2014 Luigi Scarso <luigi.scarso@gmail.com> ## Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. ## -## We want to re-distribute the whole original luajit source tree. +## We want to re-distribute the whole original LuaJIT source tree. ## EXTRA_DIST = $(LUAJIT_TREE) diff --git a/Build/source/libs/luajit/configure b/Build/source/libs/luajit/configure index 1f36913ba1f..a2ae6dde03b 100755 --- a/Build/source/libs/luajit/configure +++ b/Build/source/libs/luajit/configure @@ -3767,6 +3767,11 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +if test "x$host_alias" != x && test "x$build_alias" = x; then : + as_fn_error $? "when cross-compiling you must specify both --host and --build." "$LINENO" 5 +fi +eval kpse_build_alias=\${build_alias-$build} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4844,7 +4849,7 @@ if test "$ac_res" != no; then : fi -LUAJIT_DEFINES=-DLUAJIT_ENABLE_LUA52COMPAT +LUAJIT_DEFINES='-DLUAJIT_ENABLE_LUA52COMPAT -DLUAI_HASHLIMIT=6' case $host_os:$host_cpu in #( *darwin*:x86_64) : @@ -5465,6 +5470,7 @@ ac_config_files="$ac_config_files Makefile include/Makefile" + subdirs="$subdirs native" @@ -6921,10 +6927,12 @@ test $ac_write_fail = 0 || ac_configure_args="$ac_configure_args DASM_ARCH=$DASM_ARCH" if test "x$cross_compiling" = xyes; then : - cache_file=/dev/null - ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \ - CC='$BUILDCC' CPPFLAGS='$BUILDCPPFLAGS'\ - CFLAGS='$BUILDCFLAGS' LDFLAGS='$BUILDLDFLAGS'" + if test "x$cache_file" != x/dev/null; then : + cache_file=config.cache +fi +ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \ +CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \ +CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'" fi # configure is writing to config.log, and then calls config.status. diff --git a/Build/source/libs/luajit/configure.ac b/Build/source/libs/luajit/configure.ac index 38ba43f560e..9d3f891d75d 100644 --- a/Build/source/libs/luajit/configure.ac +++ b/Build/source/libs/luajit/configure.ac @@ -15,7 +15,7 @@ AC_CONFIG_MACRO_DIRS([../../m4 m4]) KPSE_BASIC([luajit]) -AC_CANONICAL_HOST +KPSE_CANONICAL_HOST AC_PROG_CC AM_PROG_AS @@ -62,16 +62,9 @@ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile include/Makefile]) -AC_CONFIG_SUBDIRS([native]) - dnl Pass DASM_ARCH to the subdirectory native, dnl which must be configured for the build system. -dnl When cross compiling, can not share the cache file with the subdirectory! -AC_CONFIG_COMMANDS_POST([ac_configure_args="$ac_configure_args DASM_ARCH=$DASM_ARCH" -AS_IF([test "x$cross_compiling" = xyes], - [cache_file=/dev/null - ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \ - CC='$BUILDCC' CPPFLAGS='$BUILDCPPFLAGS'\ - CFLAGS='$BUILDCFLAGS' LDFLAGS='$BUILDLDFLAGS'"])]) +AC_CONFIG_COMMANDS_POST([ac_configure_args="$ac_configure_args DASM_ARCH=$DASM_ARCH"]) +KPSE_NATIVE_SUBDIRS([native]) AC_OUTPUT diff --git a/Build/source/libs/luajit/native/Makefile.in b/Build/source/libs/luajit/native/Makefile.in index b0b90971f21..0da973b5ca1 100644 --- a/Build/source/libs/luajit/native/Makefile.in +++ b/Build/source/libs/luajit/native/Makefile.in @@ -95,6 +95,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../../m4/kpse-common.m4 \ $(top_srcdir)/../../../m4/kpse-luajit-flags.m4 \ + $(top_srcdir)/../../../m4/kpse-search-libs.m4 \ $(top_srcdir)/../../../m4/kpse-warnings.m4 \ $(top_srcdir)/../version.ac $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/Build/source/libs/luajit/native/aclocal.m4 b/Build/source/libs/luajit/native/aclocal.m4 index 62977e15511..6da5fe3f569 100644 --- a/Build/source/libs/luajit/native/aclocal.m4 +++ b/Build/source/libs/luajit/native/aclocal.m4 @@ -1185,4 +1185,5 @@ AC_SUBST([am__untar]) m4_include([../../../m4/kpse-common.m4]) m4_include([../../../m4/kpse-luajit-flags.m4]) +m4_include([../../../m4/kpse-search-libs.m4]) m4_include([../../../m4/kpse-warnings.m4]) diff --git a/Build/source/libs/luajit/native/configure b/Build/source/libs/luajit/native/configure index 5dd00401042..0a943985893 100755 --- a/Build/source/libs/luajit/native/configure +++ b/Build/source/libs/luajit/native/configure @@ -4444,7 +4444,7 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -LUAJIT_DEFINES=-DLUAJIT_ENABLE_LUA52COMPAT +LUAJIT_DEFINES='-DLUAJIT_ENABLE_LUA52COMPAT -DLUAI_HASHLIMIT=6' case $host_os:$host_cpu in #( *darwin*:x86_64) : @@ -4455,7 +4455,7 @@ esac -lj_save_LIBS=$LIBS +kpse_search_save_LIBS=$LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pow" >&5 $as_echo_n "checking for library containing pow... " >&6; } if ${ac_cv_search_pow+:} false; then : @@ -4512,7 +4512,7 @@ if test "$ac_res" != no; then : fi -LIBS=$lj_save_LIBS +LIBS=$kpse_search_save_LIBS case $ac_cv_search_pow in #( "none required") : ;; #( diff --git a/Build/source/libs/luajit/native/configure.ac b/Build/source/libs/luajit/native/configure.ac index f023c94b15e..0eee8bb1b0e 100644 --- a/Build/source/libs/luajit/native/configure.ac +++ b/Build/source/libs/luajit/native/configure.ac @@ -20,14 +20,7 @@ AC_PROG_LN_S KPSE_LUAJIT_DEFINES -lj_save_LIBS=$LIBS -AC_SEARCH_LIBS([pow], [m]) -LIBS=$lj_save_LIBS -AS_CASE([$ac_cv_search_pow], - ["none required"], [], - [no], [AC_MSG_ERROR([Sorry, did not find pow()])], - [MATH_LIB=$ac_cv_search_pow]) -AC_SUBST([MATH_LIB]) +KPSE_SEARCH_LIBS([MATH_LIB], [pow], [m]) AC_SUBST([DASM_ARCH]) |