]>
Commit | Line | Data |
---|---|---|
2ace9480 | 1 | AC_DEFUN(AC_CHECK_LIB_LOC, |
2 | [AC_MSG_CHECKING([for lib$2 in $1]) | |
3 | ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` | |
4 | AC_CACHE_VAL(ac_cv_lib_loc_$ac_lib_var, | |
5 | [ac_save_LIBS="$LIBS" | |
6 | LIBS="-L$1 -l$2 $6 $LIBS" | |
7 | AC_TRY_LINK( | |
8 | [/* We use char because int might match the return type of a gcc2 | |
9 | builtin and then its argument prototype would still apply. */ | |
10 | char $3(); | |
11 | ], | |
12 | [$3()], | |
13 | eval "ac_cv_lib_loc_$ac_lib_var=yes", | |
14 | eval "ac_cv_lib_loc_$ac_lib_var=no") | |
15 | LIBS="$ac_save_LIBS" | |
16 | ])dnl | |
17 | if eval "test \"`echo '$ac_cv_lib_loc_'$ac_lib_var`\" = yes"; then | |
18 | AC_MSG_RESULT(yes) | |
19 | ifelse([$4], , | |
20 | [LIBS="-L$1 -l$2 $LIBS" | |
21 | ], [$4]) | |
22 | else | |
23 | AC_MSG_RESULT(no) | |
24 | ifelse([$5], , , [$5 | |
25 | ])dnl | |
26 | fi | |
27 | ]) |