oleacc: Add missing interfaces.
[wine.git] / aclocal.m4
blob8aa81b2e0349cd8349dbcb803cfd591b182976e9
1 dnl Macros used to build the Wine configure script
2 dnl
3 dnl Copyright 2002 Alexandre Julliard
4 dnl
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
9 dnl
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 dnl Lesser General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library; if not, write to the Free Software
17 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 dnl
19 dnl As a special exception to the GNU Lesser General Public License,
20 dnl if you distribute this file as part of a program that contains a
21 dnl configuration script generated by Autoconf, you may include it
22 dnl under the same distribution terms that you use for the rest of
23 dnl that program.
25 dnl **** Initialize the programs used by other checks ****
26 dnl
27 dnl Usage: WINE_PATH_SONAME_TOOLS
28 dnl Usage: WINE_PATH_PKG_CONFIG
29 dnl
30 AC_DEFUN([WINE_PATH_SONAME_TOOLS],
31 [AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)
32 AC_CHECK_TOOL(READELF,[readelf],true)])
34 AC_DEFUN([WINE_PATH_PKG_CONFIG],
35 [AC_CHECK_TOOL(PKG_CONFIG,[pkg-config])])
37 dnl **** Extract the soname of a library ****
38 dnl
39 dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]])
40 dnl
41 AC_DEFUN([WINE_CHECK_SONAME],
42 [AC_REQUIRE([WINE_PATH_SONAME_TOOLS])dnl
43 AS_VAR_PUSHDEF([ac_Lib],[ac_cv_lib_soname_$1])dnl
44 m4_pushdef([ac_lib_pattern],m4_default([$6],[lib$1]))dnl
45 AC_MSG_CHECKING([for -l$1])
46 AC_CACHE_VAL(ac_Lib,
47 [ac_check_soname_save_LIBS=$LIBS
48 LIBS="-l$1 $5 $LIBS"
49   AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
50   [case "$LIBEXT" in
51     dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;;
52     dylib) AS_VAR_SET(ac_Lib,[`otool -L conftest$ac_exeext | grep "ac_lib_pattern\\.[[0-9A-Za-z.]]*dylib" | sed -e "s/^.*\/\(ac_lib_pattern\.[[0-9A-Za-z.]]*dylib\).*$/\1/"';2,$d'`]) ;;
53     *) AS_VAR_SET(ac_Lib,[`$READELF -d conftest$ac_exeext | grep "NEEDED.*ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\\m4_dquote(\\(ac_lib_pattern\\.$LIBEXT[[^    ]]*\\)\\).*$/\1/"';2,$d'`])
54        AS_IF([test "x]AS_VAR_GET(ac_Lib)[" = x],
55              [AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^  ]]*\).*$/\1/"';2,$d'`])]) ;;
56   esac])
57   LIBS=$ac_check_soname_save_LIBS])dnl
58 AS_IF([test "x]AS_VAR_GET(ac_Lib)[" = "x"],
59       [AC_MSG_RESULT([not found])
60        $4],
61       [AC_MSG_RESULT(AS_VAR_GET(ac_Lib))
62        AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),["]AS_VAR_GET(ac_Lib)["],
63                           [Define to the soname of the lib$1 library.])
64        $3])dnl
65 m4_popdef([ac_lib_pattern])dnl
66 AS_VAR_POPDEF([ac_Lib])])
68 dnl **** Get flags from pkg-config or alternate xxx-config program ****
69 dnl
70 dnl Usage: WINE_PACKAGE_FLAGS(var,pkg-name,[default-lib,[cflags-alternate,libs-alternate,[checks]]])
71 dnl
72 AC_DEFUN([WINE_PACKAGE_FLAGS],
73 [AC_REQUIRE([WINE_PATH_PKG_CONFIG])dnl
74 AS_VAR_PUSHDEF([ac_cflags],[[$1]_CFLAGS])dnl
75 AS_VAR_PUSHDEF([ac_libs],[[$1]_LIBS])dnl
76 AC_ARG_VAR(ac_cflags, [C compiler flags for $2, overriding pkg-config])dnl
77 AS_IF([test -n "$ac_cflags"],[],
78       [test -n "$PKG_CONFIG"],
79       [ac_cflags=`$PKG_CONFIG --cflags [$2] 2>/dev/null`])
80 m4_ifval([$4],[ac_cflags=[$]{ac_cflags:-[$4]}])
81 AC_ARG_VAR(ac_libs, [Linker flags for $2, overriding pkg-config])dnl
82 AS_IF([test -n "$ac_libs"],[],
83       [test -n "$PKG_CONFIG"],
84       [ac_libs=`$PKG_CONFIG --libs [$2] 2>/dev/null`])
85 m4_ifval([$5],[ac_libs=[$]{ac_libs:-[$5]}])
86 m4_ifval([$3],[ac_libs=[$]{ac_libs:-"$3"}])
87 ac_save_CPPFLAGS=$CPPFLAGS
88 CPPFLAGS="$CPPFLAGS $ac_cflags"
90 CPPFLAGS=$ac_save_CPPFLAGS
91 test -z "$ac_cflags" || ac_cflags=`echo " $ac_cflags" | sed 's/ -I\([[^/]]\)/ -I\$(top_builddir)\/\1/g'`
92 test -z "$ac_libs" || ac_libs=`echo " $ac_libs" | sed 's/ -L\([[^/]]\)/ -L\$(top_builddir)\/\1/g'`
93 AS_VAR_POPDEF([ac_libs])dnl
94 AS_VAR_POPDEF([ac_cflags])])dnl
96 dnl **** Link C code with an assembly file ****
97 dnl
98 dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]])
99 dnl
100 AC_DEFUN([WINE_TRY_ASM_LINK],
101 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[asm($1); $3]])],[$4],[$5])])
103 dnl **** Check if we can link an empty program with special CFLAGS ****
105 dnl Usage: WINE_TRY_CFLAGS(flags,[action-if-yes,[action-if-no]])
107 dnl The default action-if-yes is to append the flags to EXTRACFLAGS.
109 AC_DEFUN([WINE_TRY_CFLAGS],
110 [AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
111 AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
112 [ac_wine_try_cflags_saved=$CFLAGS
113 CFLAGS="$CFLAGS $1"
114 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
115                [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
116 CFLAGS=$ac_wine_try_cflags_saved])
117 AS_IF([test AS_VAR_GET(ac_var) = yes],
118       [m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
119 AS_VAR_POPDEF([ac_var])])
121 dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS ****
123 dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]])
125 AC_DEFUN([WINE_TRY_SHLIB_FLAGS],
126 [ac_wine_try_cflags_saved=$CFLAGS
127 CFLAGS="$CFLAGS $1"
128 AC_LINK_IFELSE([AC_LANG_SOURCE([void myfunc() {}])],[$2],[$3])
129 CFLAGS=$ac_wine_try_cflags_saved])
131 dnl **** Check whether we need to define a symbol on the compiler command line ****
133 dnl Usage: WINE_CHECK_DEFINE(name),[action-if-yes,[action-if-no]])
135 AC_DEFUN([WINE_CHECK_DEFINE],
136 [AS_VAR_PUSHDEF([ac_var],[ac_cv_cpp_def_$1])dnl
137 AC_CACHE_CHECK([whether we need to define $1],ac_var,
138     AC_EGREP_CPP(yes,[#ifndef $1
140 #endif],
141     [AS_VAR_SET(ac_var,yes)],[AS_VAR_SET(ac_var,no)]))
142 AS_IF([test AS_VAR_GET(ac_var) = yes],
143       [CFLAGS="$CFLAGS -D$1"
144   LINTFLAGS="$LINTFLAGS -D$1"])dnl
145 AS_VAR_POPDEF([ac_var])])
147 dnl **** Check for functions with some extra libraries ****
149 dnl Usage: WINE_CHECK_LIB_FUNCS(funcs,libs,[action-if-found,[action-if-not-found]])
151 AC_DEFUN([WINE_CHECK_LIB_FUNCS],
152 [ac_wine_check_funcs_save_LIBS="$LIBS"
153 LIBS="$LIBS $2"
154 AC_CHECK_FUNCS([$1],[$3],[$4])
155 LIBS="$ac_wine_check_funcs_save_LIBS"])
157 dnl **** Check for a mingw program, trying the various mingw prefixes ****
159 dnl Usage: WINE_CHECK_MINGW_PROG(variable,prog,[value-if-not-found],[path])
161 AC_DEFUN([WINE_CHECK_MINGW_PROG],
162 [case "$host_cpu" in
163   i[[3456789]]86*)
164     ac_prefix_list="m4_foreach([ac_wine_prefix],[w64-mingw32, pc-mingw32, mingw32msvc, mingw32],
165                         m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-ac_wine_prefix-$2 ]))
166                         mingw32-$2" ;;
167   x86_64)
168     ac_prefix_list="m4_foreach([ac_wine_prefix],[pc-mingw32, w64-mingw32, mingw32msvc],
169                         m4_foreach([ac_wine_cpu],[x86_64,amd64],[ac_wine_cpu-ac_wine_prefix-$2 ]))" ;;
170   *)
171     ac_prefix_list="" ;;
172 esac
173 AC_CHECK_PROGS([$1],[$ac_prefix_list],[$3],[$4])])
176 dnl **** Define helper functions for creating config.status files ****
178 dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
180 AC_DEFUN([WINE_CONFIG_HELPERS],
181 [ALL_MAKEFILE_DEPENDS="
182 # Rules automatically generated by configure
184 .INIT: Makefile
185 .MAKEFILEDEPS:
186 all: Makefile
187 Makefile: Makefile.in Make.vars.in Make.rules config.status
188         @./config.status Make.tmp Makefile"
190 ALL_POT_FILES=""
191 AC_SUBST(ALL_TEST_RESOURCES,"")
193 wine_fn_append_file ()
195     AS_VAR_APPEND($[1]," \\$as_nl       $[2]")
198 wine_fn_append_rule ()
200     AS_VAR_APPEND($[1],"$as_nl$[2]")
203 wine_fn_has_flag ()
205     expr ",$[2]," : ".*,$[1],.*" >/dev/null
208 wine_fn_all_dir_rules ()
210     ac_dir=$[1]
211     ac_alldeps=$[2]
212     ac_makedep="\$(MAKEDEP)"
213     ac_input=Make.vars.in:$ac_dir/Makefile.in
214     if test $ac_dir != tools
215     then
216         dnl makedep is in tools so tools makefile cannot depend on it
217         ac_alldeps="$[2] $ac_makedep"
218     else
219         ac_alldeps="$[2] include/config.h"
220     fi
221     case $[2] in
222       *.in) ac_input=$ac_input:$[2] ;;
223       *) ac_makedep="$[2] $ac_makedep" ;;
224     esac
226     wine_fn_append_file ALL_DIRS $ac_dir
227     wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
228 "__clean__: $ac_dir/__clean__
229 .PHONY: $ac_dir/__clean__
230 $ac_dir/__clean__: $ac_dir/Makefile
231         @cd $ac_dir && \$(MAKE) clean
232         \$(RM) $ac_dir/Makefile
233 $ac_dir/Makefile: $ac_dir/Makefile.in Make.vars.in config.status $ac_alldeps
234         @./config.status --file $ac_dir/Makefile:$ac_input && cd $ac_dir && \$(MAKE) depend
235 depend: $ac_dir/__depend__
236 .PHONY: $ac_dir/__depend__
237 $ac_dir/__depend__: $ac_makedep dummy
238         @./config.status --file $ac_dir/Makefile:$ac_input && cd $ac_dir && \$(MAKE) depend"
241 wine_fn_pot_rules ()
243     ac_dir=$[1]
244     ac_flags=$[2]
246     test "x$with_gettextpo" = xyes || return
248     if wine_fn_has_flag mc $ac_flags
249     then
250         wine_fn_append_file ALL_POT_FILES $ac_dir/msg.pot
251         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
252 "$ac_dir/msg.pot: $ac_dir/Makefile dummy
253         @cd $ac_dir && \$(MAKE) msg.pot
254 $ac_dir/msg.pot: tools/wmc include"
255     fi
256     if wine_fn_has_flag po $ac_flags
257     then
258         wine_fn_append_file ALL_POT_FILES $ac_dir/rsrc.pot
259         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
260 "$ac_dir/rsrc.pot: $ac_dir/Makefile dummy
261         @cd $ac_dir && \$(MAKE) rsrc.pot
262 $ac_dir/rsrc.pot: tools/wrc include"
263     fi
266 wine_fn_config_makefile ()
268     ac_dir=$[1]
269     ac_enable=$[2]
270     ac_flags=$[3]
271     ac_rules=$[4]
272     AS_VAR_IF([$ac_enable],[no],[return 0])
274     wine_fn_all_dir_rules $ac_dir ${ac_rules:-Make.rules}
275     wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
276 "all: $ac_dir
277 .PHONY: $ac_dir
278 $ac_dir: $ac_dir/Makefile dummy
279         @cd $ac_dir && \$(MAKE)"
281     wine_fn_has_flag install-lib $ac_flags || wine_fn_has_flag install-dev $ac_flags || return
283     wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
284 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
285 $ac_dir/__install__:: $ac_dir
286         @cd $ac_dir && \$(MAKE) install
287 $ac_dir/__uninstall__:: $ac_dir/Makefile
288         @cd $ac_dir && \$(MAKE) uninstall
289 install:: $ac_dir/__install__
290 __uninstall__: $ac_dir/__uninstall__"
292     if wine_fn_has_flag install-lib $ac_flags
293     then
294         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
295 ".PHONY: $ac_dir/__install-lib__
296 $ac_dir/__install-lib__:: $ac_dir
297         @cd $ac_dir && \$(MAKE) install-lib
298 install-lib:: $ac_dir/__install-lib__"
299     fi
301     if wine_fn_has_flag install-dev $ac_flags
302     then
303         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
304 ".PHONY: $ac_dir/__install-dev
305 $ac_dir/__install-dev__:: $ac_dir
306         @cd $ac_dir && \$(MAKE) install-dev
307 install-dev:: $ac_dir/__install-dev__"
308     fi
311 wine_fn_config_lib ()
313     ac_name=$[1]
314     ac_flags=$[2]
315     ac_dir=dlls/$ac_name
316     wine_fn_config_makefile $ac_dir enable_$ac_name "$ac_flags" dlls/Makeimplib.rules
318     if wine_fn_has_flag install-dev $ac_flags
319     then :
320     else
321         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
322 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
323 $ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir)
324         \$(INSTALL_DATA) $ac_dir/lib$ac_name.a \$(DESTDIR)\$(dlldir)/lib$ac_name.a
325 $ac_dir/__uninstall__::
326         \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_name.a
327 install install-dev:: $ac_dir/__install__
328 __uninstall__: $ac_dir/__uninstall__"
329     fi
331     wine_fn_append_rule ALL_MAKEFILE_DEPENDS "__builddeps__: $ac_dir"
332     wine_fn_append_rule ALL_MAKEFILE_DEPENDS "$ac_dir: tools/widl tools/winebuild tools/winegcc include"
335 wine_fn_config_dll ()
337     ac_name=$[1]
338     ac_dir=dlls/$ac_name
339     ac_enable=$[2]
340     ac_flags=$[3]
341     ac_implib=${4:-$ac_name}
342     ac_file=$ac_dir/lib$ac_implib
343     ac_dll=$ac_name
344     ac_deps="tools/widl tools/winebuild tools/winegcc include"
345     ac_implibflags=""
347     case $ac_name in
348       *16) ac_implibflags=" -m16" ;;
349       *.*) ;;
350       *)   ac_dll=$ac_dll.dll ;;
351     esac
353     wine_fn_config_makefile $ac_dir $ac_enable "$ac_flags" dlls/Makedll.rules
355     AS_VAR_IF([$ac_enable],[no],
356               dnl enable_win16 is special in that it disables import libs too
357               [test "$ac_enable" != enable_win16 || return 0
358                wine_fn_has_flag implib $ac_flags && wine_fn_all_dir_rules $ac_dir dlls/Makedll.rules],
360               [wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
361 "$ac_dir: __builddeps__
362 manpages htmlpages sgmlpages xmlpages:: $ac_dir/Makefile
363         @cd $ac_dir && \$(MAKE) \$[@]"
365         if wine_fn_has_flag install-lib $ac_flags
366         then :
367         else
368             wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
369 ".PHONY: $ac_dir/__install-lib__ $ac_dir/__uninstall__
370 install install-lib:: $ac_dir/__install-lib__
371 __uninstall__: $ac_dir/__uninstall__"
372             if test -n "$DLLEXT"
373             then
374                 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
375 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
376         \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT
377         \$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll
378 $ac_dir/__uninstall__::
379         \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll"
380             else
381                 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
382 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
383         \$(INSTALL_PROGRAM) $ac_dir/$ac_dll \$(DESTDIR)\$(dlldir)/$ac_dll
384 $ac_dir/__uninstall__::
385         \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll"
386             fi
387         fi
389         wine_fn_pot_rules $ac_dir $ac_flags])
391     if wine_fn_has_flag staticimplib $ac_flags
392     then
393         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
394 "__builddeps__: $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT
395 $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps
396 $ac_file.def: $ac_dir/$ac_name.spec $ac_dir/Makefile
397         @cd $ac_dir && \$(MAKE) lib$ac_implib.def
398 $ac_file.$STATIC_IMPLIBEXT: $ac_dir/Makefile dummy
399         @cd $ac_dir && \$(MAKE) lib$ac_implib.$STATIC_IMPLIBEXT
400 .PHONY: $ac_dir/__install-dev__ $ac_dir/__uninstall__
401 $ac_dir/__install-dev__:: $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)
402         \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
403 $ac_dir/__uninstall__::
404         \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
405 install install-dev:: $ac_dir/__install-dev__
406 __uninstall__: $ac_dir/__uninstall__"
408         if test "$IMPLIBEXT" != "$STATIC_IMPLIBEXT"
409         then
410             wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
411 "$ac_dir/__install-dev__:: $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir) __builddeps__
412         \$(INSTALL_DATA) $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT
413 $ac_dir/__uninstall__::
414         \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT"
415         fi
417         if test "x$CROSSTEST_DISABLE" = x
418         then
419             wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
420 "__builddeps__: $ac_file.cross.a
421 $ac_file.cross.a: $ac_dir/Makefile dummy
422         @cd $ac_dir && \$(MAKE) lib$ac_implib.cross.a"
423         fi
425     elif wine_fn_has_flag implib $ac_flags
426     then
427         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
428 "__builddeps__: $ac_file.$IMPLIBEXT
429 $ac_file.def: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
430         \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --def -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec
431 $ac_file.a: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
432         \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --implib -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec
433 .PHONY: $ac_dir/__install-dev__ $ac_dir/__uninstall__
434 $ac_dir/__install-dev__:: $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)
435         \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
436 $ac_dir/__uninstall__::
437         \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
438 install install-dev:: $ac_dir/__install-dev__
439 __uninstall__: $ac_dir/__uninstall__"
440         if test "x$CROSSTEST_DISABLE" = x
441         then
442             wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
443 "__builddeps__: $ac_file.cross.a
444 $ac_file.cross.a: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
445         \$(WINEBUILD) \$(CROSSTARGET:%=-b %)$ac_implibflags -w --implib -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec"
446         fi
448         if test "$ac_name" != "$ac_implib"
449         then
450             wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
451 "__builddeps__: dlls/lib$ac_implib.$IMPLIBEXT
452 dlls/lib$ac_implib.$IMPLIBEXT: $ac_file.$IMPLIBEXT
453         \$(RM) \$[@] && \$(LN_S) $ac_name/lib$ac_implib.$IMPLIBEXT \$[@]
454 clean::
455         \$(RM) dlls/lib$ac_implib.$IMPLIBEXT"
456             if test "x$CROSSTEST_DISABLE" = x
457             then
458                 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
459 "__builddeps__: dlls/lib$ac_implib.cross.a
460 dlls/lib$ac_implib.cross.a: $ac_file.cross.a
461         \$(RM) \$[@] && \$(LN_S) $ac_name/lib$ac_implib.cross.a \$[@]"
462             fi
463         fi
464     fi
467 wine_fn_config_program ()
469     ac_name=$[1]
470     ac_dir=programs/$ac_name
471     ac_enable=$[2]
472     ac_flags=$[3]
473     ac_program=$ac_name
475     case $ac_name in
476       *.*) ;;
477       *)   ac_program=$ac_program.exe ;;
478     esac
480     wine_fn_config_makefile $ac_dir $ac_enable "$ac_flags" programs/Makeprog.rules
482     AS_VAR_IF([$ac_enable],[no],,[wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
483 "$ac_dir: __builddeps__"
485     wine_fn_pot_rules $ac_dir $ac_flags
487     wine_fn_has_flag install $ac_flags || return
488     wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
489 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
490 install install-lib:: $ac_dir/__install__
491 __uninstall__: $ac_dir/__uninstall__"
493     if test -n "$DLLEXT"
494     then
495         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
496 "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
497         \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT
498         \$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program
499 $ac_dir/__uninstall__::
500         \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program"
502         if test "x$enable_tools" != xno && wine_fn_has_flag installbin $ac_flags
503         then
504             wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
505 "$ac_dir/__install__:: tools \$(DESTDIR)\$(bindir)
506         \$(INSTALL_SCRIPT) tools/wineapploader \$(DESTDIR)\$(bindir)/$ac_name
507 $ac_dir/__uninstall__::
508         \$(RM) \$(DESTDIR)\$(bindir)/$ac_name"
509         fi
510     else
511         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
512 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
513         \$(INSTALL_PROGRAM) $ac_dir/$ac_program \$(DESTDIR)\$(dlldir)/$ac_program
514 $ac_dir/__uninstall__::
515         \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program"
516     fi
518     if test "x$enable_tools" != xno && wine_fn_has_flag manpage $ac_flags
519     then
520         wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
521 "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(mandir)/man\$(prog_manext)
522         \$(INSTALL_DATA) $ac_dir/$ac_name.man \$(DESTDIR)\$(mandir)/man\$(prog_manext)/$ac_name.\$(prog_manext)
523 $ac_dir/__uninstall__::
524         \$(RM) \$(DESTDIR)\$(mandir)/man\$(prog_manext)/$ac_name.\$(prog_manext)"
525     fi])
528 wine_fn_config_test ()
530     ac_dir=$[1]
531     ac_name=$[2]
532     ac_flags=$[3]
533     wine_fn_append_file ALL_TEST_RESOURCES $ac_name.res
534     wine_fn_all_dir_rules $ac_dir Maketest.rules
536     AS_VAR_IF([enable_tests],[no],,[wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
537 "all: $ac_dir
538 .PHONY: $ac_dir
539 $ac_dir: $ac_dir/Makefile programs/winetest/Makefile __builddeps__ dummy
540         @cd $ac_dir && \$(MAKE)
541 programs/winetest: $ac_dir
542 check test: $ac_dir/__test__
543 .PHONY: $ac_dir/__test__
544 $ac_dir/__test__: dummy
545         @cd $ac_dir && \$(MAKE) test
546 testclean::
547         \$(RM) $ac_dir/*.ok"
549         if test "x$CROSSTEST_DISABLE" = x
550         then
551             wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
552 "crosstest: $ac_dir/__crosstest__
553 .PHONY: $ac_dir/__crosstest__
554 $ac_dir/__crosstest__: $ac_dir/Makefile __builddeps__ dummy
555         @cd $ac_dir && \$(MAKE) crosstest"
556         fi])
559 wine_fn_config_tool ()
561     ac_dir=$[1]
562     ac_flags=$[2]
563     AS_VAR_IF([enable_tools],[no],[return 0])
565     wine_fn_config_makefile $ac_dir enable_tools $ac_flags
567     wine_fn_append_rule ALL_MAKEFILE_DEPENDS "__tooldeps__: $ac_dir"
568     wine_fn_append_rule ALL_MAKEFILE_DEPENDS "$ac_dir: libs/port"
569     case $ac_dir in
570       tools/winebuild) wine_fn_append_rule ALL_MAKEFILE_DEPENDS "\$(WINEBUILD): $ac_dir" ;;
571     esac
574 wine_fn_config_makerules ()
576     ac_rules=$[1]
577     ac_deps=$[2]
578     wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
579 "$ac_rules: $ac_rules.in $ac_deps config.status
580         @./config.status $ac_rules
581 distclean::
582         \$(RM) $ac_rules"
585 wine_fn_config_symlink ()
587     ac_link=$[1]
588     wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
589 "$ac_link:
590         @./config.status $ac_link
591 distclean::
592         \$(RM) $ac_link"
595 if test "x$CROSSTEST_DISABLE" != x
596 then
597     wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
598 "crosstest:
599         @echo \"crosstest is not supported (mingw not installed?)\" && false"
600 fi])
602 dnl **** Define helper function to append a file to a makefile file list ****
604 dnl Usage: WINE_APPEND_FILE(var,file)
606 AC_DEFUN([WINE_APPEND_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_file $1 "$2"])
608 dnl **** Define helper function to append a rule to a makefile command list ****
610 dnl Usage: WINE_APPEND_RULE(var,rule)
612 AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_rule $1 "$2"])
614 dnl **** Create nonexistent directories from config.status ****
616 dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
618 AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
619 [AC_CONFIG_COMMANDS([$1],[test -d "$1" || { AC_MSG_NOTICE([creating $1]); AS_MKDIR_P("$1"); }])])
621 dnl **** Create symlinks from config.status ****
623 dnl Usage: WINE_CONFIG_SYMLINK(name,target,enable)
625 AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
626 m4_ifval([$3],[if test "x$[$3]" != xno; then
627 ])AC_CONFIG_LINKS([$1:]m4_default([$2],[$1]))dnl
628 m4_if([$2],,[test "$srcdir" = "." || ])wine_fn_config_symlink $1[]m4_ifval([$3],[
629 fi])])
631 dnl **** Create a make rules file from config.status ****
633 dnl Usage: WINE_CONFIG_MAKERULES(file,var,deps)
635 AC_DEFUN([WINE_CONFIG_MAKERULES],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
636 wine_fn_config_makerules $1 $3
637 $2=$1
638 AC_SUBST_FILE([$2])dnl
639 AC_CONFIG_FILES([$1])])
641 dnl **** Create a makefile from config.status ****
643 dnl Usage: WINE_CONFIG_MAKEFILE(file,enable,flags)
645 AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
646 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
647 wine_fn_config_makefile [$1] ac_enable [$3]dnl
648 AS_VAR_POPDEF([ac_enable])])
650 dnl **** Create a dll makefile from config.status ****
652 dnl Usage: WINE_CONFIG_DLL(name,enable,flags,implib)
654 AC_DEFUN([WINE_CONFIG_DLL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
655 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
656 wine_fn_config_dll [$1] ac_enable [$3] [$4]dnl
657 AS_VAR_POPDEF([ac_enable])])
659 dnl **** Create a program makefile from config.status ****
661 dnl Usage: WINE_CONFIG_PROGRAM(name,enable,flags)
663 AC_DEFUN([WINE_CONFIG_PROGRAM],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
664 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
665 wine_fn_config_program [$1] ac_enable [$3]dnl
666 AS_VAR_POPDEF([ac_enable])])
668 dnl **** Create a test makefile from config.status ****
670 dnl Usage: WINE_CONFIG_TEST(dir,flags)
672 AC_DEFUN([WINE_CONFIG_TEST],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
673 m4_pushdef([ac_suffix],m4_if(m4_substr([$1],0,9),[programs/],[.exe_test],[_test]))dnl
674 m4_pushdef([ac_name],[m4_bpatsubst([$1],[.*/\(.*\)/tests$],[\1])])dnl
675 wine_fn_config_test $1 ac_name[]ac_suffix [$2]dnl
676 m4_popdef([ac_suffix])dnl
677 m4_popdef([ac_name])])
679 dnl **** Create a static lib makefile from config.status ****
681 dnl Usage: WINE_CONFIG_LIB(name,flags)
683 AC_DEFUN([WINE_CONFIG_LIB],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
684 wine_fn_config_lib [$1] [$2]])
686 dnl **** Create a tool makefile from config.status ****
688 dnl Usage: WINE_CONFIG_TOOL(name,flags)
690 AC_DEFUN([WINE_CONFIG_TOOL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
691 wine_fn_config_tool [$1] [$2]])
693 dnl **** Add a message to the list displayed at the end ****
695 dnl Usage: WINE_NOTICE(notice)
696 dnl Usage: WINE_NOTICE_WITH(with_flag, test, notice)
697 dnl Usage: WINE_WARNING(warning)
698 dnl Usage: WINE_WARNING_WITH(with_flag, test, warning)
699 dnl Usage: WINE_PRINT_MESSAGES
701 AC_DEFUN([WINE_NOTICE],[AS_VAR_APPEND([wine_notices],["|$1"])])
702 AC_DEFUN([WINE_WARNING],[AS_VAR_APPEND([wine_warnings],["|$1"])])
704 AC_DEFUN([WINE_NOTICE_WITH],[AS_IF([$2],[case "x$with_$1" in
705   x)   WINE_NOTICE([$3]) ;;
706   xno) ;;
707   *)   AC_MSG_ERROR([$3
708 This is an error since --with-$1 was requested.]) ;;
709 esac])])
711 AC_DEFUN([WINE_WARNING_WITH],[AS_IF([$2],[case "x$with_$1" in
712   x)   WINE_WARNING([$3]) ;;
713   xno) ;;
714   *)   AC_MSG_ERROR([$3
715 This is an error since --with-$1 was requested.]) ;;
716 esac])])
718 AC_DEFUN([WINE_ERROR_WITH],[AS_IF([$2],[case "x$with_$1" in
719   xno) ;;
720   *)   AC_MSG_ERROR([$3
721 Use the --without-$1 option if you really want this.]) ;;
722 esac])])
724 AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS"
725 if test "x$wine_notices != "x; then
726     echo >&AS_MESSAGE_FD
727     IFS="|"
728     for msg in $wine_notices; do
729         IFS="$ac_save_IFS"
730         if test -n "$msg"; then
731             AC_MSG_NOTICE([$msg])
732         fi
733     done
735 IFS="|"
736 for msg in $wine_warnings; do
737     IFS="$ac_save_IFS"
738     if test -n "$msg"; then
739         echo >&2
740         AC_MSG_WARN([$msg])
741     fi
742 done
743 IFS="$ac_save_IFS"])
745 dnl Local Variables:
746 dnl compile-command: "autoreconf --warnings=all"
747 dnl End: