aclocal.m4 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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.
  24. dnl WINE_CHECK_HOST_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
  25. dnl
  26. dnl Like AC_CHECK_TOOL but without the broken fallback to non-prefixed name
  27. dnl
  28. AC_DEFUN([WINE_CHECK_HOST_TOOL],
  29. [AS_VAR_SET_IF([ac_tool_prefix],
  30. [AC_CHECK_PROG([$1],[${ac_tool_prefix}$2],[${ac_tool_prefix}$2],,[$4])])
  31. AS_VAR_IF([ac_cv_prog_$1],[],
  32. [AS_VAR_IF([cross_compiling],[yes],[],
  33. [AS_UNSET([ac_cv_prog_$1])
  34. AC_CHECK_PROG([$1],[$2],[$2],[$3],[$4])])],
  35. [AS_VAR_COPY([$1],[ac_cv_prog_$1])])])
  36. dnl WINE_HEADER_MAJOR()
  37. dnl
  38. dnl Same as AC_HEADER_MAJOR but fixed to handle the glibc 2.25 sys/types.h breakage
  39. dnl
  40. AC_DEFUN([WINE_HEADER_MAJOR],
  41. [AC_CHECK_HEADER(sys/mkdev.h,
  42. [AC_DEFINE(MAJOR_IN_MKDEV, 1,
  43. [Define to 1 if `major', `minor', and `makedev' are
  44. declared in <mkdev.h>.])])
  45. if test $ac_cv_header_sys_mkdev_h = no; then
  46. AC_CHECK_HEADER(sys/sysmacros.h,
  47. [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
  48. [Define to 1 if `major', `minor', and `makedev'
  49. are declared in <sysmacros.h>.])])
  50. fi])
  51. dnl **** Initialize the programs used by other checks ****
  52. dnl
  53. dnl Usage: WINE_PATH_SONAME_TOOLS
  54. dnl Usage: WINE_PATH_PKG_CONFIG
  55. dnl
  56. AC_DEFUN([WINE_PATH_SONAME_TOOLS],
  57. [AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)
  58. AC_CHECK_TOOL(OTOOL,otool,otool)
  59. AC_CHECK_TOOL(READELF,[readelf],true)])
  60. AC_DEFUN([WINE_PATH_PKG_CONFIG],
  61. [WINE_CHECK_HOST_TOOL(PKG_CONFIG,[pkg-config])])
  62. AC_DEFUN([WINE_PATH_MINGW_PKG_CONFIG],
  63. [case "$host_cpu" in
  64. i[[3456789]]86*)
  65. ac_prefix_list="m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-w64-mingw32-pkg-config ])" ;;
  66. *)
  67. ac_prefix_list="$host_cpu-w64-mingw32-pkg-config" ;;
  68. esac
  69. AC_CHECK_PROGS(MINGW_PKG_CONFIG,[$ac_prefix_list],false)])
  70. dnl **** Extract the soname of a library ****
  71. dnl
  72. dnl Usage: WINE_CHECK_SONAME(library, function, [action-if-found, [action-if-not-found, [other_libraries, [pattern]]]])
  73. dnl
  74. AC_DEFUN([WINE_CHECK_SONAME],
  75. [AC_REQUIRE([WINE_PATH_SONAME_TOOLS])dnl
  76. AS_VAR_PUSHDEF([ac_Lib],[ac_cv_lib_soname_$1])dnl
  77. m4_pushdef([ac_lib_pattern],m4_default([$6],[lib$1]))dnl
  78. AC_MSG_CHECKING([for -l$1])
  79. AC_CACHE_VAL(ac_Lib,
  80. [ac_check_soname_save_LIBS=$LIBS
  81. LIBS="-l$1 $5 $LIBS"
  82. AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
  83. [case "$LIBEXT" in
  84. dll) AS_VAR_SET(ac_Lib,[`$ac_cv_path_LDD conftest.exe | grep "$1" | sed -e "s/dll.*/dll/"';2,$d'`]) ;;
  85. 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'`]) ;;
  86. *) 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'`])
  87. AS_VAR_IF([ac_Lib],[],
  88. [AS_VAR_SET(ac_Lib,[`$LDD conftest$ac_exeext | grep "ac_lib_pattern\\.$LIBEXT" | sed -e "s/^.*\(ac_lib_pattern\.$LIBEXT[[^ ]]*\).*$/\1/"';2,$d'`])]) ;;
  89. esac],
  90. [AS_VAR_SET(ac_Lib,[])])
  91. LIBS=$ac_check_soname_save_LIBS])dnl
  92. AS_VAR_IF([ac_Lib],[],
  93. [AC_MSG_RESULT([not found])
  94. $4],
  95. [AC_MSG_RESULT(AS_VAR_GET(ac_Lib))
  96. AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),["]AS_VAR_GET(ac_Lib)["],
  97. [Define to the soname of the lib$1 library.])
  98. $3])dnl
  99. m4_popdef([ac_lib_pattern])dnl
  100. AS_VAR_POPDEF([ac_Lib])])
  101. dnl **** Get flags from pkg-config or alternate xxx-config program ****
  102. dnl
  103. dnl Usage: WINE_PACKAGE_FLAGS(var,pkg-name,[default-lib,[cflags-alternate,libs-alternate,[checks]]])
  104. dnl
  105. AC_DEFUN([WINE_PACKAGE_FLAGS],
  106. [AC_REQUIRE([WINE_PATH_PKG_CONFIG])dnl
  107. AS_VAR_PUSHDEF([ac_cflags],[[$1]_CFLAGS])dnl
  108. AS_VAR_PUSHDEF([ac_libs],[[$1]_LIBS])dnl
  109. AC_ARG_VAR(ac_cflags, [C compiler flags for $2, overriding pkg-config])dnl
  110. AS_VAR_IF([ac_cflags],[],
  111. [AS_VAR_SET_IF([PKG_CONFIG],
  112. [ac_cflags=`$PKG_CONFIG --cflags [$2] 2>/dev/null`])])
  113. m4_ifval([$4],[test "$cross_compiling" = yes || ac_cflags=[$]{ac_cflags:-[$4]}])
  114. AC_ARG_VAR(ac_libs, [Linker flags for $2, overriding pkg-config])dnl
  115. AS_VAR_IF([ac_libs],[],
  116. [AS_VAR_SET_IF([PKG_CONFIG],
  117. [ac_libs=`$PKG_CONFIG --libs [$2] 2>/dev/null`])])
  118. m4_ifval([$5],[test "$cross_compiling" = yes || ac_libs=[$]{ac_libs:-[$5]}])
  119. m4_ifval([$3],[ac_libs=[$]{ac_libs:-"$3"}])
  120. AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 cflags: $ac_cflags"]) >&AS_MESSAGE_LOG_FD
  121. AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 libs: $ac_libs"]) >&AS_MESSAGE_LOG_FD
  122. ac_save_CPPFLAGS=$CPPFLAGS
  123. CPPFLAGS="$CPPFLAGS $ac_cflags"
  124. $6
  125. CPPFLAGS=$ac_save_CPPFLAGS
  126. AS_VAR_POPDEF([ac_libs])dnl
  127. AS_VAR_POPDEF([ac_cflags])])dnl
  128. dnl **** Get flags from MinGW pkg-config or alternate xxx-config program ****
  129. dnl
  130. dnl Usage: WINE_MINGW_PACKAGE_FLAGS(var,pkg-name,[default-lib,[checks]])
  131. dnl
  132. AC_DEFUN([WINE_MINGW_PACKAGE_FLAGS],
  133. [AC_REQUIRE([WINE_PATH_MINGW_PKG_CONFIG])dnl
  134. AS_VAR_PUSHDEF([ac_cflags],[[$1]_PE_CFLAGS])dnl
  135. AS_VAR_PUSHDEF([ac_libs],[[$1]_PE_LIBS])dnl
  136. AS_VAR_IF([ac_cflags],[],
  137. [AS_VAR_SET_IF([MINGW_PKG_CONFIG],
  138. [ac_cflags=`$MINGW_PKG_CONFIG --cflags [$2] 2>/dev/null`])])
  139. AS_VAR_IF([ac_libs],[],
  140. [AS_VAR_SET_IF([MINGW_PKG_CONFIG],
  141. [ac_libs=`$MINGW_PKG_CONFIG --libs [$2] 2>/dev/null`])])
  142. m4_ifval([$3],[ac_libs=[$]{ac_libs:-"$3"}])
  143. ac_save_CPPFLAGS=$CPPFLAGS
  144. CPPFLAGS="$CPPFLAGS $ac_cflags"
  145. $4
  146. CPPFLAGS=$ac_save_CPPFLAGS
  147. AS_VAR_POPDEF([ac_libs])dnl
  148. AS_VAR_POPDEF([ac_cflags])])dnl
  149. dnl **** Get flags for an external lib program ****
  150. dnl
  151. dnl Usage: WINE_EXTLIB_FLAGS(var,pkg-name,default-libs,default-cflags)
  152. dnl
  153. AC_DEFUN([WINE_EXTLIB_FLAGS],
  154. [AS_VAR_PUSHDEF([ac_cflags],[[$1]_PE_CFLAGS])dnl
  155. AS_VAR_PUSHDEF([ac_libs],[[$1]_PE_LIBS])dnl
  156. AC_ARG_VAR(ac_cflags, [C compiler flags for the PE $2, overriding the bundled version])dnl
  157. AC_ARG_VAR(ac_libs, [Linker flags for the PE $2, overriding the bundled version])dnl
  158. AS_VAR_IF([ac_libs],[],
  159. [ac_libs=$3
  160. AS_VAR_IF([ac_cflags],[],[ac_cflags=$4],[enable_$2=no])],
  161. [enable_$2=no])
  162. AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 cflags: $ac_cflags"]) >&AS_MESSAGE_LOG_FD
  163. AS_ECHO(["$as_me:${as_lineno-$LINENO}: $2 libs: $ac_libs"]) >&AS_MESSAGE_LOG_FD
  164. AS_VAR_POPDEF([ac_libs])dnl
  165. AS_VAR_POPDEF([ac_cflags])])dnl
  166. dnl **** Link C code with an assembly file ****
  167. dnl
  168. dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]])
  169. dnl
  170. AC_DEFUN([WINE_TRY_ASM_LINK],
  171. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[asm($1); $3]])],[$4],[$5])])
  172. dnl **** Check if we can link an empty program with special CFLAGS ****
  173. dnl
  174. dnl Usage: WINE_TRY_CFLAGS(flags,[action-if-yes,[action-if-no]])
  175. dnl
  176. dnl The default action-if-yes is to append the flags to EXTRACFLAGS.
  177. dnl
  178. AC_DEFUN([WINE_TRY_CFLAGS],
  179. [AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
  180. AC_CACHE_CHECK([whether the compiler supports $1], ac_var,
  181. [ac_wine_try_cflags_saved=$CFLAGS
  182. CFLAGS="$CFLAGS $1"
  183. AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv) { return 0; }]])],
  184. [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
  185. CFLAGS=$ac_wine_try_cflags_saved])
  186. AS_VAR_IF([ac_var],[yes],[m4_default([$2], [EXTRACFLAGS="$EXTRACFLAGS $1"])], [$3])dnl
  187. AS_VAR_POPDEF([ac_var])])
  188. dnl **** Check if we can link an empty program with special CFLAGS ****
  189. dnl
  190. dnl Usage: WINE_TRY_CROSSCFLAGS(flags,[action-if-yes,[action-if-no]])
  191. dnl
  192. dnl The default action-if-yes is to append the flags to EXTRACROSSCFLAGS.
  193. dnl
  194. AC_DEFUN([WINE_TRY_CROSSCFLAGS],
  195. [AS_VAR_PUSHDEF([ac_var], ac_cv_crosscflags_[[$1]])dnl
  196. AC_CACHE_CHECK([whether the cross-compiler supports $1], ac_var,
  197. [ac_wine_try_cflags_saved=$CFLAGS
  198. ac_wine_try_cflags_saved_cc=$CC
  199. ac_wine_try_cflags_saved_exeext=$ac_exeext
  200. CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs $1"
  201. CC="$CROSSCC"
  202. ac_exeext=".exe"
  203. AC_LINK_IFELSE([AC_LANG_SOURCE([[int __cdecl mainCRTStartup(void) { return 0; }]])],
  204. [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
  205. CFLAGS=$ac_wine_try_cflags_saved
  206. CC=$ac_wine_try_cflags_saved_cc
  207. ac_exeext=$ac_wine_try_cflags_saved_exeext])
  208. AS_VAR_IF([ac_var],[yes],[m4_default([$2], [EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS $1"])], [$3])dnl
  209. AS_VAR_POPDEF([ac_var])])
  210. dnl **** Check whether the given MinGW header is available ****
  211. dnl
  212. dnl Usage: WINE_CHECK_MINGW_HEADER(header,[action-if-found],[action-if-not-found],[other-includes])
  213. dnl
  214. AC_DEFUN([WINE_CHECK_MINGW_HEADER],
  215. [AS_VAR_PUSHDEF([ac_var],[ac_cv_mingw_header_$1])dnl
  216. AC_CACHE_CHECK([for MinGW $1], ac_var,
  217. [ac_wine_check_headers_saved_cc=$CC
  218. ac_wine_check_headers_saved_exeext=$ac_exeext
  219. CC="$CROSSCC"
  220. ac_exeext=".exe"
  221. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$4
  222. #include <$1>]])],[AS_VAR_SET([ac_var],[yes])],[AS_VAR_SET([ac_var],[no])])
  223. CC=$ac_wine_check_headers_saved_cc
  224. ac_exeext=$ac_wine_check_headers_saved_exeext])
  225. AS_VAR_IF([ac_var],[yes],[$2],[$3])dnl
  226. AS_VAR_POPDEF([ac_var])])
  227. dnl **** Check whether the given MinGW library is available ****
  228. dnl
  229. dnl Usage: WINE_CHECK_MINGW_LIB(library,function,[action-if-found],[action-if-not-found],[other-libraries])
  230. dnl
  231. AC_DEFUN([WINE_CHECK_MINGW_LIB],
  232. [AS_VAR_PUSHDEF([ac_var],[ac_cv_mingw_lib_$1])dnl
  233. AC_CACHE_CHECK([for $2 in MinGW -l$1], ac_var,
  234. [ac_wine_check_headers_saved_cc=$CC
  235. ac_wine_check_headers_saved_exeext=$ac_exeext
  236. ac_wine_check_headers_saved_libs=$LIBS
  237. CC="$CROSSCC"
  238. ac_exeext=".exe"
  239. LIBS="-l$1 $5 $LIBS"
  240. AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],[AS_VAR_SET([ac_var],[yes])],[AS_VAR_SET([ac_var],[no])])
  241. CC=$ac_wine_check_headers_saved_cc
  242. ac_exeext=$ac_wine_check_headers_saved_exeext
  243. LIBS=$ac_wine_check_headers_saved_libs])
  244. AS_VAR_IF([ac_var],[yes],[$3],[$4])dnl
  245. AS_VAR_POPDEF([ac_var])])
  246. dnl **** Check if we can link an empty shared lib (no main) with special CFLAGS ****
  247. dnl
  248. dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]])
  249. dnl
  250. AC_DEFUN([WINE_TRY_SHLIB_FLAGS],
  251. [AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl
  252. ac_wine_try_cflags_saved=$CFLAGS
  253. CFLAGS="$CFLAGS $1"
  254. AC_LINK_IFELSE([AC_LANG_SOURCE([[void myfunc() {}]])],
  255. [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
  256. CFLAGS=$ac_wine_try_cflags_saved
  257. AS_VAR_IF([ac_var],[yes], [$2], [$3])dnl
  258. AS_VAR_POPDEF([ac_var])])
  259. dnl **** Check whether we need to define a symbol on the compiler command line ****
  260. dnl
  261. dnl Usage: WINE_CHECK_DEFINE(name),[action-if-yes,[action-if-no]])
  262. dnl
  263. AC_DEFUN([WINE_CHECK_DEFINE],
  264. [AS_VAR_PUSHDEF([ac_var],[ac_cv_cpp_def_$1])dnl
  265. AC_CACHE_CHECK([whether we need to define $1],ac_var,
  266. AC_EGREP_CPP(yes,[#ifndef $1
  267. yes
  268. #endif],
  269. [AS_VAR_SET(ac_var,yes)],[AS_VAR_SET(ac_var,no)]))
  270. AS_VAR_IF([ac_var],[yes],
  271. [CFLAGS="$CFLAGS -D$1"
  272. LINTFLAGS="$LINTFLAGS -D$1"])dnl
  273. AS_VAR_POPDEF([ac_var])])
  274. dnl **** Check for functions with some extra libraries ****
  275. dnl
  276. dnl Usage: WINE_CHECK_LIB_FUNCS(funcs,libs,[action-if-found,[action-if-not-found]])
  277. dnl
  278. AC_DEFUN([WINE_CHECK_LIB_FUNCS],
  279. [ac_wine_check_funcs_save_LIBS="$LIBS"
  280. LIBS="$LIBS $2"
  281. AC_CHECK_FUNCS([$1],[$3],[$4])
  282. LIBS="$ac_wine_check_funcs_save_LIBS"])
  283. dnl **** Check for a mingw program, trying the various mingw prefixes ****
  284. dnl
  285. dnl Usage: WINE_CHECK_MINGW_PROG(variable,[value-if-not-found],[path])
  286. dnl
  287. AC_DEFUN([WINE_CHECK_MINGW_PROG],
  288. [case "$host_cpu" in
  289. aarch64*)
  290. ac_prefix_list="aarch64-w64-mingw32-clang aarch64-w64-mingw32-gcc clang" ;;
  291. arm*)
  292. ac_prefix_list="armv7-w64-mingw32-clang armv7-w64-mingw32-gcc clang" ;;
  293. i[[3456789]]86*)
  294. ac_prefix_list="m4_foreach([ac_wine_prefix],[w64-mingw32, pc-mingw32, mingw32msvc, mingw32],
  295. m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-ac_wine_prefix-gcc ]))
  296. m4_foreach([ac_wine_cpu],[i686,i586,i486,i386],[ac_wine_cpu-w64-mingw32-clang ])
  297. mingw32-gcc clang" ;;
  298. x86_64)
  299. ac_prefix_list="m4_foreach([ac_wine_prefix],[pc-mingw32, w64-mingw32, mingw32msvc],
  300. m4_foreach([ac_wine_cpu],[x86_64,amd64],[ac_wine_cpu-ac_wine_prefix-gcc ]))
  301. m4_foreach([ac_wine_cpu],[x86_64,amd64],[ac_wine_cpu-w64-mingw32-clang ]) clang" ;;
  302. *)
  303. ac_prefix_list="" ;;
  304. esac
  305. AC_CHECK_PROGS([$1],[$ac_prefix_list],[$2],[$3])])
  306. dnl **** Define helper functions for creating config.status files ****
  307. dnl
  308. dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
  309. dnl
  310. AC_DEFUN([WINE_CONFIG_HELPERS],
  311. [AS_VAR_SET([wine_rules],["all:"])
  312. AC_SUBST(SUBDIRS,"")
  313. AC_SUBST(DISABLED_SUBDIRS,"")
  314. AC_SUBST(CONFIGURE_TARGETS,"")
  315. wine_fn_append_file ()
  316. {
  317. AS_VAR_APPEND($[1]," \\$as_nl $[2]")
  318. }
  319. wine_fn_append_rule ()
  320. {
  321. AS_VAR_APPEND(wine_rules,"$as_nl$[1]")
  322. }
  323. wine_fn_config_makefile ()
  324. {
  325. wine_fn_append_file SUBDIRS $[1]
  326. AS_VAR_IF([$[2]],[no],[wine_fn_append_file DISABLED_SUBDIRS $[1]])
  327. }
  328. wine_fn_config_symlink ()
  329. {
  330. ac_links=$[@]
  331. wine_fn_append_rule \
  332. "$ac_links:
  333. @./config.status \$[@]"
  334. for f in $ac_links; do wine_fn_append_file CONFIGURE_TARGETS $f; done
  335. }])
  336. dnl **** Define helper function to append a rule to a makefile command list ****
  337. dnl
  338. dnl Usage: WINE_APPEND_RULE(rule)
  339. dnl
  340. AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])wine_fn_append_rule "$1"])
  341. dnl **** Create symlinks from config.status ****
  342. dnl
  343. dnl Usage: WINE_CONFIG_SYMLINK(target,src,enable)
  344. dnl
  345. AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
  346. m4_ifval([$3],[if test $3; then
  347. ])AC_CONFIG_LINKS([$1:$2])dnl
  348. wine_fn_config_symlink[ $1]m4_ifval([$3],[
  349. fi])[]dnl
  350. ])])
  351. dnl **** Create a makefile from config.status ****
  352. dnl
  353. dnl Usage: WINE_CONFIG_MAKEFILE(file,enable,condition)
  354. dnl
  355. AC_DEFUN([WINE_CONFIG_MAKEFILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
  356. AS_VAR_PUSHDEF([ac_enable],m4_default([$2],[enable_]m4_bpatsubst([$1],[.*/\([^/]*\)$],[\1])))dnl
  357. m4_append_uniq([_AC_USER_OPTS],ac_enable,[
  358. ])dnl
  359. m4_ifval([$3],[$3 || ])wine_fn_config_makefile [$1] ac_enable[]dnl
  360. AS_VAR_POPDEF([ac_enable])])
  361. dnl **** Append a file to the .gitignore list ****
  362. dnl
  363. dnl Usage: WINE_IGNORE_FILE(file,enable)
  364. dnl
  365. AC_DEFUN([WINE_IGNORE_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
  366. m4_ifval([$2],[test "x$[$2]" = xno || ])wine_fn_append_file CONFIGURE_TARGETS $1])
  367. dnl **** Add a message to the list displayed at the end ****
  368. dnl
  369. dnl Usage: WINE_NOTICE(notice)
  370. dnl Usage: WINE_WARNING(warning)
  371. dnl Usage: WINE_NOTICE_WITH(with_flag, test, notice, enable)
  372. dnl Usage: WINE_WARNING_WITH(with_flag, test, warning, enable)
  373. dnl Usage: WINE_ERROR_WITH(with_flag, test, error, enable)
  374. dnl Usage: WINE_PRINT_MESSAGES
  375. dnl
  376. AC_DEFUN([WINE_NOTICE],[AS_VAR_APPEND([wine_notices],["|$1"])])
  377. AC_DEFUN([WINE_WARNING],[AS_VAR_APPEND([wine_warnings],["|$1"])])
  378. AC_DEFUN([WINE_NOTICE_WITH],[AS_IF([$2],[case "x$with_$1" in
  379. x) WINE_NOTICE([$3]) ;;
  380. xno) ;;
  381. *) AC_MSG_ERROR([$3
  382. This is an error since --with-$1 was requested.]) ;;
  383. esac
  384. m4_ifval([$4],[$4=${$4:-no}])])])
  385. AC_DEFUN([WINE_WARNING_WITH],[AS_IF([$2],[case "x$with_$1" in
  386. x) WINE_WARNING([$3]) ;;
  387. xno) ;;
  388. *) AC_MSG_ERROR([$3
  389. This is an error since --with-$1 was requested.]) ;;
  390. esac
  391. m4_ifval([$4],[$4=${$4:-no}])])])
  392. AC_DEFUN([WINE_ERROR_WITH],[AS_IF([$2],[case "x$with_$1" in
  393. xno) ;;
  394. *) AC_MSG_ERROR([$3
  395. Use the --without-$1 option if you really want this.]) ;;
  396. esac
  397. m4_ifval([$4],[$4=${$4:-no}])])])
  398. AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS"
  399. if test "x$wine_notices" != x; then
  400. echo >&AS_MESSAGE_FD
  401. IFS="|"
  402. for msg in $wine_notices; do
  403. IFS="$ac_save_IFS"
  404. AS_VAR_IF([msg],[],,[AC_MSG_NOTICE([$msg])])
  405. done
  406. fi
  407. IFS="|"
  408. for msg in $wine_warnings; do
  409. IFS="$ac_save_IFS"
  410. AS_VAR_IF([msg],[],,[echo >&2
  411. AC_MSG_WARN([$msg])])
  412. done
  413. IFS="$ac_save_IFS"])
  414. dnl Local Variables:
  415. dnl compile-command: "autoreconf --warnings=all"
  416. dnl End: