texlive[49669] Build/source: openbsd + clang + luajit -> -lc++abi

commits+karl at tug.org commits+karl at tug.org
Fri Jan 11 03:12:09 CET 2019


Revision: 49669
          http://tug.org/svn/texlive?view=revision&revision=49669
Author:   karl
Date:     2019-01-11 03:12:09 +0100 (Fri, 11 Jan 2019)
Log Message:
-----------
openbsd + clang + luajit -> -lc++abi -lpthread

Modified Paths:
--------------
    trunk/Build/source/m4/ChangeLog
    trunk/Build/source/m4/kpse-luajit-flags.m4
    trunk/Build/source/texk/web2c/configure

Modified: trunk/Build/source/m4/ChangeLog
===================================================================
--- trunk/Build/source/m4/ChangeLog	2019-01-11 01:23:43 UTC (rev 49668)
+++ trunk/Build/source/m4/ChangeLog	2019-01-11 02:12:09 UTC (rev 49669)
@@ -1,3 +1,9 @@
+2019-01-10  Karl Berry  <karl at freefriends.org>
+
+	* kpse-luajit-flags.m4 (KPSE_LUAJIT_FLAGS): check for
+	-lc++abi -lpthread, needed with clang on openbsd.
+	Test from Mojca.
+
 2019-01-08  Karl Berry  <karl at tug.org>
 
 	* kpse-pkgs.m4 (KPSE_LIBS_PKGS): lua52 gone.

Modified: trunk/Build/source/m4/kpse-luajit-flags.m4
===================================================================
--- trunk/Build/source/m4/kpse-luajit-flags.m4	2019-01-11 01:23:43 UTC (rev 49668)
+++ trunk/Build/source/m4/kpse-luajit-flags.m4	2019-01-11 02:12:09 UTC (rev 49669)
@@ -1,5 +1,7 @@
+# $Id$
 # Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2014 Peter Breitenlohner <tex-live at tug.org>
+# Copyright 2019 Karl Berry <tex-live at tug.org>
+# Copyright 2014 Peter Breitenlohner <tex-live at tug.org>
 #
 # This file is free software; the copyright holder
 # gives unlimited permission to copy and/or distribute it,
@@ -10,9 +12,53 @@
 # Set the make variables LUAJIT_INCLUDES and LUAJIT_LIBS to the CPPFLAGS and
 # LIBS required for the `-ltexluajit' library in libs/luajit/ of the TL tree.
 AC_DEFUN([KPSE_LUAJIT_FLAGS], [dnl
+echo 'tldbg:[$0] called.' >&AS_MESSAGE_LOG_FD
 _KPSE_LIB_FLAGS([luajit], [texluajit], [lt tree],
-                [-IBLD/libs/luajit/include], [BLD/libs/luajit/libtexluajit.la], [],
-                [], [${top_builddir}/../../libs/luajit/include/luajit.h])[]dnl
+                [-IBLD/libs/luajit/include],
+                [BLD/libs/luajit/libtexluajit.la],
+                [],
+                [],
+                [${top_builddir}/../../libs/luajit/include/luajit.h])[]dnl
+#
+# checking for openbsd for additional jit libraries needed, which is the
+# case for clang; no point in going to the trouble elsewhere since no
+# other system needs it.
+case $build_os in
+openbsd*)
+AC_MSG_CHECKING([on openbsd if additional jit libraries are needed])
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM(
+    [[#include "stdint.h"
+      typedef struct _Unwind_Context _Unwind_Context;
+      extern uintptr_t _Unwind_GetCFA(_Unwind_Context *);]],
+    [[_Unwind_Context *ctx;
+      _Unwind_GetCFA(ctx);]]
+  )],
+  [AC_MSG_RESULT([no])],
+  [
+    jitlibs="-lc++abi -lpthread"
+    save_LIBS=$LIBS
+    LIBS="$LIBS $jitlibs"
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+        [[#include "stdint.h"
+          typedef struct _Unwind_Context _Unwind_Context;
+          extern uintptr_t _Unwind_GetCFA(_Unwind_Context *);]],
+        [[_Unwind_Context *ctx;
+          _Unwind_GetCFA(ctx);]]
+      )],
+      [
+        AC_MSG_RESULT(["$jitlibs"])
+        LUAJIT_LIBS="$LUAJIT_LIBS $jitlibs"
+      ],
+      [AC_MSG_FAILURE([luajit could not be linked])]
+    )
+    LIBS=$save_LIBS
+  ]
+)
+  ;;
+esac
+echo 'tldbg:[$0] done.' >&AS_MESSAGE_LOG_FD
 ]) # KPSE_LUAJIT_FLAGS
 
 # KPSE_LUAJIT_DEFINES

