1 dnl Macros used to build the Wine configure script
3 dnl Copyright 2002 Alexandre Julliard
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.
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.
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
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
25 dnl **** Initialize the programs used by other checks ****
27 dnl Usage: WINE_PATH_SONAME_TOOLS
28 dnl Usage: WINE_PATH_PKG_CONFIG
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 ****
39 dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]])
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])
47 [ac_check_soname_save_LIBS=$LIBS
49 AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
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'`])]) ;;
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])
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.])
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 ****
70 dnl Usage: WINE_PACKAGE_FLAGS(var,pkg-name,[default-lib,[cflags-alternate,libs-alternate]])
72 AC_DEFUN([WINE_PACKAGE_FLAGS],
73 [AC_REQUIRE([WINE_PATH_PKG_CONFIG])dnl
74 AC_ARG_VAR([$1]_CFLAGS, [C compiler flags for $2, overriding pkg-config])dnl
75 AS_IF([test -n "$[$1]_CFLAGS"],[],
76 [test -n "$PKG_CONFIG"],
77 [[$1]_CFLAGS=`$PKG_CONFIG --cflags [$2] 2>/dev/null`])
78 m4_ifval([$4],[[$1]_CFLAGS=[$]{[$1]_CFLAGS:-`[$4] 2>/dev/null`}])
79 CPPFLAGS="$CPPFLAGS $[$1]_CFLAGS"
80 AC_ARG_VAR([$1]_LIBS, [Linker flags for $2, overriding pkg-config])dnl
81 AS_IF([test -n "$[$1]_LIBS"],[],
82 [test -n "$PKG_CONFIG"],
83 [[$1]_LIBS=`$PKG_CONFIG --libs [$2] 2>/dev/null`])
84 m4_ifval([$5],[[$1]_LIBS=[$]{[$1]_LIBS:-`[$5] 2>/dev/null`}])
85 m4_ifval([$3],[[$1]_LIBS=[$]{[$1]_LIBS:-"$3"}])])
87 dnl **** Link C code with an assembly file ****
89 dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]])
91 AC_DEFUN([WINE_TRY_ASM_LINK],
92 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[asm($1); $3]])],[$4],[$5])])
94 dnl **** Check if we can link an empty program with special CFLAGS ****
96 dnl Usage: WINE_TRY_CFLAGS(flags,[action-if-yes,[action-if-no]])
98 dnl The default action-if-yes is to append the flags to EXTRACFLAGS.
100 AC_DEFUN([WINE_TRY_CFLAGS],
101 [AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
102 AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
103 [ac_wine_try_cflags_saved=$CFLAGS
105 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
106 [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
107 CFLAGS=$ac_wine_try_cflags_saved])
108 AS_IF([test AS_VAR_GET(ac_var) = yes],
109 [m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
110 AS_VAR_POPDEF([ac_var])])
112 dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS ****
114 dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]])
116 AC_DEFUN([WINE_TRY_SHLIB_FLAGS],
117 [ac_wine_try_cflags_saved=$CFLAGS
119 AC_LINK_IFELSE([AC_LANG_SOURCE([void myfunc() {}])],[$2],[$3])
120 CFLAGS=$ac_wine_try_cflags_saved])
122 dnl **** Check whether we need to define a symbol on the compiler command line ****
124 dnl Usage: WINE_CHECK_DEFINE(name),[action-if-yes,[action-if-no]])
126 AC_DEFUN([WINE_CHECK_DEFINE],
127 [AS_VAR_PUSHDEF([ac_var],[ac_cv_cpp_def_$1])dnl
128 AC_CACHE_CHECK([whether we need to define $1],ac_var,
129 AC_EGREP_CPP(yes,[#ifndef $1
132 [AS_VAR_SET(ac_var,yes)],[AS_VAR_SET(ac_var,no)]))
133 AS_IF([test AS_VAR_GET(ac_var) = yes],
134 [CFLAGS="$CFLAGS -D$1"
135 LINTFLAGS="$LINTFLAGS -D$1"])dnl
136 AS_VAR_POPDEF([ac_var])])
138 dnl **** Check for functions with some extra libraries ****
140 dnl Usage: WINE_CHECK_LIB_FUNCS(funcs,libs,[action-if-found,[action-if-not-found]])
142 AC_DEFUN([WINE_CHECK_LIB_FUNCS],
143 [ac_wine_check_funcs_save_LIBS="$LIBS"
145 AC_CHECK_FUNCS([$1],[$3],[$4])
146 LIBS="$ac_wine_check_funcs_save_LIBS"])
148 dnl **** Check for a mingw program, trying the various mingw prefixes ****
150 dnl Usage: WINE_CHECK_MINGW_PROG(variable,prog,[value-if-not-found],[path])
152 AC_DEFUN([WINE_CHECK_MINGW_PROG],
155 ac_prefix_list="m4_foreach([ac_wine_prefix],[w64-mingw32, pc-mingw32, mingw32msvc, mingw32],
156 m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-ac_wine_prefix-$2 ]))
159 ac_prefix_list="m4_foreach([ac_wine_prefix],[pc-mingw32, w64-mingw32, mingw32msvc],
160 m4_foreach([ac_wine_cpu],[x86_64,amd64],[ac_wine_cpu-ac_wine_prefix-$2 ]))" ;;
164 AC_CHECK_PROGS([$1],[$ac_prefix_list],[$3],[$4])])
167 dnl **** Define helper functions for creating config.status files ****
169 dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
171 AC_DEFUN([WINE_CONFIG_HELPERS],
172 [ALL_MAKEFILE_DEPENDS="
173 # Rules automatically generated by configure
178 Makefile: Makefile.in Make.vars.in Make.rules config.status
179 @./config.status Make.tmp Makefile"
182 AC_SUBST(ALL_TEST_RESOURCES,"")
184 wine_fn_append_file ()
186 AS_VAR_APPEND($[1]," \\$as_nl $[2]")
189 wine_fn_append_rule ()
191 AS_VAR_APPEND($[1],"$as_nl$[2]")
196 expr ",$[2]," : ".*,$[1],.*" >/dev/null
199 wine_fn_all_dir_rules ()
203 ac_makedep="\$(MAKEDEP)"
204 ac_input=Make.vars.in:$ac_dir/Makefile.in
205 if test $ac_dir != tools
207 dnl makedep is in tools so tools makefile cannot depend on it
208 ac_alldeps="$[2] $ac_makedep"
210 ac_alldeps="$[2] include/config.h"
213 *.in) ac_input=$ac_input:$[2] ;;
214 *) ac_makedep="$[2] $ac_makedep" ;;
217 wine_fn_append_file ALL_DIRS $ac_dir
218 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
219 "__clean__: $ac_dir/__clean__
220 .PHONY: $ac_dir/__clean__
221 $ac_dir/__clean__: $ac_dir/Makefile
222 @cd $ac_dir && \$(MAKE) clean
223 \$(RM) $ac_dir/Makefile
224 $ac_dir/Makefile: $ac_dir/Makefile.in Make.vars.in config.status $ac_alldeps
225 @./config.status --file $ac_dir/Makefile:$ac_input && cd $ac_dir && \$(MAKE) depend
226 depend: $ac_dir/__depend__
227 .PHONY: $ac_dir/__depend__
228 $ac_dir/__depend__: $ac_makedep dummy
229 @./config.status --file $ac_dir/Makefile:$ac_input && cd $ac_dir && \$(MAKE) depend"
237 test "x$with_gettextpo" = xyes || return
239 if wine_fn_has_flag mc $ac_flags
241 wine_fn_append_file ALL_POT_FILES $ac_dir/msg.pot
242 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
243 "$ac_dir/msg.pot: $ac_dir/Makefile dummy
244 @cd $ac_dir && \$(MAKE) msg.pot
245 $ac_dir/msg.pot: tools/wmc include"
247 if wine_fn_has_flag po $ac_flags
249 wine_fn_append_file ALL_POT_FILES $ac_dir/rsrc.pot
250 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
251 "$ac_dir/rsrc.pot: $ac_dir/Makefile dummy
252 @cd $ac_dir && \$(MAKE) rsrc.pot
253 $ac_dir/rsrc.pot: tools/wrc include"
257 wine_fn_config_makefile ()
263 AS_VAR_IF([$ac_enable],[no],[return 0])
265 wine_fn_all_dir_rules $ac_dir ${ac_rules:-Make.rules}
266 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
269 $ac_dir: $ac_dir/Makefile dummy
270 @cd $ac_dir && \$(MAKE)"
272 wine_fn_has_flag install-lib $ac_flags || wine_fn_has_flag install-dev $ac_flags || return
274 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
275 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
276 $ac_dir/__install__:: $ac_dir
277 @cd $ac_dir && \$(MAKE) install
278 $ac_dir/__uninstall__:: $ac_dir/Makefile
279 @cd $ac_dir && \$(MAKE) uninstall
280 install:: $ac_dir/__install__
281 __uninstall__: $ac_dir/__uninstall__"
283 if wine_fn_has_flag install-lib $ac_flags
285 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
286 ".PHONY: $ac_dir/__install-lib__
287 $ac_dir/__install-lib__:: $ac_dir
288 @cd $ac_dir && \$(MAKE) install-lib
289 install-lib:: $ac_dir/__install-lib__"
292 if wine_fn_has_flag install-dev $ac_flags
294 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
295 ".PHONY: $ac_dir/__install-dev
296 $ac_dir/__install-dev__:: $ac_dir
297 @cd $ac_dir && \$(MAKE) install-dev
298 install-dev:: $ac_dir/__install-dev__"
302 wine_fn_config_lib ()
307 wine_fn_config_makefile $ac_dir enable_$ac_name "$ac_flags" dlls/Makeimplib.rules
309 if wine_fn_has_flag install-dev $ac_flags
312 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
313 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
314 $ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir)
315 \$(INSTALL_DATA) $ac_dir/lib$ac_name.a \$(DESTDIR)\$(dlldir)/lib$ac_name.a
316 $ac_dir/__uninstall__::
317 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_name.a
318 install install-dev:: $ac_dir/__install__
319 __uninstall__: $ac_dir/__uninstall__"
322 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "__builddeps__: $ac_dir"
323 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "$ac_dir: tools/widl tools/winebuild tools/winegcc include"
326 wine_fn_config_dll ()
332 ac_implib=${4:-$ac_name}
333 ac_file=$ac_dir/lib$ac_implib
335 ac_deps="tools/widl tools/winebuild tools/winegcc include"
339 *16) ac_implibflags=" -m16" ;;
341 *) ac_dll=$ac_dll.dll ;;
344 wine_fn_config_makefile $ac_dir $ac_enable "$ac_flags" dlls/Makedll.rules
346 AS_VAR_IF([$ac_enable],[no],
347 dnl enable_win16 is special in that it disables import libs too
348 [test "$ac_enable" != enable_win16 || return 0
349 wine_fn_has_flag implib $ac_flags && wine_fn_all_dir_rules $ac_dir dlls/Makedll.rules],
351 [wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
352 "$ac_dir: __builddeps__
353 manpages htmlpages sgmlpages xmlpages:: $ac_dir/Makefile
354 @cd $ac_dir && \$(MAKE) \$[@]"
356 if wine_fn_has_flag install-lib $ac_flags
359 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
360 ".PHONY: $ac_dir/__install-lib__ $ac_dir/__uninstall__
361 install install-lib:: $ac_dir/__install-lib__
362 __uninstall__: $ac_dir/__uninstall__"
365 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
366 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
367 \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT
368 \$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll
369 $ac_dir/__uninstall__::
370 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll"
372 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
373 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
374 \$(INSTALL_PROGRAM) $ac_dir/$ac_dll \$(DESTDIR)\$(dlldir)/$ac_dll
375 $ac_dir/__uninstall__::
376 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll"
380 wine_fn_pot_rules $ac_dir $ac_flags])
382 if wine_fn_has_flag staticimplib $ac_flags
384 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
385 "__builddeps__: $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT
386 $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps
387 $ac_file.def: $ac_dir/$ac_name.spec $ac_dir/Makefile
388 @cd $ac_dir && \$(MAKE) lib$ac_implib.def
389 $ac_file.$STATIC_IMPLIBEXT: $ac_dir/Makefile dummy
390 @cd $ac_dir && \$(MAKE) lib$ac_implib.$STATIC_IMPLIBEXT
391 .PHONY: $ac_dir/__install-dev__ $ac_dir/__uninstall__
392 $ac_dir/__install-dev__:: $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)
393 \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
394 $ac_dir/__uninstall__::
395 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
396 install install-dev:: $ac_dir/__install-dev__
397 __uninstall__: $ac_dir/__uninstall__"
399 if test "$IMPLIBEXT" != "$STATIC_IMPLIBEXT"
401 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
402 "$ac_dir/__install-dev__:: $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir) __builddeps__
403 \$(INSTALL_DATA) $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT
404 $ac_dir/__uninstall__::
405 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT"
408 if test "x$CROSSTEST_DISABLE" = x
410 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
411 "__builddeps__: $ac_file.cross.a
412 $ac_file.cross.a: $ac_dir/Makefile dummy
413 @cd $ac_dir && \$(MAKE) lib$ac_implib.cross.a"
416 elif wine_fn_has_flag implib $ac_flags
418 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
419 "__builddeps__: $ac_file.$IMPLIBEXT
420 $ac_file.def: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
421 \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --def -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec
422 $ac_file.a: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
423 \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --implib -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec
424 .PHONY: $ac_dir/__install-dev__ $ac_dir/__uninstall__
425 $ac_dir/__install-dev__:: $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)
426 \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
427 $ac_dir/__uninstall__::
428 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
429 install install-dev:: $ac_dir/__install-dev__
430 __uninstall__: $ac_dir/__uninstall__"
431 if test "x$CROSSTEST_DISABLE" = x
433 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
434 "__builddeps__: $ac_file.cross.a
435 $ac_file.cross.a: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
436 \$(WINEBUILD) \$(CROSSTARGET:%=-b %)$ac_implibflags -w --implib -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec"
439 if test "$ac_name" != "$ac_implib"
441 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
442 "__builddeps__: dlls/lib$ac_implib.$IMPLIBEXT
443 dlls/lib$ac_implib.$IMPLIBEXT: $ac_file.$IMPLIBEXT
444 \$(RM) \$[@] && \$(LN_S) $ac_name/lib$ac_implib.$IMPLIBEXT \$[@]
446 \$(RM) dlls/lib$ac_implib.$IMPLIBEXT"
447 if test "x$CROSSTEST_DISABLE" = x
449 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
450 "__builddeps__: dlls/lib$ac_implib.cross.a
451 dlls/lib$ac_implib.cross.a: $ac_file.cross.a
452 \$(RM) \$[@] && \$(LN_S) $ac_name/lib$ac_implib.cross.a \$[@]"
458 wine_fn_config_program ()
461 ac_dir=programs/$ac_name
468 *) ac_program=$ac_program.exe ;;
471 wine_fn_config_makefile $ac_dir $ac_enable "$ac_flags" programs/Makeprog.rules
473 AS_VAR_IF([$ac_enable],[no],,[wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
474 "$ac_dir: __builddeps__"
476 wine_fn_pot_rules $ac_dir $ac_flags
478 wine_fn_has_flag install $ac_flags || return
479 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
480 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
481 install install-lib:: $ac_dir/__install__
482 __uninstall__: $ac_dir/__uninstall__"
486 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
487 "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
488 \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT
489 \$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program
490 $ac_dir/__uninstall__::
491 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program"
493 if test "x$enable_tools" != xno && wine_fn_has_flag installbin $ac_flags
495 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
496 "$ac_dir/__install__:: tools \$(DESTDIR)\$(bindir)
497 \$(INSTALL_SCRIPT) tools/wineapploader \$(DESTDIR)\$(bindir)/$ac_name
498 $ac_dir/__uninstall__::
499 \$(RM) \$(DESTDIR)\$(bindir)/$ac_name"
502 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
503 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
504 \$(INSTALL_PROGRAM) $ac_dir/$ac_program \$(DESTDIR)\$(dlldir)/$ac_program
505 $ac_dir/__uninstall__::
506 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program"
509 if test "x$enable_tools" != xno && wine_fn_has_flag manpage $ac_flags
511 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
512 "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(mandir)/man\$(prog_manext)
513 \$(INSTALL_DATA) $ac_dir/$ac_name.man \$(DESTDIR)\$(mandir)/man\$(prog_manext)/$ac_name.\$(prog_manext)
514 $ac_dir/__uninstall__::
515 \$(RM) \$(DESTDIR)\$(mandir)/man\$(prog_manext)/$ac_name.\$(prog_manext)"
519 wine_fn_config_test ()
524 wine_fn_append_file ALL_TEST_RESOURCES $ac_name.res
525 wine_fn_all_dir_rules $ac_dir Maketest.rules
527 AS_VAR_IF([enable_tests],[no],,[wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
530 $ac_dir: $ac_dir/Makefile programs/winetest/Makefile __builddeps__ dummy
531 @cd $ac_dir && \$(MAKE)
532 programs/winetest: $ac_dir
533 check test: $ac_dir/__test__
534 .PHONY: $ac_dir/__test__
535 $ac_dir/__test__: dummy
536 @cd $ac_dir && \$(MAKE) test
540 if test "x$CROSSTEST_DISABLE" = x
542 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
543 "crosstest: $ac_dir/__crosstest__
544 .PHONY: $ac_dir/__crosstest__
545 $ac_dir/__crosstest__: $ac_dir/Makefile __builddeps__ dummy
546 @cd $ac_dir && \$(MAKE) crosstest"
550 wine_fn_config_tool ()
554 AS_VAR_IF([enable_tools],[no],[return 0])
556 wine_fn_config_makefile $ac_dir enable_tools $ac_flags
558 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "__tooldeps__: $ac_dir"
559 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "$ac_dir: libs/port"
561 tools/winebuild) wine_fn_append_rule ALL_MAKEFILE_DEPENDS "\$(WINEBUILD): $ac_dir" ;;
565 wine_fn_config_makerules ()
569 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
570 "$ac_rules: $ac_rules.in $ac_deps config.status
571 @./config.status $ac_rules
576 wine_fn_config_symlink ()
579 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
581 @./config.status $ac_link
586 if test "x$CROSSTEST_DISABLE" != x
588 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
590 @echo \"crosstest is not supported (mingw not installed?)\" && false"
593 dnl **** Define helper function to append a file to a makefile file list ****
595 dnl Usage: WINE_APPEND_FILE(var,file)
597 AC_DEFUN([WINE_APPEND_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_file $1 "$2"])
599 dnl **** Define helper function to append a rule to a makefile command list ****
601 dnl Usage: WINE_APPEND_RULE(var,rule)
603 AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_rule $1 "$2"])
605 dnl **** Create nonexistent directories from config.status ****
607 dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
609 AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
610 [AC_CONFIG_COMMANDS([$1],[test -d "$1" || { AC_MSG_NOTICE([creating $1]); AS_MKDIR_P("$1"); }])])
612 dnl **** Create symlinks from config.status ****
614 dnl Usage: WINE_CONFIG_SYMLINK(name,target,enable)
616 AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
617 m4_ifval([$3],[if test "x$[$3]" != xno; then
618 ])AC_CONFIG_LINKS([$1:]m4_default([$2],[$1]))dnl
619 m4_if([$2],,[test "$srcdir" = "." || ])wine_fn_config_symlink $1[]m4_ifval([$3],[
622 dnl **** Create a make rules file from config.status ****
624 dnl Usage: WINE_CONFIG_MAKERULES(file,var,deps)
626 AC_DEFUN([WINE_CONFIG_MAKERULES],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
627 wine_fn_config_makerules $1 $3
629 AC_SUBST_FILE([$2])dnl
630 AC_CONFIG_FILES([$1])])
632 dnl **** Create a makefile from config.status ****
634 dnl Usage: WINE_CONFIG_MAKEFILE(file,enable,flags)
636 AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
637 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
638 wine_fn_config_makefile [$1] ac_enable [$3]dnl
639 AS_VAR_POPDEF([ac_enable])])
641 dnl **** Create a dll makefile from config.status ****
643 dnl Usage: WINE_CONFIG_DLL(name,enable,flags,implib)
645 AC_DEFUN([WINE_CONFIG_DLL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
646 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
647 wine_fn_config_dll [$1] ac_enable [$3] [$4]dnl
648 AS_VAR_POPDEF([ac_enable])])
650 dnl **** Create a program makefile from config.status ****
652 dnl Usage: WINE_CONFIG_PROGRAM(name,enable,flags)
654 AC_DEFUN([WINE_CONFIG_PROGRAM],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
655 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
656 wine_fn_config_program [$1] ac_enable [$3]dnl
657 AS_VAR_POPDEF([ac_enable])])
659 dnl **** Create a test makefile from config.status ****
661 dnl Usage: WINE_CONFIG_TEST(dir,flags)
663 AC_DEFUN([WINE_CONFIG_TEST],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
664 m4_pushdef([ac_suffix],m4_if(m4_substr([$1],0,9),[programs/],[.exe_test],[_test]))dnl
665 m4_pushdef([ac_name],[m4_bpatsubst([$1],[.*/\(.*\)/tests$],[\1])])dnl
666 wine_fn_config_test $1 ac_name[]ac_suffix [$2]dnl
667 m4_popdef([ac_suffix])dnl
668 m4_popdef([ac_name])])
670 dnl **** Create a static lib makefile from config.status ****
672 dnl Usage: WINE_CONFIG_LIB(name,flags)
674 AC_DEFUN([WINE_CONFIG_LIB],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
675 wine_fn_config_lib [$1] [$2]])
677 dnl **** Create a tool makefile from config.status ****
679 dnl Usage: WINE_CONFIG_TOOL(name,flags)
681 AC_DEFUN([WINE_CONFIG_TOOL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
682 wine_fn_config_tool [$1] [$2]])
684 dnl **** Add a message to the list displayed at the end ****
686 dnl Usage: WINE_NOTICE(notice)
687 dnl Usage: WINE_NOTICE_WITH(with_flag, test, notice)
688 dnl Usage: WINE_WARNING(warning)
689 dnl Usage: WINE_WARNING_WITH(with_flag, test, warning)
690 dnl Usage: WINE_PRINT_MESSAGES
692 AC_DEFUN([WINE_NOTICE],[AS_VAR_APPEND([wine_notices],["|$1"])])
693 AC_DEFUN([WINE_WARNING],[AS_VAR_APPEND([wine_warnings],["|$1"])])
695 AC_DEFUN([WINE_NOTICE_WITH],[AS_IF([$2],[case "x$with_$1" in
696 x) WINE_NOTICE([$3]) ;;
699 This is an error since --with-$1 was requested.]) ;;
702 AC_DEFUN([WINE_WARNING_WITH],[AS_IF([$2],[case "x$with_$1" in
703 x) WINE_WARNING([$3]) ;;
706 This is an error since --with-$1 was requested.]) ;;
709 AC_DEFUN([WINE_ERROR_WITH],[AS_IF([$2],[case "x$with_$1" in
712 Use the --without-$1 option if you really want this.]) ;;
715 AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS"
716 if test "x$wine_notices != "x; then
719 for msg in $wine_notices; do
721 if test -n "$msg"; then
722 AC_MSG_NOTICE([$msg])
727 for msg in $wine_warnings; do
729 if test -n "$msg"; then
737 dnl compile-command: "autoreconf --warnings=all"