blob: 15d125a30fe31a6f66d9f5ccc821c0fcd316bf7d [file] [log] [blame]
Alexandre Julliard67e8dc62002-05-20 18:29:58 +00001dnl Macros used to build the Wine configure script
2dnl
3dnl Copyright 2002 Alexandre Julliard
4dnl
5dnl This library is free software; you can redistribute it and/or
6dnl modify it under the terms of the GNU Lesser General Public
7dnl License as published by the Free Software Foundation; either
8dnl version 2.1 of the License, or (at your option) any later version.
9dnl
10dnl This library is distributed in the hope that it will be useful,
11dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13dnl Lesser General Public License for more details.
14dnl
15dnl You should have received a copy of the GNU Lesser General Public
16dnl License along with this library; if not, write to the Free Software
Jonathan Ernst360a3f92006-05-18 14:49:52 +020017dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000018dnl
Alexandre Julliard1d8d0172002-08-02 19:34:21 +000019dnl As a special exception to the GNU Lesser General Public License,
20dnl if you distribute this file as part of a program that contains a
21dnl configuration script generated by Autoconf, you may include it
22dnl under the same distribution terms that you use for the rest of
23dnl that program.
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000024
25dnl **** Get the ldd program name; used by WINE_GET_SONAME ****
26dnl
27dnl Usage: WINE_PATH_LDD
28dnl
29AC_DEFUN([WINE_PATH_LDD],[AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)])
30
31dnl **** Extract the soname of a library ****
32dnl
Alexandre Julliard66afa982007-07-02 17:02:51 +020033dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]])
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000034dnl
Alexandre Julliard66afa982007-07-02 17:02:51 +020035AC_DEFUN([WINE_CHECK_SONAME],
Alexandre Julliard30de3e82006-03-10 21:24:05 +010036[AC_REQUIRE([WINE_PATH_LDD])dnl
37AS_VAR_PUSHDEF([ac_Lib],[ac_cv_lib_soname_$1])dnl
Alexandre Julliard66afa982007-07-02 17:02:51 +020038m4_pushdef([ac_lib_pattern],m4_default([$6],[lib$1]))dnl
39AC_MSG_CHECKING([for -l$1])
Alexandre Julliard446befb2007-07-02 13:41:36 +020040AC_CACHE_VAL(ac_Lib,
Alexandre Julliard66afa982007-07-02 17:02:51 +020041[ac_check_soname_save_LIBS=$LIBS
42LIBS="-l$1 $5 $LIBS"
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000043 AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
Alexandre Julliardbdbffd92006-08-07 21:41:55 +020044 [case "$LIBEXT" in
Alexandre Goujon2b05c842010-03-01 21:39:39 +010045 dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;;
Alexandre Julliard66afa982007-07-02 17:02:51 +020046 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'`]) ;;
47 *) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`]) ;;
Alexandre Julliard446befb2007-07-02 13:41:36 +020048 esac])
Alexandre Julliard66afa982007-07-02 17:02:51 +020049 LIBS=$ac_check_soname_save_LIBS])dnl
Alexandre Julliard446befb2007-07-02 13:41:36 +020050AS_IF([test "x]AS_VAR_GET(ac_Lib)[" = "x"],
Alexandre Julliard66afa982007-07-02 17:02:51 +020051 [AC_MSG_RESULT([not found])
52 $4],
Alexandre Julliard446befb2007-07-02 13:41:36 +020053 [AC_MSG_RESULT(AS_VAR_GET(ac_Lib))
54 AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),["]AS_VAR_GET(ac_Lib)["],
Alexandre Julliard66afa982007-07-02 17:02:51 +020055 [Define to the soname of the lib$1 library.])
56 $3])dnl
57m4_popdef([ac_lib_pattern])dnl
Alexandre Julliard30de3e82006-03-10 21:24:05 +010058AS_VAR_POPDEF([ac_Lib])])
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000059
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000060dnl **** Link C code with an assembly file ****
61dnl
62dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]])
63dnl
64AC_DEFUN([WINE_TRY_ASM_LINK],
Alexandre Julliardad356de2007-06-08 20:23:16 +020065[AC_LINK_IFELSE(AC_LANG_PROGRAM([[$2]],[[asm($1); $3]]),[$4],[$5])])
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000066
67dnl **** Check if we can link an empty program with special CFLAGS ****
68dnl
69dnl Usage: WINE_TRY_CFLAGS(flags,[action-if-yes,[action-if-no]])
70dnl
Alexandre Julliard182d1502006-08-25 13:22:33 +020071dnl The default action-if-yes is to append the flags to EXTRACFLAGS.
72dnl
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000073AC_DEFUN([WINE_TRY_CFLAGS],
Alexandre Julliard182d1502006-08-25 13:22:33 +020074[AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
75AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000076[ac_wine_try_cflags_saved=$CFLAGS
77CFLAGS="$CFLAGS $1"
Yann Droneaud5d3eacd2010-03-04 11:43:17 +010078AC_LINK_IFELSE(AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]]),
Alexandre Julliard295806f2009-10-07 13:46:06 +020079 [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000080CFLAGS=$ac_wine_try_cflags_saved])
Alexandre Julliard182d1502006-08-25 13:22:33 +020081AS_IF([test AS_VAR_GET(ac_var) = yes],
82 [m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
83AS_VAR_POPDEF([ac_var])])
Alexandre Julliard67e8dc62002-05-20 18:29:58 +000084
Warren Baird421e8b92004-09-22 19:17:55 +000085dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS ****
86dnl
87dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]])
88dnl
89AC_DEFUN([WINE_TRY_SHLIB_FLAGS],
90[ac_wine_try_cflags_saved=$CFLAGS
91CFLAGS="$CFLAGS $1"
92AC_LINK_IFELSE([void myfunc() {}],[$2],[$3])
93CFLAGS=$ac_wine_try_cflags_saved])
94
Alexandre Julliard05783b52002-12-11 00:21:55 +000095dnl **** Check whether we need to define a symbol on the compiler command line ****
96dnl
97dnl Usage: WINE_CHECK_DEFINE(name),[action-if-yes,[action-if-no]])
98dnl
99AC_DEFUN([WINE_CHECK_DEFINE],
100[AS_VAR_PUSHDEF([ac_var],[ac_cv_cpp_def_$1])dnl
101AC_CACHE_CHECK([whether we need to define $1],ac_var,
102 AC_EGREP_CPP(yes,[#ifndef $1
103yes
104#endif],
105 [AS_VAR_SET(ac_var,yes)],[AS_VAR_SET(ac_var,no)]))
106AS_IF([test AS_VAR_GET(ac_var) = yes],
107 [CFLAGS="$CFLAGS -D$1"
108 LINTFLAGS="$LINTFLAGS -D$1"])dnl
109AS_VAR_POPDEF([ac_var])])
110
Alexandre Julliard2d1a6272006-02-11 20:54:06 +0100111dnl **** Check for functions with some extra libraries ****
112dnl
113dnl Usage: WINE_CHECK_LIB_FUNCS(funcs,libs,[action-if-found,[action-if-not-found]])
114dnl
115AC_DEFUN([WINE_CHECK_LIB_FUNCS],
116[ac_wine_check_funcs_save_LIBS="$LIBS"
117LIBS="$LIBS $2"
118AC_CHECK_FUNCS([$1],[$3],[$4])
119LIBS="$ac_wine_check_funcs_save_LIBS"])
120
Alexandre Julliardeae0dc22007-01-01 13:14:21 +0100121dnl **** Check for a mingw program, trying the various mingw prefixes ****
122dnl
123dnl Usage: WINE_CHECK_MINGW_PROG(variable,prog,[value-if-not-found],[path])
124dnl
125AC_DEFUN([WINE_CHECK_MINGW_PROG],
Alexandre Julliarda91fb212009-12-07 15:36:09 +0100126[case "$host_cpu" in
127 i[[3456789]]86*)
128 ac_prefix_list="m4_foreach([ac_wine_prefix],[pc-mingw32, mingw32msvc, mingw32],
129 m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-ac_wine_prefix-$2 ]))" ;;
130 x86_64)
131 ac_prefix_list="m4_foreach([ac_wine_prefix],[pc-mingw32,w64-mingw32],[x86_64-ac_wine_prefix-$2 ])" ;;
132 *)
133 ac_prefix_list="" ;;
134esac
135AC_CHECK_PROGS([$1],[$ac_prefix_list],[$3],[$4])])
Alexandre Julliardeae0dc22007-01-01 13:14:21 +0100136
137
Alexandre Julliard2de10c42010-02-11 23:23:45 +0100138dnl **** Define helper functions for creating config.status files ****
139dnl
140dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
141dnl
142AC_DEFUN([WINE_CONFIG_HELPERS],
143[wine_fn_append_file ()
144{
145 AS_VAR_APPEND($[1]," \\$as_nl $[2]")
146}
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100147
Alexandre Julliard2de10c42010-02-11 23:23:45 +0100148wine_fn_append_rule ()
149{
150 AS_VAR_APPEND($[1],"$as_nl$[2]")
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100151}
152
153wine_fn_config_makefile ()
154{
155 ac_dir=$[1]
156 ac_deps=$[2]
157 wine_fn_append_file ALL_DIRS $ac_dir
158 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
Alexandre Julliard50231942010-03-16 22:00:02 +0100159"$ac_dir/__clean__ $ac_dir/__install__ $ac_dir/__install-dev__ $ac_dir/__install-lib__ $ac_dir/__uninstall__ $ac_dir: $ac_dir/Makefile
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100160$ac_dir/Makefile $ac_dir/__depend__: $ac_dir/Makefile.in config.status $ac_deps
161 @./config.status --file $ac_dir/Makefile && cd $ac_dir && \$(MAKE) depend"
162}
163
164wine_fn_config_lib ()
165{
166 ac_name=$[1]
Alexandre Julliardb8fb1d52010-03-20 14:50:53 +0100167 ac_dir=dlls/$ac_name
168 wine_fn_append_file ALL_DIRS $ac_dir
169 wine_fn_append_file ALL_STATICLIB_DIRS $ac_dir
170 wine_fn_append_file ALL_STATIC_LIBS $ac_dir/lib$ac_name.a
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100171 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
Alexandre Julliardb8fb1d52010-03-20 14:50:53 +0100172"$ac_dir/__install__ $ac_dir/__install-dev__: $ac_dir
173$ac_dir $ac_dir/lib$ac_name.cross.a: tools/widl tools/winebuild tools/winegcc include
174$ac_dir/lib$ac_name.cross.a: $ac_dir/Makefile dummy
175 @cd $ac_dir && \$(MAKE) lib$ac_name.cross.a
176$ac_dir/__clean__ $ac_dir/__install-lib__ $ac_dir/__uninstall__ $ac_dir: $ac_dir/Makefile
177$ac_dir/Makefile $ac_dir/__depend__: $ac_dir/Makefile.in config.status dlls/Makeimplib.rules \$(MAKEDEP)
178 @./config.status --file $ac_dir/Makefile && cd $ac_dir && \$(MAKE) depend"
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100179}
180
Alexandre Julliard50231942010-03-16 22:00:02 +0100181wine_fn_config_dll ()
182{
183 ac_dir=$[1]
184 ac_implib=$[2]
185 ac_implibsrc=$[3]
186 ac_file="dlls/$ac_dir/lib$ac_implib"
187 ac_deps="tools/widl tools/winebuild tools/winegcc include"
188
189 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
190"dlls/$ac_dir dlls/$ac_dir/__install__ dlls/$ac_dir/__install-lib__ dlls/$ac_dir/__install-dev__: __builddeps__"
191
192 if test -n "$ac_implibsrc"
193 then
194 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
195"$ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps
196$ac_file.def: dlls/$ac_dir/$ac_dir.spec dlls/$ac_dir/Makefile
197 @cd dlls/$ac_dir && \$(MAKE) \`basename \$[@]\`
198$ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: dlls/$ac_dir/Makefile dummy
199 @cd dlls/$ac_dir && \$(MAKE) \`basename \$[@]\`"
200 elif test -n "$ac_implib"
201 then
202 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
203"$ac_file.$IMPLIBEXT $ac_file.cross.a: $ac_deps
204$ac_file.$IMPLIBEXT $ac_file.cross.a: dlls/$ac_dir/$ac_dir.spec dlls/$ac_dir/Makefile
205 @cd dlls/$ac_dir && \$(MAKE) \`basename \$[@]\`"
206
207 if test "$ac_dir" != "$ac_implib"
208 then
209 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
210"dlls/lib$ac_implib.$IMPLIBEXT: $ac_file.$IMPLIBEXT
211 \$(RM) \$[@] && \$(LN_S) $ac_dir/lib$ac_implib.$IMPLIBEXT \$[@]
212dlls/lib$ac_implib.cross.a: $ac_file.cross.a
213 \$(RM) \$[@] && \$(LN_S) $ac_dir/lib$ac_implib.cross.a \$[@]
214clean::
215 \$(RM) dlls/lib$ac_implib.$IMPLIBEXT"
216 fi
217 fi
218}
219
220wine_fn_config_program ()
221{
222 ac_dir=$[1]
223 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
224"programs/$ac_dir programs/$ac_dir/__install__ programs/$ac_dir/__install-lib__: __builddeps__"
225}
226
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100227wine_fn_config_test ()
228{
229 ac_dir=$[1]
230 ac_name=$[2]
231 wine_fn_append_file ALL_TEST_BINARIES $ac_name.exe
232 wine_fn_append_rule ALL_WINETEST_DEPENDS \
233"$ac_name.exe: \$(TOPOBJDIR)/$ac_dir/$ac_name.exe$DLLEXT
234 cp \$(TOPOBJDIR)/$ac_dir/$ac_name.exe$DLLEXT \$[@] && \$(STRIP) \$[@]
235$ac_name.rc:
236 echo \"$ac_name.exe TESTRES \\\"$ac_name.exe\\\"\" >\$[@] || (\$(RM) \$[@] && false)
237$ac_name.res: $ac_name.rc $ac_name.exe"
Alexandre Julliarddc3afa12010-03-20 14:51:52 +0100238 wine_fn_append_file ALL_DIRS $ac_dir
239 wine_fn_append_rule ALL_MAKEFILE_DEPENDS \
240"$ac_dir: __builddeps__
241$ac_dir/__crosstest__: __buildcrossdeps__
242$ac_dir/__clean__ $ac_dir/__crosstest__ $ac_dir: $ac_dir/Makefile
243$ac_dir/Makefile $ac_dir/__depend__: $ac_dir/Makefile.in config.status Maketest.rules \$(MAKEDEP)
244 @./config.status --file $ac_dir/Makefile && cd $ac_dir && \$(MAKE) depend"
245 AS_VAR_IF([enable_tests],[no],,[wine_fn_append_file ALL_TEST_DIRS $ac_dir])
Alexandre Julliard2de10c42010-02-11 23:23:45 +0100246}])
247
248dnl **** Define helper function to append a file to a makefile file list ****
249dnl
250dnl Usage: WINE_APPEND_FILE(var,file)
251dnl
252AC_DEFUN([WINE_APPEND_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_file $1 "$2"])
253
254dnl **** Define helper function to append a rule to a makefile command list ****
255dnl
256dnl Usage: WINE_APPEND_RULE(var,rule)
257dnl
258AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_rule $1 "$2"])
259
Francois Gouget4d801b62005-02-10 19:19:35 +0000260dnl **** Create nonexistent directories from config.status ****
Alexandre Julliard67e8dc62002-05-20 18:29:58 +0000261dnl
262dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
263dnl
264AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
Alexandre Julliarda1c253e2010-02-11 20:26:35 +0100265[AC_CONFIG_COMMANDS([$1],[test -d "$1" || { AC_MSG_NOTICE([creating $1]); AS_MKDIR_P("$1"); }])])
Alexandre Julliard446befb2007-07-02 13:41:36 +0200266
Alexandre Julliard7d020c92010-02-03 13:12:12 +0100267dnl **** Create symlinks from config.status ****
268dnl
269dnl Usage: WINE_CONFIG_SYMLINK(name,target)
270dnl
Alexandre Julliard2de10c42010-02-11 23:23:45 +0100271AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
272AC_CONFIG_LINKS([$1:]m4_default([$2],[$1]))dnl
273m4_if([$2],,[test "$srcdir" = "." || ])WINE_APPEND_FILE(ALL_SYMLINKS,[$1])])
Alexandre Julliard7d020c92010-02-03 13:12:12 +0100274
Alexandre Julliarda360e932008-08-20 16:02:37 +0200275dnl **** Create a make rules file from config.status ****
276dnl
277dnl Usage: WINE_CONFIG_MAKERULES(file,var,deps)
278dnl
279AC_DEFUN([WINE_CONFIG_MAKERULES],
Alexandre Julliard2de10c42010-02-11 23:23:45 +0100280[WINE_APPEND_FILE(ALL_MAKERULES,[$1])
281WINE_APPEND_RULE(ALL_MAKEFILE_DEPENDS,[$1: m4_ifval([$3],[$1.in $3],[$1.in]) config.status])
Alexandre Julliarda360e932008-08-20 16:02:37 +0200282$2=$1
283AC_SUBST_FILE([$2])dnl
284AC_CONFIG_FILES([$1])])
285
286dnl **** Create a makefile from config.status ****
287dnl
Alexandre Julliardc6e62dd2010-02-10 19:37:48 +0100288dnl Usage: WINE_CONFIG_MAKEFILE(file,deps,var,enable)
Alexandre Julliarda360e932008-08-20 16:02:37 +0200289dnl
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100290AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
291m4_pushdef([ac_dir],m4_bpatsubst([$1],[^\(\(.*\)/\)?Makefile$],[\2]))dnl
Alexandre Julliardc6e62dd2010-02-10 19:37:48 +0100292m4_pushdef([ac_name],m4_bpatsubst(ac_dir,[.*/\(.*\)$],[\1]))dnl
Alexandre Julliard1784adc2010-02-23 13:44:55 +0100293m4_if(ac_dir,,WINE_APPEND_RULE(ALL_MAKEFILE_DEPENDS,[$1: $1.in $2 config.status])
294AC_CONFIG_FILES([$1]),
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100295[wine_fn_config_makefile ac_dir m4_if(ac_dir,tools,[$2],["$2 \$(MAKEDEP)"])
Alexandre Julliardc6e62dd2010-02-10 19:37:48 +0100296AS_VAR_PUSHDEF([ac_enable],m4_default([$4],[enable_]ac_name))dnl
Alexandre Julliard2de10c42010-02-11 23:23:45 +0100297m4_ifval([$3],[test "x$ac_enable" != xno]m4_foreach([ac_var],[$3],[ && WINE_APPEND_FILE(ac_var,ac_dir)]))
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100298AS_VAR_POPDEF([ac_enable])])dnl
Alexandre Julliardc6e62dd2010-02-10 19:37:48 +0100299m4_popdef([ac_dir])dnl
300m4_popdef([ac_name])])
Alexandre Julliarda360e932008-08-20 16:02:37 +0200301
Alexandre Julliardaa6c4d42010-01-23 14:15:43 +0100302dnl **** Create a dll makefile from config.status ****
303dnl
Alexandre Julliard950a0f82010-01-26 21:10:14 +0100304dnl Usage: WINE_CONFIG_DLL(name,enable,implib,implibsrc)
Alexandre Julliardaa6c4d42010-01-23 14:15:43 +0100305dnl
Alexandre Julliard50231942010-03-16 22:00:02 +0100306AC_DEFUN([WINE_CONFIG_DLL],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
307m4_pushdef([ac_implib],m4_ifval([$3],[dlls/$1/lib$3.$IMPLIBEXT]))dnl
Alexandre Julliard2de10c42010-02-11 23:23:45 +0100308m4_ifval(ac_implib,[m4_ifval([$2],[test "x$[$2]" != xno && ])WINE_APPEND_FILE(ALL_IMPORT_LIBS,ac_implib)dnl
Alexandre Julliard50231942010-03-16 22:00:02 +0100309m4_if([$1],[$3],,[ && WINE_APPEND_FILE(ALL_IMPORT_LIBS,[dlls/lib$3.$IMPLIBEXT])])dnl
310m4_ifval([$4],[ && WINE_APPEND_FILE(ALL_IMPORT_LIBS,[dlls/$1/lib$3.$STATIC_IMPLIBEXT])])
311])wine_fn_config_dll [$1] [$3] m4_ifval([$4],["$4"])
Alexandre Julliard3be8b402010-02-10 19:39:38 +0100312WINE_CONFIG_MAKEFILE([dlls/$1/Makefile],[dlls/Makedll.rules],[ALL_DLL_DIRS],[$2])dnl
Alexandre Julliard50231942010-03-16 22:00:02 +0100313m4_popdef([ac_implib])])
Alexandre Julliardaa6c4d42010-01-23 14:15:43 +0100314
315dnl **** Create a program makefile from config.status ****
316dnl
317dnl Usage: WINE_CONFIG_PROGRAM(name,var,enable)
318dnl
Alexandre Julliard50231942010-03-16 22:00:02 +0100319AC_DEFUN([WINE_CONFIG_PROGRAM],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
320wine_fn_config_program [$1]
Alexandre Julliardc6e62dd2010-02-10 19:37:48 +0100321WINE_CONFIG_MAKEFILE([programs/$1/Makefile],[programs/Makeprog.rules],[$2],[$3])])
Alexandre Julliardaa6c4d42010-01-23 14:15:43 +0100322
323dnl **** Create a test makefile from config.status ****
324dnl
325dnl Usage: WINE_CONFIG_TEST(dir)
326dnl
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100327AC_DEFUN([WINE_CONFIG_TEST],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
328m4_pushdef([ac_suffix],m4_if(m4_substr([$1],0,9),[programs/],[.exe_test],[_test]))dnl
329m4_pushdef([ac_name],[m4_bpatsubst([$1],[.*/\(.*\)/tests$],[\1])])dnl
Alexandre Julliarddc3afa12010-03-20 14:51:52 +0100330wine_fn_config_test $1 ac_name[]ac_suffix[]dnl
Alexandre Julliard4435e992010-02-10 11:24:00 +0100331m4_popdef([ac_suffix])dnl
Alexandre Julliardd5addea2010-02-08 21:27:54 +0100332m4_popdef([ac_name])])
Alexandre Julliardaa6c4d42010-01-23 14:15:43 +0100333
334dnl **** Create a static lib makefile from config.status ****
335dnl
336dnl Usage: WINE_CONFIG_LIB(name)
337dnl
Alexandre Julliardfc7f1c72010-02-23 14:24:57 +0100338AC_DEFUN([WINE_CONFIG_LIB],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
Alexandre Julliardb8fb1d52010-03-20 14:50:53 +0100339wine_fn_config_lib $1])
Alexandre Julliardaa6c4d42010-01-23 14:15:43 +0100340
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200341dnl **** Add a message to the list displayed at the end ****
342dnl
343dnl Usage: WINE_NOTICE(notice)
Alexandre Julliarda41f0f12008-01-07 14:51:44 +0100344dnl Usage: WINE_NOTICE_WITH(with_flag, test, notice)
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200345dnl Usage: WINE_WARNING(warning)
Alexandre Julliarda41f0f12008-01-07 14:51:44 +0100346dnl Usage: WINE_WARNING_WITH(with_flag, test, warning)
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200347dnl Usage: WINE_PRINT_MESSAGES
348dnl
Alexandre Julliard0dc503b2010-02-11 20:25:47 +0100349AC_DEFUN([WINE_NOTICE],[AS_VAR_APPEND([wine_notices],["|$1"])])
350AC_DEFUN([WINE_WARNING],[AS_VAR_APPEND([wine_warnings],["|$1"])])
Alexandre Julliarda41f0f12008-01-07 14:51:44 +0100351
352AC_DEFUN([WINE_NOTICE_WITH],[AS_IF([$2],[case "x$with_$1" in
353 x) WINE_NOTICE([$3]) ;;
354 xno) ;;
355 *) AC_MSG_ERROR([$3
356This is an error since --with-$1 was requested.]) ;;
357esac])])
358
359AC_DEFUN([WINE_WARNING_WITH],[AS_IF([$2],[case "x$with_$1" in
360 x) WINE_WARNING([$3]) ;;
361 xno) ;;
362 *) AC_MSG_ERROR([$3
363This is an error since --with-$1 was requested.]) ;;
364esac])])
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200365
Alexandre Julliard76adea12008-05-21 14:48:33 +0200366AC_DEFUN([WINE_ERROR_WITH],[AS_IF([$2],[case "x$with_$1" in
367 xno) ;;
368 *) AC_MSG_ERROR([$3
369Use the --without-$1 option if you really want this.]) ;;
370esac])])
371
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200372AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS"
Alexandre Julliarda41f0f12008-01-07 14:51:44 +0100373if test "x$wine_notices != "x; then
374 echo >&AS_MESSAGE_FD
Rafał Mużyło4736c992008-10-20 21:43:21 +0200375 IFS="|"
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200376 for msg in $wine_notices; do
Rafał Mużyło4736c992008-10-20 21:43:21 +0200377 IFS="$ac_save_IFS"
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200378 if test -n "$msg"; then
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200379 AC_MSG_NOTICE([$msg])
380 fi
381 done
382fi
Rafał Mużyło4736c992008-10-20 21:43:21 +0200383IFS="|"
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200384for msg in $wine_warnings; do
Rafał Mużyło4736c992008-10-20 21:43:21 +0200385 IFS="$ac_save_IFS"
Alexandre Julliard8d8c5c62007-07-10 15:05:40 +0200386 if test -n "$msg"; then
387 echo >&2
388 AC_MSG_WARN([$msg])
389 fi
390done
391IFS="$ac_save_IFS"])
392
Alexandre Julliard446befb2007-07-02 13:41:36 +0200393dnl Local Variables:
394dnl compile-command: "autoreconf --warnings=all"
395dnl End: