1 # FINDLIB_REPLACE_FUNCS(FUNCTION...)
2 # -----------------------------
3 AC_DEFUN([FINDLIB_REPLACE_FUNCS],
4 [AC_FOREACH([AC_Func], [$1], [jy_FINDLIBSOURCE(AC_Func.c)])dnl
5 AC_CHECK_FUNCS([$1], , [_jy_FINDLIBOBJ($ac_func)])
10 # jy_FINDLIBSOURCE(FILENAME)
11 # ----------------------
12 # Announce we might need the file `FILENAME'.
13 m4_define([jy_FINDLIBSOURCE], [])
17 # jy_FINDLIBOBJ(FILENAME-NOEXT, ACTION-IF-INDIR)
18 # -------------------------------------------
19 # We need `FILENAME-NOEXT.o', save this into `FINDLIBOBJS'.
20 # We don't use AC_SUBST/2 because it forces an unnecessary eol.
21 m4_define([_jy_FINDLIBOBJ],
23 [jy_FINDLIBSOURCE([$1.c])],
25 AC_SUBST([FINDLIB@&t@OBJS])dnl
26 case $FINDLIB@&t@OBJS in
30 *" $1.$ac_objext "* ) ;;
31 *) FINDLIB@&t@OBJS="$FINDLIB@&t@OBJS $1.$ac_objext" ;;
37 # jy_FINDLIBOBJ(FILENAME-NOEXT)
38 # -------------------------
39 # We need `FILENAME-NOEXT.o', save this into `FINDLIBOBJS'.
40 # We don't use AC_SUBST/2 because it forces an unnecessary eol.
41 m4_define([jy_FINDLIBOBJ],
44 [$0($1): you should use literals])])dnl
48 # _jy_FINDLIBOBJS_NORMALIZE
49 # ---------------------
50 # Adapted from autoconf's general.m4.
51 # Clean up FINDLIBOBJS abd LTFINDLIBOBJS
52 # Used with AC_CONFIG_COMMANDS_PRE.
53 AC_DEFUN([_jy_FIND LIBOBJS_NORMALIZE],
56 for ac_i in : $FINDLIB@&t@OBJS; do test "x$ac_i" = x: && continue
57 # 1. Remove the extension, and $U if already installed.
59 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
61 ac_findlibobjs="$ac_libobjs $ac_i\$U.$ac_objext"
62 ac_ltfindlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
64 AC_SUBST([FINDLIB@&t@OBJS], [$ac_findlibobjs])
65 AC_SUBST([LTFINDLIBOBJS], [$ac_ltfindlibobjs])
69 dnl AC_CONFIG_COMMANDS_PRE(_jy_FINDLIBOBJS_NORMALIZE)