| 1 |
# Private macros for the TeX Live (TL) tree. |
| 2 |
# Copyright (C) 2009-2015 Peter Breitenlohner <[email protected]> |
| 3 |
# |
| 4 |
# This file is free software; the copyright holder |
| 5 |
# gives unlimited permission to copy and/or distribute it, |
| 6 |
# with or without modifications, as long as this notice is preserved. |
| 7 |
|
| 8 |
# KPSE_WEB2C_PREPARE |
| 9 |
# ------------------ |
| 10 |
# AC_DEFUN'ed so it can enforce inclusion of this file. |
| 11 |
AC_DEFUN([KPSE_WEB2C_PREPARE], []) |
| 12 |
|
| 13 |
# KPSE_WITH_XTEX(PROG, BUILD-OR-NO, SYNC-OR-NO, TEXT, REQUIRED-LIBS) |
| 14 |
# ------------------------------------------------------------------ |
| 15 |
# Provide and normalize the configure options --enable-*tex. |
| 16 |
m4_define([KPSE_WITH_XTEX], [dnl |
| 17 |
AC_ARG_ENABLE([$1], |
| 18 |
AS_HELP_STRING([--]m4_if([$2], [yes], [dis], [en])[able-$1], |
| 19 |
m4_if([$2], [yes], |
| 20 |
[do not ])[compile and install $4], |
| 21 |
kpse_indent_26))[]dnl |
| 22 |
AS_CASE([$enable_$1], |
| 23 |
[yes | no], , |
| 24 |
[enable_$1=$2]) |
| 25 |
m4_ifval([$3], [ |
| 26 |
AC_ARG_ENABLE([$1-synctex], |
| 27 |
AS_HELP_STRING([--]m4_if([$3], [yes], [dis], [en])[able-$1-synctex], |
| 28 |
[build $4 with]m4_if([$3], [yes], [out])[ SyncTeX support], |
| 29 |
m4_eval(kpse_indent_26+2)))[]dnl |
| 30 |
])[]dnl m4_ifval |
| 31 |
m4_ifval([$5], [ |
| 32 |
test "x$enable_web2c:$enable_$1" = xyes:yes && { |
| 33 |
AC_FOREACH([Kpse_Lib], [$5], [ need_[]AS_TR_SH(Kpse_Lib)=yes |
| 34 |
])} |
| 35 |
])[]dnl m4_ifval |
| 36 |
]) # KPSE_WITH_XTEX |
| 37 |
|
| 38 |
# KPSE_XTEX_COND(PROG, BUILD-OR-NO, SYNC-OR-NO, TEXT, REQUIRED-LIBS) |
| 39 |
# ------------------------------------------------------------------ |
| 40 |
# Normalize --enable-*tex-synctex configure option and build conditionals. |
| 41 |
m4_define([KPSE_XTEX_COND], [dnl |
| 42 |
AM_CONDITIONAL(AS_TR_CPP($1), [test "x$enable_$1" = xyes])[]dnl |
| 43 |
m4_ifval([$3], [ |
| 44 |
AS_CASE([$enable_native_texlive_build:$enable_$1_synctex], |
| 45 |
[yes:$3 | no:yes | no:no], , |
| 46 |
[AS_IF([test -z "$enable_$1_synctex"], |
| 47 |
[AC_MSG_NOTICE([Assuming `--enable-$1-synctex=$3'])], |
| 48 |
[AC_MSG_WARN([Enforcing `--enable-$1-synctex=$3' (native TeX Live build)])]) |
| 49 |
enable_$1_synctex=$3]) |
| 50 |
AM_CONDITIONAL(AS_TR_CPP($1)[_SYNCTEX], [test "x$enable_$1_synctex" = xyes])[]dnl |
| 51 |
])[]dnl m4_ifval |
| 52 |
]) # KPSE_XTEX_COND |
| 53 |
|
| 54 |
# KPSE_WITH_XMF(PROG, BUILD-OR-NO, NOWIN-OR-NO, TEXT, REQUIRED-LIBS) |
| 55 |
# ------------------------------------------------------------------ |
| 56 |
# Provide and normalize the configure options --enable-mf*. |
| 57 |
m4_define([KPSE_WITH_XMF], [dnl |
| 58 |
AC_ARG_ENABLE([$1], |
| 59 |
AS_HELP_STRING([--]m4_if([$2], [yes], [dis], [en])[able-$1], |
| 60 |
m4_if([$2], [yes], |
| 61 |
[do not ])[compile and install $4], |
| 62 |
kpse_indent_26))[]dnl |
| 63 |
AS_CASE([$enable_$1], |
| 64 |
[yes | no], , |
| 65 |
[enable_$1=$2]) |
| 66 |
m4_ifval([$3], [ |
| 67 |
AC_ARG_ENABLE([$1-nowin], |
| 68 |
AS_HELP_STRING([--]m4_if([$3], [yes], [dis], [en])[able-$1-nowin], |
| 69 |
m4_if([$3], [yes], |
| 70 |
[do not ])[build a separate non-window-capable $4], |
| 71 |
m4_eval(kpse_indent_26+2)))[]dnl |
| 72 |
AS_CASE([$enable_$1_nowin], |
| 73 |
[yes | no], , |
| 74 |
[enable_$1_nowin=$3]) |
| 75 |
])[]dnl m4_ifval |
| 76 |
m4_ifval([$5], [ |
| 77 |
test "x$enable_web2c:$enable_$1" = xyes:yes && { |
| 78 |
AC_FOREACH([Kpse_Lib], [$5], [ need_[]AS_TR_SH(Kpse_Lib)=yes |
| 79 |
])} |
| 80 |
])[]dnl m4_ifval |
| 81 |
]) # KPSE_WITH_XMF |
| 82 |
|
| 83 |
# KPSE_XMF_COND(PROG, BUILD-OR-NO, NOWIN-OR-NO, TEXT, REQUIRED-LIBS) |
| 84 |
# ------------------------------------------------------------------ |
| 85 |
# Build conditionals and adjust with_x. |
| 86 |
m4_define([KPSE_XMF_COND], [dnl |
| 87 |
AM_CONDITIONAL(AS_TR_CPP($1), [test "x$enable_$1" != xno])[]dnl |
| 88 |
test "x$enable_$1" = xyes && : ${with_x=yes} |
| 89 |
m4_ifval([$3], [ |
| 90 |
AM_CONDITIONAL(AS_TR_CPP($1)[N], [test "x$enable_$1_nowin" != xno])[]dnl |
| 91 |
])[]dnl m4_ifval |
| 92 |
]) # KPSE_XMF_COND |
| 93 |
|
| 94 |
# KPSE_WITH_MFWIN(WINDOW, DEFINE, TEXT) |
| 95 |
# ------------------------------------- |
| 96 |
# Provide configure options --enable-*win. |
| 97 |
m4_define([KPSE_WITH_MFWIN], [dnl |
| 98 |
AC_ARG_ENABLE([$1win], |
| 99 |
AS_HELP_STRING([--enable-$1win], |
| 100 |
[include $3 window support], |
| 101 |
m4_eval(kpse_indent_26+2)))[]dnl |
| 102 |
]) # KPSE_WITH_MFWIN |
| 103 |
|
| 104 |
# KPSE_MFWIN_DEFINE(WINDOW, DEFINE, TEXT) |
| 105 |
# --------------------------------------- |
| 106 |
# Defines for enable-*win |
| 107 |
m4_define([KPSE_MFWIN_DEFINE], [dnl |
| 108 |
AS_IF([test "x$enable_$1win" = xyes], |
| 109 |
[AC_DEFINE([$2WIN], , |
| 110 |
[metafont: Define to include $3 window support.])]) |
| 111 |
]) # KPSE_MFWIN_DEFINE |