Back to home page

Wine source

 
 

    


File indexing completed on 2023-12-08 23:41:40

67e8dc686 Alex*0001 dnl Macros used to build the Wine configure script
                0002 dnl
                0003 dnl Copyright 2002 Alexandre Julliard
                0004 dnl
                0005 dnl This library is free software; you can redistribute it and/or
                0006 dnl modify it under the terms of the GNU Lesser General Public
                0007 dnl License as published by the Free Software Foundation; either
                0008 dnl version 2.1 of the License, or (at your option) any later version.
                0009 dnl
                0010 dnl This library is distributed in the hope that it will be useful,
                0011 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
                0012 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                0013 dnl Lesser General Public License for more details.
                0014 dnl
                0015 dnl You should have received a copy of the GNU Lesser General Public
                0016 dnl License along with this library; if not, write to the Free Software
360a3f914 Jona*0017 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
67e8dc686 Alex*0018 dnl
1d8d0171b Alex*0019 dnl As a special exception to the GNU Lesser General Public License,
                0020 dnl if you distribute this file as part of a program that contains a
                0021 dnl configuration script generated by Autoconf, you may include it
                0022 dnl under the same distribution terms that you use for the rest of
                0023 dnl that program.
67e8dc686 Alex*0024 
b48ee7483 Alex*0025 dnl WINE_CHECK_HOST_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
                0026 dnl
                0027 dnl Like AC_CHECK_TOOL but without the broken fallback to non-prefixed name
                0028 dnl
                0029 AC_DEFUN([WINE_CHECK_HOST_TOOL],
2a741324f Alex*0030 [AS_VAR_SET_IF([ac_tool_prefix],
d7645b67c Serg*0031   [AC_CHECK_PROG([$1],[${ac_tool_prefix}$2],[${ac_tool_prefix}$2],,[$4])])
2a741324f Alex*0032 AS_VAR_IF([ac_cv_prog_$1],[],
                0033   [AS_VAR_IF([cross_compiling],[yes],[],
                0034     [AS_UNSET([ac_cv_prog_$1])
                0035      AC_CHECK_PROG([$1],[$2],[$2],[$3],[$4])])],
                0036 [AS_VAR_COPY([$1],[ac_cv_prog_$1])])])
b48ee7483 Alex*0037 
4100c9210 Alex*0038 dnl WINE_HEADER_MAJOR()
                0039 dnl
                0040 dnl Same as AC_HEADER_MAJOR but fixed to handle the glibc 2.25 sys/types.h breakage
                0041 dnl
                0042 AC_DEFUN([WINE_HEADER_MAJOR],
                0043 [AC_CHECK_HEADER(sys/mkdev.h,
                0044                 [AC_DEFINE(MAJOR_IN_MKDEV, 1,
                0045                            [Define to 1 if `major', `minor', and `makedev' are
                0046                             declared in <mkdev.h>.])])
                0047 if test $ac_cv_header_sys_mkdev_h = no; then
                0048   AC_CHECK_HEADER(sys/sysmacros.h,
                0049                   [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
                0050                              [Define to 1 if `major', `minor', and `makedev'
                0051                               are declared in <sysmacros.h>.])])
                0052 fi])
                0053 
8dabde178 Alex*0054 dnl **** Initialize the programs used by other checks ****
67e8dc686 Alex*0055 dnl
0874734ec Alex*0056 dnl Usage: WINE_PATH_SONAME_TOOLS
8dabde178 Alex*0057 dnl Usage: WINE_PATH_PKG_CONFIG
67e8dc686 Alex*0058 dnl
0874734ec Alex*0059 AC_DEFUN([WINE_PATH_SONAME_TOOLS],
                0060 [AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)
2bb9ece0e Mich*0061 AC_CHECK_TOOL(OTOOL,otool,otool)
8dabde178 Alex*0062 AC_CHECK_TOOL(READELF,[readelf],true)])
                0063 
                0064 AC_DEFUN([WINE_PATH_PKG_CONFIG],
b48ee7483 Alex*0065 [WINE_CHECK_HOST_TOOL(PKG_CONFIG,[pkg-config])])
67e8dc686 Alex*0066 
9ac28955c Zebe*0067 AC_DEFUN([WINE_PATH_MINGW_PKG_CONFIG],
da2ae5832 Alex*0068 [AS_VAR_IF([HOST_ARCH],[i386],
                0069            [ac_prefix_list="m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-w64-mingw32-pkg-config ])"],
                0070            [ac_prefix_list="$host_cpu-w64-mingw32-pkg-config"])
9ac28955c Zebe*0071 AC_CHECK_PROGS(MINGW_PKG_CONFIG,[$ac_prefix_list],false)])
                0072 
