| 1 | dnl -*-fundamental-*- |
| 2 | dnl |
| 3 | dnl $Id: aclocal.m4,v 1.2 1997/08/04 10:24:19 mdw Exp $ |
| 4 | dnl |
| 5 | dnl Configuration macros for `become' |
| 6 | dnl |
| 7 | dnl (c) 1997 Mark Wooding |
| 8 | dnl |
| 9 | |
| 10 | dnl----- Licensing notice --------------------------------------------------- |
| 11 | dnl |
| 12 | dnl This file is part of `become' |
| 13 | dnl |
| 14 | dnl `Become' is free software; you can redistribute it and/or modify |
| 15 | dnl it under the terms of the GNU General Public License as published by |
| 16 | dnl the Free Software Foundation; either version 2 of the License, or |
| 17 | dnl (at your option) any later version. |
| 18 | dnl |
| 19 | dnl `Become' is distributed in the hope that it will be useful, |
| 20 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | dnl GNU General Public License for more details. |
| 23 | dnl |
| 24 | dnl You should have received a copy of the GNU General Public License |
| 25 | dnl along with `become'; if not, write to the Free Software Foundation, |
| 26 | dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 27 | |
| 28 | dnl----- Revision history --------------------------------------------------- |
| 29 | dnl |
| 30 | dnl $Log: aclocal.m4,v $ |
| 31 | dnl Revision 1.2 1997/08/04 10:24:19 mdw |
| 32 | dnl Sources placed under CVS control. |
| 33 | dnl |
| 34 | |
| 35 | dnl MDW_CHECK_MANYLIBS(FUNC, LIBS, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 36 | dnl |
| 37 | dnl Tries to find FUNC in one of the space-separated libraries given in LIBS. |
| 38 | dnl The first one to match is added to the LIBS variable. |
| 39 | |
| 40 | AC_DEFUN(MDW_CHECK_MANYLIBS,[ |
| 41 | AC_CACHE_CHECK([for library containing $1], [mdw_cv_lib_$1], |
| 42 | [mdw_save_LIBS="$LIBS" |
| 43 | mdw_cv_lib_$1="no" |
| 44 | AC_TRY_LINK(,[$1()], [mdw_cv_lib_$1="none required"]) |
| 45 | test "$mdw_cv_lib_$1" = "no" && for i in $2; do |
| 46 | LIBS="-l$i $mdw_save_LIBS" |
| 47 | AC_TRY_LINK(,[$1()], |
| 48 | [mdw_cv_lib_$1="-l$i" |
| 49 | break]) |
| 50 | done |
| 51 | LIBS="$mdw_save_LIBS"]) |
| 52 | if test "$mdw_cv_lib_$1" != "no"; then |
| 53 | test "$mdw_cv_lib_$1" = "none required" || LIBS="$mdw_cv_lib_$1 $LIBS" |
| 54 | $3 |
| 55 | else |
| 56 | : |
| 57 | $4 |
| 58 | fi]) |
| 59 | |
| 60 | dnl----- That's all, folks -------------------------------------------------- |