beta-0.89.2
[luatex.git] / source / m4 / kpse-search-libs.m4
blobff24c0f40bf6f0f40d7d4df052e4f7fb8a4ec8be
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_SEARCH_LIBS(VARIABLE, FUNCTION, SEARCH-LIBS, [ACTION-IF-NOT-FOUND])
9 # ------------------------------------------------------------------------
10 # Search for a library defining FUNCTION, if it's not already available and
11 # set the output variable VARIABLE to the required lib.
12 # If FUNCTION is not found, the shell code ACTION-IF-NOT-FOUND if given or
13 # AC_MSG_ERROR with a suitable text is executed.
14 AC_DEFUN([KPSE_SEARCH_LIBS], [dnl
15 kpse_search_save_LIBS=$LIBS
16 AC_SEARCH_LIBS([$2], [$3])
17 LIBS=$kpse_search_save_LIBS
18 AS_CASE([$ac_cv_search_$2],
19         ["none required"], [],
20         [no], [m4_ifval([$4], [$4], [AC_MSG_ERROR([Sorry, did not find $2()])])],
21         [$1=$ac_cv_search_$2])
22 AC_SUBST([$1])[]dnl
23 ]) # KPSE_SEARCH_LIBS