xref: /freebsd-src/contrib/ntp/sntp/m4/hms_search_lib.m4 (revision 416ba5c74546f32a993436a99516d35008e9f384)
1*2b15cb3dSCy Schubertdnl Helper function to manage granular libraries
2*2b15cb3dSCy Schubertdnl
3*2b15cb3dSCy Schubertdnl Usage:
4*2b15cb3dSCy Schubertdnl
5*2b15cb3dSCy Schubertdnl LIB_MATH=''
6*2b15cb3dSCy Schubertdnl AC_SUBST([LIB_MATH])
7*2b15cb3dSCy Schubertdnl ...
8*2b15cb3dSCy Schubertdnl HMS_SEARCH_LIBS([LIB_MATH], [sqrt], [m], [AIF], [AINF], [OL])
9*2b15cb3dSCy Schubertdnl
10*2b15cb3dSCy Schubertdnl which expands to something like:
11*2b15cb3dSCy Schubertdnl
12*2b15cb3dSCy Schubertdnl  AC_SEARCH_LIBS([sqrt], [m], [case "$ac_cv_search_sqrt" in
13*2b15cb3dSCy Schubertdnl    'none required') ;;
14*2b15cb3dSCy Schubertdnl    no) ;;
15*2b15cb3dSCy Schubertdnl    *) LIB_MATH="$ac_cv_search_sqrt $LIB_MATH" ;;
16*2b15cb3dSCy Schubertdnl   esac
17*2b15cb3dSCy Schubertdnl   [AIF]],
18*2b15cb3dSCy Schubertdnl   [AINF],
19*2b15cb3dSCy Schubertdnl   [OL])
20*2b15cb3dSCy Schubertdnl
21*2b15cb3dSCy Schubertdnl arguments are: lib-var, function, search-libs, [AIF], [AINF], [other-libs]
22*2b15cb3dSCy SchubertAC_DEFUN([HMS_SEARCH_LIBS],
23*2b15cb3dSCy Schubert[AC_SEARCH_LIBS([$2], [$3], [case "$ac_cv_search_$2[]" in
24*2b15cb3dSCy Schubert 'none required') ;;
25*2b15cb3dSCy Schubert no) ;;
26*2b15cb3dSCy Schubert *) $1[]="$ac_cv_search_$2[] $[]$1" ;;
27*2b15cb3dSCy Schubert esac
28*2b15cb3dSCy Schubert $4],
29*2b15cb3dSCy Schubert $5,
30*2b15cb3dSCy Schubert [$6])])
31