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 **** Get the programs used by WINE_GET_SONAME ****
27 dnl Usage: WINE_PATH_SONAME_TOOLS
29 AC_DEFUN([WINE_PATH_SONAME_TOOLS],
30 [AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)
31 AC_CHECK_TOOLS(READELF,[readelf],true)])
33 dnl **** Extract the soname of a library ****
35 dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]])
37 AC_DEFUN([WINE_CHECK_SONAME],
38 [AC_REQUIRE([WINE_PATH_SONAME_TOOLS])dnl
39 AS_VAR_PUSHDEF([ac_Lib],[ac_cv_lib_soname_$1])dnl
40 m4_pushdef([ac_lib_pattern],m4_default([$6],[lib$1]))dnl
41 AC_MSG_CHECKING([for -l$1])
43 [ac_check_soname_save_LIBS=$LIBS
45 AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
47 dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;;
48 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'`]) ;;
49 *) 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'`])
50 AS_IF([test "x]AS_VAR_GET(ac_Lib)[" = x],
51 [AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`])]) ;;
53 LIBS=$ac_check_soname_save_LIBS])dnl
54 AS_IF([test "x]AS_VAR_GET(ac_Lib)[" = "x"],
55 [AC_MSG_RESULT([not found])
57 [AC_MSG_RESULT(AS_VAR_GET(ac_Lib))
58 AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),["]AS_VAR_GET(ac_Lib)["],
59 [Define to the soname of the lib$1 library.])
61 m4_popdef([ac_lib_pattern])dnl
62 AS_VAR_POPDEF([ac_Lib])])
64 dnl **** Link C code with an assembly file ****
66 dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]])
68 AC_DEFUN([WINE_TRY_ASM_LINK],
69 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[asm($1); $3]])],[$4],[$5])])
71 dnl **** Check if we can link an empty program with special CFLAGS ****
73 dnl Usage: WINE_TRY_CFLAGS(flags,[action-if-yes,[action-if-no]])
75 dnl The default action-if-yes is to append the flags to EXTRACFLAGS.
77 AC_DEFUN([WINE_TRY_CFLAGS],
78 [AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
79 AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
80 [ac_wine_try_cflags_saved=$CFLAGS
82 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
83 [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
84 CFLAGS=$ac_wine_try_cflags_saved])
85 AS_IF([test AS_VAR_GET(ac_var) = yes],
86 [m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
87 AS_VAR_POPDEF([ac_var])])
89 dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS ****
91 dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]])
93 AC_DEFUN([WINE_TRY_SHLIB_FLAGS],
94 [ac_wine_try_cflags_saved=$CFLAGS
96 AC_LINK_IFELSE([AC_LANG_SOURCE([void myfunc() {}])],[$2],[$3])
97 CFLAGS=$ac_wine_try_cflags_saved])
99 dnl **** Check whether we need to define a symbol on the compiler command line ****
101 dnl Usage: WINE_CHECK_DEFINE(name),[action-if-yes,[action-if-no]])
103 AC_DEFUN([WINE_CHECK_DEFINE],
104 [AS_VAR_PUSHDEF([ac_var],[ac_cv_cpp_def_$1])dnl
105 AC_CACHE_CHECK([whether we need to define $1],ac_var,
106 AC_EGREP_CPP(yes,[#ifndef $1
109 [AS_VAR_SET(ac_var,yes)],[AS_VAR_SET(ac_var,no)]))
110 AS_IF([test AS_VAR_GET(ac_var) = yes],
111 [CFLAGS="$CFLAGS -D$1"
112 LINTFLAGS="$LINTFLAGS -D$1"])dnl
113 AS_VAR_POPDEF([ac_var])])
115 dnl **** Check for functions with some extra libraries ****
117 dnl Usage: WINE_CHECK_LIB_FUNCS(funcs,libs,[action-if-found,[action-if-not-found]])
119 AC_DEFUN([WINE_CHECK_LIB_FUNCS],
120 [ac_wine_check_funcs_save_LIBS="$LIBS"
122 AC_CHECK_FUNCS([$1],[$3],[$4])
123 LIBS="$ac_wine_check_funcs_save_LIBS"])
125 dnl **** Check for a mingw program, trying the various mingw prefixes ****
127 dnl Usage: WINE_CHECK_MINGW_PROG(variable,prog,[value-if-not-found],[path])
129 AC_DEFUN([WINE_CHECK_MINGW_PROG],
132 ac_prefix_list="m4_foreach([ac_wine_prefix],[w64-mingw32, pc-mingw32, mingw32msvc, mingw32],
133 m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-ac_wine_prefix-$2 ]))
136 ac_prefix_list="m4_foreach([ac_wine_prefix],[pc-mingw32, w64-mingw32, mingw32msvc],
137 m4_foreach([ac_wine_cpu],[x86_64,amd64],[ac_wine_cpu-ac_wine_prefix-$2 ]))" ;;
141 AC_CHECK_PROGS([$1],[$ac_prefix_list],[$3],[$4])])
144 dnl **** Define helper functions for creating config.status files ****
146 dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
148 AC_DEFUN([WINE_CONFIG_HELPERS],
149 [ALL_MAKEFILE_DEPENDS="
150 # Rules automatically generated by configure
155 Makefile: Makefile.in Make.vars.in Make.rules config.status
156 @./config.status Make.tmp Makefile"
159 AC_SUBST(ALL_TEST_RESOURCES,"")
161 wine_fn_append_file ()
163 AS_VAR_APPEND($[1]," \\$as_nl $[2]")
166 wine_fn_append_rule ()
168 AS_VAR_APPEND($[1],"$as_nl$[2]")
173 expr ",$[2]," : ".*,$[1],.*" >/dev/null
176 wine_fn_all_dir_rules ()
180 ac_makedep="\$(MAKEDEP)"
181 ac_input=Make.vars.in:$ac_dir/Makefile.in
182 if test $ac_dir != tools
184 dnl makedep is in tools so tools makefile cannot depend on it
185 ac_alldeps="$[2] $ac_makedep"
187 ac_alldeps="$[2] include/config.h"
190 *.in) ac_input=$ac_input:$[2] ;;
191 *) ac_makedep="$[2] $ac_makedep" ;;
194 wine_fn_append_file ALL_DIRS $ac_dir
195 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
196 "__clean__: $ac_dir/__clean__
197 .PHONY: $ac_dir/__clean__
198 $ac_dir/__clean__: $ac_dir/Makefile
199 @cd $ac_dir && \$(MAKE) clean
200 \$(RM) $ac_dir/Makefile
201 $ac_dir/Makefile: $ac_dir/Makefile.in Make.vars.in config.status $ac_alldeps
202 @./config.status --file $ac_dir/Makefile:$ac_input && cd $ac_dir && \$(MAKE) depend
203 depend: $ac_dir/__depend__
204 .PHONY: $ac_dir/__depend__
205 $ac_dir/__depend__: $ac_makedep dummy
206 @./config.status --file $ac_dir/Makefile:$ac_input && cd $ac_dir && \$(MAKE) depend"
214 test "x$with_gettextpo" = xyes || return
216 if wine_fn_has_flag mc $ac_flags
218 wine_fn_append_file ALL_POT_FILES $ac_dir/msg.pot
219 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
220 "$ac_dir/msg.pot: $ac_dir/Makefile dummy
221 @cd $ac_dir && \$(MAKE) msg.pot
222 $ac_dir/msg.pot: tools/wmc include"
224 if wine_fn_has_flag po $ac_flags
226 wine_fn_append_file ALL_POT_FILES $ac_dir/rsrc.pot
227 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
228 "$ac_dir/rsrc.pot: $ac_dir/Makefile dummy
229 @cd $ac_dir && \$(MAKE) rsrc.pot
230 $ac_dir/rsrc.pot: tools/wrc include"
234 wine_fn_config_makefile ()
240 AS_VAR_IF([$ac_enable],[no],[return 0])
242 wine_fn_all_dir_rules $ac_dir ${ac_rules:-Make.rules}
243 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
246 $ac_dir: $ac_dir/Makefile dummy
247 @cd $ac_dir && \$(MAKE)"
249 wine_fn_has_flag install-lib $ac_flags || wine_fn_has_flag install-dev $ac_flags || return
251 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
252 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
253 $ac_dir/__install__:: $ac_dir
254 @cd $ac_dir && \$(MAKE) install
255 $ac_dir/__uninstall__:: $ac_dir/Makefile
256 @cd $ac_dir && \$(MAKE) uninstall
257 install:: $ac_dir/__install__
258 __uninstall__: $ac_dir/__uninstall__"
260 if wine_fn_has_flag install-lib $ac_flags
262 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
263 ".PHONY: $ac_dir/__install-lib__
264 $ac_dir/__install-lib__:: $ac_dir
265 @cd $ac_dir && \$(MAKE) install-lib
266 install-lib:: $ac_dir/__install-lib__"
269 if wine_fn_has_flag install-dev $ac_flags
271 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
272 ".PHONY: $ac_dir/__install-dev
273 $ac_dir/__install-dev__:: $ac_dir
274 @cd $ac_dir && \$(MAKE) install-dev
275 install-dev:: $ac_dir/__install-dev__"
279 wine_fn_config_lib ()
284 wine_fn_config_makefile $ac_dir enable_$ac_name "$ac_flags" dlls/Makeimplib.rules
286 if wine_fn_has_flag install-dev $ac_flags
289 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
290 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
291 $ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir)
292 \$(INSTALL_DATA) $ac_dir/lib$ac_name.a \$(DESTDIR)\$(dlldir)/lib$ac_name.a
293 $ac_dir/__uninstall__::
294 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_name.a
295 install install-dev:: $ac_dir/__install__
296 __uninstall__: $ac_dir/__uninstall__"
299 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "__builddeps__: $ac_dir"
300 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "$ac_dir: tools/widl tools/winebuild tools/winegcc include"
303 wine_fn_config_dll ()
309 ac_implib=${4:-$ac_name}
310 ac_file=$ac_dir/lib$ac_implib
312 ac_deps="tools/widl tools/winebuild tools/winegcc include"
316 *16) ac_implibflags=" -m16" ;;
318 *) ac_dll=$ac_dll.dll ;;
321 wine_fn_config_makefile $ac_dir $ac_enable "$ac_flags" dlls/Makedll.rules
323 AS_VAR_IF([$ac_enable],[no],
324 dnl enable_win16 is special in that it disables import libs too
325 [test "$ac_enable" != enable_win16 || return 0
326 wine_fn_has_flag implib $ac_flags && wine_fn_all_dir_rules $ac_dir dlls/Makedll.rules],
328 [wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
329 "$ac_dir: __builddeps__
330 manpages htmlpages sgmlpages xmlpages:: $ac_dir/Makefile
331 @cd $ac_dir && \$(MAKE) \$[@]"
333 if wine_fn_has_flag install-lib $ac_flags
336 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
337 ".PHONY: $ac_dir/__install-lib__ $ac_dir/__uninstall__
338 install install-lib:: $ac_dir/__install-lib__
339 __uninstall__: $ac_dir/__uninstall__"
342 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
343 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
344 \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT
345 \$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll
346 $ac_dir/__uninstall__::
347 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll"
349 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
350 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
351 \$(INSTALL_PROGRAM) $ac_dir/$ac_dll \$(DESTDIR)\$(dlldir)/$ac_dll
352 $ac_dir/__uninstall__::
353 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll"
357 wine_fn_pot_rules $ac_dir $ac_flags])
359 if wine_fn_has_flag staticimplib $ac_flags
361 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
362 "__builddeps__: $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT
363 $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps
364 $ac_file.def: $ac_dir/$ac_name.spec $ac_dir/Makefile
365 @cd $ac_dir && \$(MAKE) lib$ac_implib.def
366 $ac_file.$STATIC_IMPLIBEXT: $ac_dir/Makefile dummy
367 @cd $ac_dir && \$(MAKE) lib$ac_implib.$STATIC_IMPLIBEXT
368 .PHONY: $ac_dir/__install-dev__ $ac_dir/__uninstall__
369 $ac_dir/__install-dev__:: $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)
370 \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
371 $ac_dir/__uninstall__::
372 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
373 install install-dev:: $ac_dir/__install-dev__
374 __uninstall__: $ac_dir/__uninstall__"
376 if test "$IMPLIBEXT" != "$STATIC_IMPLIBEXT"
378 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
379 "$ac_dir/__install-dev__:: $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir) __builddeps__
380 \$(INSTALL_DATA) $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT
381 $ac_dir/__uninstall__::
382 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT"
385 if test "x$CROSSTEST_DISABLE" = x
387 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
388 "__builddeps__: $ac_file.cross.a
389 $ac_file.cross.a: $ac_dir/Makefile dummy
390 @cd $ac_dir && \$(MAKE) lib$ac_implib.cross.a"
393 elif wine_fn_has_flag implib $ac_flags
395 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
396 "__builddeps__: $ac_file.$IMPLIBEXT
397 $ac_file.def: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
398 \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --def -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec
399 $ac_file.a: $ac_dir/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
400 \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --implib -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec
401 .PHONY: $ac_dir/__install-dev__ $ac_dir/__uninstall__
402 $ac_dir/__install-dev__:: $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)
403 \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
404 $ac_dir/__uninstall__::
405 \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
406 install install-dev:: $ac_dir/__install-dev__
407 __uninstall__: $ac_dir/__uninstall__"
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/$ac_name.spec $ac_dir/Makefile \$(WINEBUILD)
413 \$(WINEBUILD) \$(CROSSTARGET:%=-b %)$ac_implibflags -w --implib -o \$[@] --export \$(srcdir)/$ac_dir/$ac_name.spec"
416 if test "$ac_name" != "$ac_implib"
418 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
419 "__builddeps__: dlls/lib$ac_implib.$IMPLIBEXT
420 dlls/lib$ac_implib.$IMPLIBEXT: $ac_file.$IMPLIBEXT
421 \$(RM) \$[@] && \$(LN_S) $ac_name/lib$ac_implib.$IMPLIBEXT \$[@]
423 \$(RM) dlls/lib$ac_implib.$IMPLIBEXT"
424 if test "x$CROSSTEST_DISABLE" = x
426 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
427 "__builddeps__: dlls/lib$ac_implib.cross.a
428 dlls/lib$ac_implib.cross.a: $ac_file.cross.a
429 \$(RM) \$[@] && \$(LN_S) $ac_name/lib$ac_implib.cross.a \$[@]"
435 wine_fn_config_program ()
438 ac_dir=programs/$ac_name
445 *) ac_program=$ac_program.exe ;;
448 wine_fn_config_makefile $ac_dir $ac_enable "$ac_flags" programs/Makeprog.rules
450 AS_VAR_IF([$ac_enable],[no],,[wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
451 "$ac_dir: __builddeps__"
453 wine_fn_pot_rules $ac_dir $ac_flags
455 wine_fn_has_flag install $ac_flags || return
456 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
457 ".PHONY: $ac_dir/__install__ $ac_dir/__uninstall__
458 install install-lib:: $ac_dir/__install__
459 __uninstall__: $ac_dir/__uninstall__"
463 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
464 "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(dlldir) \$(DESTDIR)\$(fakedlldir)
465 \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT
466 \$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program
467 $ac_dir/__uninstall__::
468 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program"
470 if test "x$enable_tools" != xno && wine_fn_has_flag installbin $ac_flags
472 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
473 "$ac_dir/__install__:: tools \$(DESTDIR)\$(bindir)
474 \$(INSTALL_SCRIPT) tools/wineapploader \$(DESTDIR)\$(bindir)/$ac_name
475 $ac_dir/__uninstall__::
476 \$(RM) \$(DESTDIR)\$(bindir)/$ac_name"
479 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
480 "$ac_dir/__install-lib__:: $ac_dir \$(DESTDIR)\$(dlldir)
481 \$(INSTALL_PROGRAM) $ac_dir/$ac_program \$(DESTDIR)\$(dlldir)/$ac_program
482 $ac_dir/__uninstall__::
483 \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program"
486 if test "x$enable_tools" != xno && wine_fn_has_flag manpage $ac_flags
488 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
489 "$ac_dir/__install__:: $ac_dir \$(DESTDIR)\$(mandir)/man\$(prog_manext)
490 \$(INSTALL_DATA) $ac_dir/$ac_name.man \$(DESTDIR)\$(mandir)/man\$(prog_manext)/$ac_name.\$(prog_manext)
491 $ac_dir/__uninstall__::
492 \$(RM) \$(DESTDIR)\$(mandir)/man\$(prog_manext)/$ac_name.\$(prog_manext)"
496 wine_fn_config_test ()
501 wine_fn_append_file ALL_TEST_RESOURCES $ac_name.res
502 wine_fn_all_dir_rules $ac_dir Maketest.rules
504 AS_VAR_IF([enable_tests],[no],,[wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
507 $ac_dir: $ac_dir/Makefile programs/winetest/Makefile __builddeps__ dummy
508 @cd $ac_dir && \$(MAKE)
509 programs/winetest: $ac_dir
510 check test: $ac_dir/__test__
511 .PHONY: $ac_dir/__test__
512 $ac_dir/__test__: dummy
513 @cd $ac_dir && \$(MAKE) test
517 if test "x$CROSSTEST_DISABLE" = x
519 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
520 "crosstest: $ac_dir/__crosstest__
521 .PHONY: $ac_dir/__crosstest__
522 $ac_dir/__crosstest__: $ac_dir/Makefile __builddeps__ dummy
523 @cd $ac_dir && \$(MAKE) crosstest"
527 wine_fn_config_tool ()
531 AS_VAR_IF([enable_tools],[no],[return 0])
533 wine_fn_config_makefile $ac_dir enable_tools $ac_flags
535 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "__tooldeps__: $ac_dir"
536 wine_fn_append_rule ALL_MAKEFILE_DEPENDS "$ac_dir: libs/port"
538 tools/winebuild) wine_fn_append_rule ALL_MAKEFILE_DEPENDS "\$(WINEBUILD): $ac_dir" ;;
542 wine_fn_config_makerules ()
546 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
547 "$ac_rules: $ac_rules.in $ac_deps config.status
548 @./config.status $ac_rules
553 wine_fn_config_symlink ()
556 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
558 @./config.status $ac_link
563 if test "x$CROSSTEST_DISABLE" != x
565 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
567 @echo \"crosstest is not supported (mingw not installed?)\" && false"
570 dnl **** Define helper function to append a file to a makefile file list ****
572 dnl Usage: WINE_APPEND_FILE(var,file)
574 AC_DEFUN([WINE_APPEND_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_file $1 "$2"])
576 dnl **** Define helper function to append a rule to a makefile command list ****
578 dnl Usage: WINE_APPEND_RULE(var,rule)
580 AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_rule $1 "$2"])
582 dnl **** Create nonexistent directories from config.status ****
584 dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
586 AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
587 [AC_CONFIG_COMMANDS([$1],[test -d "$1" || { AC_MSG_NOTICE([creating $1]); AS_MKDIR_P("$1"); }])])
589 dnl **** Create symlinks from config.status ****
591 dnl Usage: WINE_CONFIG_SYMLINK(name,target,enable)
593 AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
594 m4_ifval([$3],[if test "x$[$3]" != xno; then
595 ])AC_CONFIG_LINKS([$1:]m4_default([$2],[$1]))dnl
596 m4_if([$2],,[test "$srcdir" = "." || ])wine_fn_config_symlink $1[]m4_ifval([$3],[
599 dnl **** Create a make rules file from config.status ****
601 dnl Usage: WINE_CONFIG_MAKERULES(file,var,deps)
603 AC_DEFUN([WINE_CONFIG_MAKERULES],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
604 wine_fn_config_makerules $1 $3
606 AC_SUBST_FILE([$2])dnl
607 AC_CONFIG_FILES([$1])])
609 dnl **** Create a makefile from config.status ****
611 dnl Usage: WINE_CONFIG_MAKEFILE(file,enable,flags)
613 AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
614 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
615 wine_fn_config_makefile [$1] ac_enable [$3]dnl
616 AS_VAR_POPDEF([ac_enable])])
618 dnl **** Create a dll makefile from config.status ****
620 dnl Usage: WINE_CONFIG_DLL(name,enable,flags,implib)
622 AC_DEFUN([WINE_CONFIG_DLL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
623 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
624 wine_fn_config_dll [$1] ac_enable [$3] [$4]dnl
625 AS_VAR_POPDEF([ac_enable])])
627 dnl **** Create a program makefile from config.status ****
629 dnl Usage: WINE_CONFIG_PROGRAM(name,enable,flags)
631 AC_DEFUN([WINE_CONFIG_PROGRAM],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
632 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]$1))dnl
633 wine_fn_config_program [$1] ac_enable [$3]dnl
634 AS_VAR_POPDEF([ac_enable])])
636 dnl **** Create a test makefile from config.status ****
638 dnl Usage: WINE_CONFIG_TEST(dir,flags)
640 AC_DEFUN([WINE_CONFIG_TEST],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
641 m4_pushdef([ac_suffix],m4_if(m4_substr([$1],0,9),[programs/],[.exe_test],[_test]))dnl
642 m4_pushdef([ac_name],[m4_bpatsubst([$1],[.*/\(.*\)/tests$],[\1])])dnl
643 wine_fn_config_test $1 ac_name[]ac_suffix [$2]dnl
644 m4_popdef([ac_suffix])dnl
645 m4_popdef([ac_name])])
647 dnl **** Create a static lib makefile from config.status ****
649 dnl Usage: WINE_CONFIG_LIB(name,flags)
651 AC_DEFUN([WINE_CONFIG_LIB],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
652 wine_fn_config_lib [$1] [$2]])
654 dnl **** Create a tool makefile from config.status ****
656 dnl Usage: WINE_CONFIG_TOOL(name,flags)
658 AC_DEFUN([WINE_CONFIG_TOOL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
659 wine_fn_config_tool [$1] [$2]])
661 dnl **** Add a message to the list displayed at the end ****
663 dnl Usage: WINE_NOTICE(notice)
664 dnl Usage: WINE_NOTICE_WITH(with_flag, test, notice)
665 dnl Usage: WINE_WARNING(warning)
666 dnl Usage: WINE_WARNING_WITH(with_flag, test, warning)
667 dnl Usage: WINE_PRINT_MESSAGES
669 AC_DEFUN([WINE_NOTICE],[AS_VAR_APPEND([wine_notices],["|$1"])])
670 AC_DEFUN([WINE_WARNING],[AS_VAR_APPEND([wine_warnings],["|$1"])])
672 AC_DEFUN([WINE_NOTICE_WITH],[AS_IF([$2],[case "x$with_$1" in
673 x) WINE_NOTICE([$3]) ;;
676 This is an error since --with-$1 was requested.]) ;;
679 AC_DEFUN([WINE_WARNING_WITH],[AS_IF([$2],[case "x$with_$1" in
680 x) WINE_WARNING([$3]) ;;
683 This is an error since --with-$1 was requested.]) ;;
686 AC_DEFUN([WINE_ERROR_WITH],[AS_IF([$2],[case "x$with_$1" in
689 Use the --without-$1 option if you really want this.]) ;;
692 AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS"
693 if test "x$wine_notices != "x; then
696 for msg in $wine_notices; do
698 if test -n "$msg"; then
699 AC_MSG_NOTICE([$msg])
704 for msg in $wine_warnings; do
706 if test -n "$msg"; then
714 dnl compile-command: "autoreconf --warnings=all"