summaryrefslogtreecommitdiff
path: root/Build/source/m4
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-11 02:12:09 +0000
committerKarl Berry <karl@freefriends.org>2019-01-11 02:12:09 +0000
commit07d257bc6c9c792bf39ac6685f5d449c0a110224 (patch)
treefeebf9dc0b92731104eee4d5c3600d450b27c050 /Build/source/m4
parent058365ca5e7e5743a7272fd6d411c5e754828bcc (diff)
openbsd + clang + luajit -> -lc++abi -lpthread
git-svn-id: svn://tug.org/texlive/trunk@49669 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r--Build/source/m4/ChangeLog6
-rw-r--r--Build/source/m4/kpse-luajit-flags.m452
2 files changed, 55 insertions, 3 deletions
diff --git a/Build/source/m4/ChangeLog b/Build/source/m4/ChangeLog
index 7560a2fa65e..7bd4039e99f 100644
--- a/Build/source/m4/ChangeLog
+++ b/Build/source/m4/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-10 Karl Berry <karl@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@tug.org>
* kpse-pkgs.m4 (KPSE_LIBS_PKGS): lua52 gone.
diff --git a/Build/source/m4/kpse-luajit-flags.m4 b/Build/source/m4/kpse-luajit-flags.m4
index e846c3087f2..bb8cd04e499 100644
--- a/Build/source/m4/kpse-luajit-flags.m4
+++ b/Build/source/m4/kpse-luajit-flags.m4
@@ -1,5 +1,7 @@
+# $Id$
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+# Copyright 2019 Karl Berry <tex-live@tug.org>
+# Copyright 2014 Peter Breitenlohner <tex-live@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