r18031: Merge my replace fixes:
[garming/samba-autobuild/.git] / source4 / lib / replace / configure.ac
1 AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
2 AC_DEFUN([SMB_ENABLE], [echo -n ""])
3
4 dnl see if a declaration exists for a function or variable
5 dnl defines HAVE_function_DECL if it exists
6 dnl AC_HAVE_DECL(var, includes)
7 AC_DEFUN(AC_HAVE_DECL,
8 [
9  AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
10     AC_TRY_COMPILE([$2],[int i = (int)$1],
11         ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
12  if test x"$ac_cv_have_$1_decl" = x"yes"; then
13     AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
14  fi
15 ])
16
17 dnl AC_SEARCH_LIBS_EXT(FUNCTION, SEARCH-LIBS, EXT_LIBS,
18 dnl                    [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
19 dnl                    [OTHER-LIBRARIES])
20 dnl --------------------------------------------------------
21 dnl Search for a library defining FUNC, if it's not already available.
22 AC_DEFUN([AC_SEARCH_LIBS_EXT],
23 [AC_CACHE_CHECK([for library containing $1], [ac_cv_search_ext_$1],
24 [
25 ac_func_search_ext_save_LIBS=$LIBS
26 ac_cv_search_ext_$1=no
27 AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
28                [ac_cv_search_ext_$1="none required"])
29 if test "$ac_cv_search_ext_$1" = no; then
30   for ac_lib in $2; do
31     LIBS="-l$ac_lib $$3 $6 $ac_func_search_save_ext_LIBS"
32     AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
33                    [ac_cv_search_ext_$1="-l$ac_lib"
34 break])
35   done
36 fi
37 LIBS=$ac_func_search_ext_save_LIBS])
38 AS_IF([test "$ac_cv_search_ext_$1" != no],
39   [test "$ac_cv_search_ext_$1" = "none required" || $3="$ac_cv_search_ext_$1 $$3"
40   $4],
41       [$5])dnl
42 ])
43
44 AC_PREREQ(2.50)
45 AC_INIT(dlfcn.c)
46 AC_CONFIG_SRCDIR([dlfcn.c])
47 AC_CONFIG_HEADER(replace_config.h)
48 AC_PROG_INSTALL
49 sinclude(config.m4)
50 sinclude(win32/config.m4)
51 sinclude(repdir/config.m4)
52 AC_OUTPUT(Makefile)