67e8dc686 Alex*0073 dnl **** Extract the soname of a library ****
                0074 dnl
66afa98f1 Alex*0075 dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]])
67e8dc686 Alex*0076 dnl
66afa98f1 Alex*0077 AC_DEFUN([WINE_CHECK_SONAME],
0874734ec Alex*0078 [AC_REQUIRE([WINE_PATH_SONAME_TOOLS])dnl
30de3e8ef Alex*0079 AS_VAR_PUSHDEF([ac_Lib],[ac_cv_lib_soname_$1])dnl
66afa98f1 Alex*0080 m4_pushdef([ac_lib_pattern],m4_default([$6],[lib$1]))dnl
                0081 AC_MSG_CHECKING([for -l$1])
446befbb4 Alex*0082 AC_CACHE_VAL(ac_Lib,
66afa98f1 Alex*0083 [ac_check_soname_save_LIBS=$LIBS
                0084 LIBS="-l$1 $5 $LIBS"
67e8dc686 Alex*0085   AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
bdbffd974 Alex*0086   [case "$LIBEXT" in
2b05c8401 Alex*0087     dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;;
2bb9ece0e Mich*0088     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'`]) ;;
0874734ec Alex*0089     *) 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'`])
2a741324f Alex*0090        AS_VAR_IF([ac_Lib],[],
0874734ec Alex*0091              [AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^  ]]*\).*$/\1/"';2,$d'`])]) ;;
92714fcb6 Alex*0092   esac],
                0093   [AS_VAR_SET(ac_Lib,[])])
66afa98f1 Alex*0094   LIBS=$ac_check_soname_save_LIBS])dnl
2a741324f Alex*0095 AS_VAR_IF([ac_Lib],[],
66afa98f1 Alex*0096       [AC_MSG_RESULT([not found])
                0097        $4],
446befbb4 Alex*0098       [AC_MSG_RESULT(AS_VAR_GET(ac_Lib))
                0099        AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),["]AS_VAR_GET(ac_Lib)["],
66afa98f1 Alex*0100                           [Define to the soname of the lib$1 library.])
                0101        $3])dnl
                0102 m4_popdef([ac_lib_pattern])dnl
30de3e8ef Alex*0103 AS_VAR_POPDEF([ac_Lib])])
67e8dc686 Alex*0104 
8dabde178 Alex*0105 dnl **** Get flags from pkg-config or alternate xxx-config program ****
                0106 dnl