Modified: trunk/Build/source/texk/web2c/configure
===================================================================
--- trunk/Build/source/texk/web2c/configure	2019-01-11 01:23:43 UTC (rev 49668)
+++ trunk/Build/source/texk/web2c/configure	2019-01-11 02:12:09 UTC (rev 49669)
@@ -25007,6 +25007,7 @@
 ${top_builddir}/../../libs/lua52/include/lua.h:
 	cd ${top_builddir}/../../libs/lua52 && $(MAKE) $(AM_MAKEFLAGS) rebuild'
 
+echo 'tldbg:KPSE_LUAJIT_FLAGS called.' >&5
 ##tldbg _KPSE_LIB_FLAGS: Setup luajit (-ltexluajit) flags.
 echo 'tldbg:_KPSE_LIB_FLAGS called: libdir=luajit, libname=texluajit, options=lt tree, tlincl=-IBLD/libs/luajit/include, tllib=BLD/libs/luajit/libtexluajit.la, tlextra=, rebuildsrcdeps=, rebuildblddeps=${top_builddir}/../../libs/luajit/include/luajit.h.' >&5
 ##tldbg _KPSE_LIB_FLAGS_TL: luajit (texluajit) lt tree.
@@ -25018,7 +25019,77 @@
 	cd ${top_builddir}/../../libs/luajit && $(MAKE) $(AM_MAKEFLAGS) rebuild
 ${top_builddir}/../../libs/luajit/include/luajit.h:
 	cd ${top_builddir}/../../libs/luajit && $(MAKE) $(AM_MAKEFLAGS) rebuild'
+#
+# checking for openbsd for additional jit libraries needed, which is the
+# case for clang; no point in going to the trouble elsewhere since no
+# other system needs it.
+case $build_os in
+openbsd*)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking on openbsd if additional jit libraries are needed" >&5
+$as_echo_n "checking on openbsd if additional jit libraries are needed... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "stdint.h"
+      typedef struct _Unwind_Context _Unwind_Context;
+      extern uintptr_t _Unwind_GetCFA(_Unwind_Context *);
+int
+main ()
+{
+_Unwind_Context *ctx;
+      _Unwind_GetCFA(ctx);
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+
+    jitlibs="-lc++abi -lpthread"
+    save_LIBS=$LIBS
+    LIBS="$LIBS $jitlibs"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "stdint.h"
+          typedef struct _Unwind_Context _Unwind_Context;
+          extern uintptr_t _Unwind_GetCFA(_Unwind_Context *);
+int
+main ()
+{
+_Unwind_Context *ctx;
+          _Unwind_GetCFA(ctx);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$jitlibs\"" >&5
+$as_echo "\"$jitlibs\"" >&6; }
+        LUAJIT_LIBS="$LUAJIT_LIBS $jitlibs"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "luajit could not be linked
+See \`config.log' for more details" "$LINENO" 5; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LIBS=$save_LIBS
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  ;;
+esac
+echo 'tldbg:KPSE_LUAJIT_FLAGS done.' >&5
+
 ##tldbg _KPSE_LIB_FLAGS: Setup libpng (-lpng) flags.
 echo 'tldbg:_KPSE_LIB_FLAGS called: libdir=libpng, libname=png, options=, tlincl=-IBLD/libs/libpng/include, tllib=BLD/libs/libpng/libpng.a, tlextra=, rebuildsrcdeps=, rebuildblddeps=${top_builddir}/../../libs/libpng/include/png.h.' >&5
 ##tldbg _KPSE_LIB_FLAGS_TL: libpng (png) .



More information about the tex-live-commits mailing list