| 1 |
# Public macros for the TeX Live (TL) tree. |
| 2 |
# Copyright (C) 2014 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_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 |