75d402315 Alex*0107 dnl Usage: WINE_PACKAGE_FLAGS(var,pkg-name,[default-lib,[cflags-alternate,libs-alternate,[checks]]])
8dabde178 Alex*0108 dnl
                0109 AC_DEFUN([WINE_PACKAGE_FLAGS],
                0110 [AC_REQUIRE([WINE_PATH_PKG_CONFIG])dnl
75d402315 Alex*0111 AS_VAR_PUSHDEF([ac_cflags],[[$1]_CFLAGS])dnl
                0112 AS_VAR_PUSHDEF([ac_libs],[[$1]_LIBS])dnl
ede777d11 Eric*0113 rm -f conftest.err
75d402315 Alex*0114 AC_ARG_VAR(ac_cflags, [C compiler flags for $2, overriding pkg-config])dnl
2a741324f Alex*0115 AS_VAR_IF([ac_cflags],[],
                0116       [AS_VAR_SET_IF([PKG_CONFIG],
ede777d11 Eric*0117       [ac_cflags=`$PKG_CONFIG --cflags [$2] 2>conftest.err`])])
0a06ca291 Alex*0118 m4_ifval([$4],[test "$cross_compiling" = yes || ac_cflags=[$]{ac_cflags:-[$4]}])
75d402315 Alex*0119 AC_ARG_VAR(ac_libs, [Linker flags for $2, overriding pkg-config])dnl
2a741324f Alex*0120 AS_VAR_IF([ac_libs],[],
                0121       [AS_VAR_SET_IF([PKG_CONFIG],
                0122       [ac_libs=`$PKG_CONFIG --libs [$2] 2>/dev/null`])])
0a06ca291 Alex*0123 m4_ifval([$5],[test "$cross_compiling" = yes || ac_libs=[$]{ac_libs:-[$5]}])
75d402315 Alex*0124 m4_ifval([$3],[ac_libs=[$]{ac_libs:-"$3"}])
cebed408c Alex*0125 AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 cflags: $ac_cflags"]) >&AS_MESSAGE_LOG_FD
                0126 AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 libs: $ac_libs"]) >&AS_MESSAGE_LOG_FD
ede777d11 Eric*0127 if test -s conftest.err; then
                0128      AS_ECHO_N(["$as_me:${as_lineno-$LINENO}: $2 errors: "]) >&AS_MESSAGE_LOG_FD
                0129      cat conftest.err >&AS_MESSAGE_LOG_FD
                0130 fi
                0131 rm -f conftest.err
75d402315 Alex*0132 ac_save_CPPFLAGS=$CPPFLAGS
                0133 CPPFLAGS="$CPPFLAGS $ac_cflags"
                0134 $6
                0135 CPPFLAGS=$ac_save_CPPFLAGS
                0136 AS_VAR_POPDEF([ac_libs])dnl
                0137 AS_VAR_POPDEF([ac_cflags])])dnl
8dabde178 Alex*0138 
9ac28955c Zebe*0139 dnl **** Get flags from MinGW pkg-config or alternate xxx-config program ****
                0140 dnl
                0141 dnl Usage: WINE_MINGW_PACKAGE_FLAGS(var,pkg-name,[default-lib,[checks]])
                0142 dnl
                0143 AC_DEFUN([WINE_MINGW_PACKAGE_FLAGS],
                0144 [AC_REQUIRE([WINE_PATH_MINGW_PKG_CONFIG])dnl
                0145 AS_VAR_PUSHDEF([ac_cflags],[[$1]_PE_CFLAGS])dnl
                0146 AS_VAR_PUSHDEF([ac_libs],[[$1]_PE_LIBS])dnl
                0147 AS_VAR_IF([ac_cflags],[],
                0148       [AS_VAR_SET_IF([MINGW_PKG_CONFIG],
                0149       [ac_cflags=`$MINGW_PKG_CONFIG --cflags [$2] 2>/dev/null`])])
                0150 AS_VAR_IF([ac_libs],[],
                0151       [AS_VAR_SET_IF([MINGW_PKG_CONFIG],
                0152       [ac_libs=`$MINGW_PKG_CONFIG --libs [$2] 2>/dev/null`])])
                0153 m4_ifval([$3],[ac_libs=[$]{ac_libs:-"$3"}])
                0154 ac_save_CPPFLAGS=$CPPFLAGS
                0155 CPPFLAGS="$CPPFLAGS $ac_cflags"
                0156 $4
                0157 CPPFLAGS=$ac_save_CPPFLAGS
                0158 AS_VAR_POPDEF([ac_libs])dnl
                0159 AS_VAR_POPDEF([ac_cflags])])dnl
                0160 
a4b01382e Alex*0161 dnl **** Get flags for an external lib program ****
                0162 dnl
                0163 dnl Usage: WINE_EXTLIB_FLAGS(var,pkg-name,default-libs,default-cflags)
                0164 dnl
                0165 AC_DEFUN([WINE_EXTLIB_FLAGS],
                0166 [AS_VAR_PUSHDEF([ac_cflags],[[$1]_PE_CFLAGS])dnl
                0167 AS_VAR_PUSHDEF([ac_libs],[[$1]_PE_LIBS])dnl
                0168 AC_ARG_VAR(ac_cflags, [C compiler flags for the PE $2, overriding the bundled version])dnl
                0169 AC_ARG_VAR(ac_libs, [Linker flags for the PE $2, overriding the bundled version])dnl
f10b176bf Zebe*0170 AS_VAR_IF([ac_libs],[],
                0171   [ac_libs=$3
                0172    AS_VAR_IF([ac_cflags],[],[ac_cflags=$4],[enable_$2=no])],
                0173   [enable_$2=no])
a4b01382e Alex*0174 AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 cflags: $ac_cflags"]) >&AS_MESSAGE_LOG_FD
                0175 AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 libs: $ac_libs"]) >&AS_MESSAGE_LOG_FD
                0176 AS_VAR_POPDEF([ac_libs])dnl
                0177 AS_VAR_POPDEF([ac_cflags])])dnl
                0178 
