beta-0.89.2
[luatex.git] / source / m4 / kpse-dll-name.m4
blobba6a40968013090f8682fb8f2c2e806a02741aad
1 # Public macros for the TeX Live (TL) tree.
2 # Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
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.
8 # KPSE_DLL_NAME([M32], [M64], [C32], [C64])
9 # -----------------------------------------
10 # Specify the DLL name for 32- and/or 64-bit MinGW and/or Cywin.
11 AC_DEFUN([KPSE_DLL_NAME], [dnl
12 AC_PROVIDE_IFELSE([LT_INIT], ,
13                   [m4_fatal([$0: requires libtool])])[]dnl
14 AC_PROVIDE_IFELSE([LT_OUTPUT],
15                   [m4_fatal([$0: too late])])[]dnl
16 AC_CHECK_SIZEOF([void *])
17 AS_CASE([$host:$ac_cv_sizeof_void_p],
18         [*-*-mingw*:4], [kpse_dll_name=$1],
19         [*-*-mingw*:8], [kpse_dll_name=$2],
20         [*-*-cygwin:4], [kpse_dll_name=$3],
21         [*-*-cygwin:8], [kpse_dll_name=$4],
22         [kpse_dll_name=])
23 _LT_CONFIG_SAVE_COMMANDS([## $0: Specify the DLL name
24 if test "x$kpse_dll_name" != x; then
25   $SED '/^soname_spec=/a\
26 ## $0: Specify the DLL name\
27 soname_spec='$kpse_dll_name'.dll\
28 ' "$ofile" >"$cfgfile"
29   mv "$cfgfile" "$ofile" ||
30     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
31   chmod +x "$ofile"
32 fi], [kpse_dll_name='$kpse_dll_name'])
33 ]) # KPSE_DLL_NAME