67e8dc686 Alex*0179 dnl **** Link C code with an assembly file ****
                0180 dnl
                0181 dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]])
                0182 dnl
                0183 AC_DEFUN([WINE_TRY_ASM_LINK],
9797da40e Alex*0184 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[asm($1); $3]])],[$4],[$5])])
67e8dc686 Alex*0185 
                0186 dnl **** Check if we can link an empty program with special CFLAGS ****
                0187 dnl
                0188 dnl Usage: WINE_TRY_CFLAGS(flags,[action-if-yes,[action-if-no]])
                0189 dnl
182d150aa Alex*0190 dnl The default action-if-yes is to append the flags to EXTRACFLAGS.
                0191 dnl
67e8dc686 Alex*0192 AC_DEFUN([WINE_TRY_CFLAGS],
182d150aa Alex*0193 [AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
                0194 AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
67e8dc686 Alex*0195 [ac_wine_try_cflags_saved=$CFLAGS
                0196 CFLAGS="$CFLAGS $1"
9797da40e Alex*0197 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
295806f9c Alex*0198                [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
67e8dc686 Alex*0199 CFLAGS=$ac_wine_try_cflags_saved])
2a741324f Alex*0200 AS_VAR_IF([ac_var],[yes],[m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
182d150aa Alex*0201 AS_VAR_POPDEF([ac_var])])
67e8dc686 Alex*0202 
870f99ece Alex*0203 dnl **** Check if we can link an empty program with special CFLAGS ****
                0204 dnl
b1f59bc67 Alex*0205 dnl Usage: WINE_TRY_PE_CFLAGS(flags,[action-if-yes,[action-if-no]])
870f99ece Alex*0206 dnl
b1f59bc67 Alex*0207 dnl The default action-if-yes is to append the flags to the arch-specific EXTRACFLAGS.
870f99ece Alex*0208 dnl
b1f59bc67 Alex*0209 AC_DEFUN([WINE_TRY_PE_CFLAGS],
                0210 [{ AS_VAR_PUSHDEF([ac_var], ac_cv_${wine_arch}_cflags_[[$1]])dnl
                0211 AC_CACHE_CHECK([whether $CC supports $1], ac_var,
870f99ece Alex*0212 [ac_wine_try_cflags_saved=$CFLAGS
                0213 ac_wine_try_cflags_saved_exeext=$ac_exeext
c096d6cec Jace*0214 CFLAGS="$CFLAGS -nostdlib -nodefaultlibs $1"
870f99ece Alex*0215 ac_exeext=".exe"
5004e6bce Jace*0216 AC_LINK_IFELSE([AC_LANG_SOURCE([[void *__os_arm64x_dispatch_ret = 0;
                0217 int __cdecl mainCRTStartup(void) { return 0; }]])],
870f99ece Alex*0218                [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
                0219 CFLAGS=$ac_wine_try_cflags_saved
                0220 ac_exeext=$ac_wine_try_cflags_saved_exeext])
cf29f40ce Jace*0221 AS_VAR_IF([ac_var],[yes],[m4_default([$2], [AS_VAR_APPEND([${wine_arch}_EXTRACFLAGS],[" $1"])])], [$3])dnl
b1f59bc67 Alex*0222 AS_VAR_POPDEF([ac_var]) }])
870f99ece Alex*0223 
9ac28955c Zebe*0224 dnl **** Check whether the given MinGW header is available ****
                0225 dnl
                0226 dnl Usage: WINE_CHECK_MINGW_HEADER(header,[action-if-found],[action-if-not-found],[other-includes])
                0227 dnl
                0228 AC_DEFUN([WINE_CHECK_MINGW_HEADER],
                0229 [AS_VAR_PUSHDEF([ac_var],[ac_cv_mingw_header_$1])dnl
                0230 AC_CACHE_CHECK([for MinGW $1], ac_var,
                0231 [ac_wine_check_headers_saved_cc=$CC
                0232 ac_wine_check_headers_saved_exeext=$ac_exeext
b1f59bc67 Alex*0233 AS_VAR_COPY([CC],[${wine_arch}_CC])
9ac28955c Zebe*0234 ac_exeext=".exe"
                0235 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$4
                0236 #include <$1>]])],[AS_VAR_SET([ac_var],[yes])],[AS_VAR_SET([ac_var],[no])])
                0237 CC=$ac_wine_check_headers_saved_cc
                0238 ac_exeext=$ac_wine_check_headers_saved_exeext])
                0239 AS_VAR_IF([ac_var],[yes],[$2],[$3])dnl
                0240 AS_VAR_POPDEF([ac_var])])
                0241 
                0242 dnl **** Check whether the given MinGW library is available ****
                0243 dnl
                0244 dnl Usage: WINE_CHECK_MINGW_LIB(library,function,[action-if-found],[action-if-not-found],[other-libraries])
                0245 dnl
                0246 AC_DEFUN([WINE_CHECK_MINGW_LIB],
                0247 [AS_VAR_PUSHDEF([ac_var],[ac_cv_mingw_lib_$1])dnl
                0248 AC_CACHE_CHECK([for $2 in MinGW -l$1], ac_var,
                0249 [ac_wine_check_headers_saved_cc=$CC
                0250 ac_wine_check_headers_saved_exeext=$ac_exeext
                0251 ac_wine_check_headers_saved_libs=$LIBS
b1f59bc67 Alex*0252 AS_VAR_COPY([CC],[${wine_arch}_CC])
9ac28955c Zebe*0253 ac_exeext=".exe"
                0254 LIBS="-l$1 $5 $LIBS"
                0255 AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],[AS_VAR_SET([ac_var],[yes])],[AS_VAR_SET([ac_var],[no])])
                0256 CC=$ac_wine_check_headers_saved_cc
                0257 ac_exeext=$ac_wine_check_headers_saved_exeext
                0258 LIBS=$ac_wine_check_headers_saved_libs])
                0259 AS_VAR_IF([ac_var],[yes],[$3],[$4])dnl
                0260 AS_VAR_POPDEF([ac_var])])
                0261 
05783b55e Alex*0262 dnl **** Check whether we need to define a symbol on the compiler command line ****
                0263 dnl
                0264 dnl Usage: WINE_CHECK_DEFINE(name),[action-if-yes,[action-if-no]])
                0265 dnl
                0266 AC_DEFUN([WINE_CHECK_DEFINE],
                0267 [AS_VAR_PUSHDEF([ac_var],[ac_cv_cpp_def_$1])dnl
                0268 AC_CACHE_CHECK([whether we need to define $1],ac_var,
                0269     AC_EGREP_CPP(yes,[#ifndef $1
                0270 yes
                0271 #endif],
                0272     [AS_VAR_SET(ac_var,yes)],[AS_VAR_SET(ac_var,no)]))
2a741324f Alex*0273 AS_VAR_IF([ac_var],[yes],
05783b55e Alex*0274       [CFLAGS="$CFLAGS -D$1"
                0275   LINTFLAGS="$LINTFLAGS -D$1"])dnl
                0276 AS_VAR_POPDEF([ac_var])])
                0277 
2d1a6274e Alex*0278 dnl **** Check for functions with some extra libraries ****
                0279 dnl
                0280 dnl Usage: WINE_CHECK_LIB_FUNCS(funcs,libs,[action-if-found,[action-if-not-found]])
                0281 dnl
                0282 AC_DEFUN([WINE_CHECK_LIB_FUNCS],
                0283 [ac_wine_check_funcs_save_LIBS="$LIBS"
                0284 LIBS="$LIBS $2"
                0285 AC_CHECK_FUNCS([$1],[$3],[$4])
                0286 LIBS="$ac_wine_check_funcs_save_LIBS"])
                0287 
2de10c4a4 Alex*0288 dnl **** Define helper functions for creating config.status files ****
                0289 dnl
                0290 dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
                0291 dnl
                0292 AC_DEFUN([WINE_CONFIG_HELPERS],
c6b5f4a40 Alex*0293 [AS_VAR_SET([wine_rules],["all:"])
8f57dfedf Alex*0294 AC_SUBST(SUBDIRS,"")
dcc16c7ca Alex*0295 AC_SUBST(DISABLED_SUBDIRS,"")
77c1b7e35 Alex*0296 AC_SUBST(CONFIGURE_TARGETS,"")
7d8311551 Alex*0297 
835588756 Alex*0298 wine_fn_config_makefile ()
                0299 {
b1f59bc67 Alex*0300     AS_VAR_APPEND([SUBDIRS],[" \\$as_nl $[1]"])
                0301     AS_VAR_COPY([enable],[$[2]])
                0302     case "$enable" in
                0303       no) AS_VAR_APPEND([DISABLED_SUBDIRS],[" $[1]"]) ;;
72409c32b Alex*0304       yes) ;;
b1f59bc67 Alex*0305       *aarch64*|*arm*|*i386*|*x86_64*)
                0306         if test -n "$PE_ARCHS"
                0307         then
                0308             for i in $PE_ARCHS
                0309             do
                0310                 test $(expr ",$enable," : ".*,$i,") -gt 0 || AS_VAR_APPEND([${i}_DISABLED_SUBDIRS],[" $[1]"])
                0311             done
                0312         else
                0313             test $(expr ",$enable," : ".*,$HOST_ARCH,") -gt 0 || AS_VAR_APPEND([DISABLED_SUBDIRS],[" $[1]"])
72409c32b Alex*0314         fi ;;
                0315       "")
                0316         case "$[1], $PE_ARCHS " in
                0317           programs/*,*\ arm64ec\ *) AS_VAR_APPEND([arm64ec_DISABLED_SUBDIRS],[" $[1]"]) ;;
                0318         esac ;;
b1f59bc67 Alex*0319     esac
abfb11e1c Alex*0320 }
                0321 
                0322 wine_fn_config_symlink ()
                0323 {
83eb4fd9b Alex*0324     ac_links=$[@]
b1f59bc67 Alex*0325     AS_VAR_APPEND([wine_rules],["
                0326 $ac_links:
                0327         @./config.status \$[@]"])
                0328     for f in $ac_links; do AS_VAR_APPEND([CONFIGURE_TARGETS],[" $f"]); done
e3fc518e8 Alex*0329 }])
2de10c4a4 Alex*0330 
                0331 dnl **** Define helper function to append a rule to a makefile command list ****
                0332 dnl
49645b6ff Alex*0333 dnl Usage: WINE_APPEND_RULE(rule)
2de10c4a4 Alex*0334 dnl
b1f59bc67 Alex*0335 AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])AS_VAR_APPEND([wine_rules],["
                0336 $1"])])
2de10c4a4 Alex*0337 
7d020c9f0 Alex*0338 dnl **** Create symlinks from config.status ****
                0339 dnl
4152f944f Alex*0340 dnl Usage: WINE_CONFIG_SYMLINK(target,src,enable)
7d020c9f0 Alex*0341 dnl
2de10c4a4 Alex*0342 AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
4152f944f Alex*0343 m4_ifval([$3],[if test $3; then
                0344 ])AC_CONFIG_LINKS([$1:$2])dnl
                0345 wine_fn_config_symlink[ $1]m4_ifval([$3],[
83eb4fd9b Alex*0346 fi])[]dnl
                0347 ])])
7d020c9f0 Alex*0348 
a360e9343 Alex*0349 dnl **** Create a makefile from config.status ****
                0350 dnl
3aecaf1da Alex*0351 dnl Usage: WINE_CONFIG_MAKEFILE(file,enable,condition)
a360e9343 Alex*0352 dnl
fc7f1c7e5 Alex*0353 AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
3aecaf1da Alex*0354 AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]m4_bpatsubst([$1],[.*/\([^/]*\)$],[\1])))dnl
d92bcec95 Alex*0355 m4_append_uniq([_AC_USER_OPTS],ac_enable,[
                0356 ])dnl
3aecaf1da Alex*0357 m4_ifval([$3],[$3 || ])wine_fn_config_makefile [$1] ac_enable[]dnl
d394e0420 Alex*0358 AS_VAR_POPDEF([ac_enable])])
aa6c4d4e9 Alex*0359 
e3fc518e8 Alex*0360 dnl **** Append a file to the .gitignore list ****
                0361 dnl
                0362 dnl Usage: WINE_IGNORE_FILE(file,enable)
                0363 dnl
                0364 AC_DEFUN([WINE_IGNORE_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
b1f59bc67 Alex*0365 m4_ifval([$2],[test "x$[$2]" = xno || ])AS_VAR_APPEND([CONFIGURE_TARGETS],[" $1"])])
e3fc518e8 Alex*0366 
8d8c5c60a Alex*0367 dnl **** Add a message to the list displayed at the end ****
                0368 dnl
                0369 dnl Usage: WINE_NOTICE(notice)
                0370 dnl Usage: WINE_WARNING(warning)
850df9d5a Alex*0371 dnl Usage: WINE_NOTICE_WITH(with_flag, test, notice, enable)
                0372 dnl Usage: WINE_WARNING_WITH(with_flag, test, warning, enable)
                0373 dnl Usage: WINE_ERROR_WITH(with_flag, test, error, enable)
8d8c5c60a Alex*0374 dnl Usage: WINE_PRINT_MESSAGES
                0375 dnl
0dc503bcf Alex*0376 AC_DEFUN([WINE_NOTICE],[AS_VAR_APPEND([wine_notices],["|$1"])])
                0377 AC_DEFUN([WINE_WARNING],[AS_VAR_APPEND([wine_warnings],["|$1"])])
a41f0f1b4 Alex*0378 
                0379 AC_DEFUN([WINE_NOTICE_WITH],[AS_IF([$2],[case "x$with_$1" in
                0380   x)   WINE_NOTICE([$3]) ;;
                0381   xno) ;;
                0382   *)   AC_MSG_ERROR([$3
                0383 This is an error since --with-$1 was requested.]) ;;
850df9d5a Alex*0384 esac
                0385 m4_ifval([$4],[$4=${$4:-no}])])])
a41f0f1b4 Alex*0386 
                0387 AC_DEFUN([WINE_WARNING_WITH],[AS_IF([$2],[case "x$with_$1" in
                0388   x)   WINE_WARNING([$3]) ;;
                0389   xno) ;;
                0390   *)   AC_MSG_ERROR([$3
                0391 This is an error since --with-$1 was requested.]) ;;
850df9d5a Alex*0392 esac
                0393 m4_ifval([$4],[$4=${$4:-no}])])])
8d8c5c60a Alex*0394 
76adea11a Alex*0395 AC_DEFUN([WINE_ERROR_WITH],[AS_IF([$2],[case "x$with_$1" in
                0396   xno) ;;
                0397   *)   AC_MSG_ERROR([$3
                0398 Use the --without-$1 option if you really want this.]) ;;
850df9d5a Alex*0399 esac
                0400 m4_ifval([$4],[$4=${$4:-no}])])])
76adea11a Alex*0401 
8d8c5c60a Alex*0402 AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS"
bc52901c7 Fran*0403 if test "x$wine_notices" != x; then
a41f0f1b4 Alex*0404     echo >&AS_MESSAGE_FD
4736c9933 Rafa*0405     IFS="|"
8d8c5c60a Alex*0406     for msg in $wine_notices; do
4736c9933 Rafa*0407         IFS="$ac_save_IFS"
237d7891e Alex*0408         AS_VAR_IF([msg],[],,[AC_MSG_NOTICE([$msg])])
8d8c5c60a Alex*0409     done
                0410 fi
4736c9933 Rafa*0411 IFS="|"
8d8c5c60a Alex*0412 for msg in $wine_warnings; do
4736c9933 Rafa*0413     IFS="$ac_save_IFS"
237d7891e Alex*0414     AS_VAR_IF([msg],[],,[echo >&2
2a741324f Alex*0415         AC_MSG_WARN([$msg])])
8d8c5c60a Alex*0416 done
                0417 IFS="$ac_save_IFS"])
                0418 
446befbb4 Alex*0419 dnl Local Variables:
                0420 dnl compile-command: "autoreconf --warnings=all"
                0421 dnl End: