blob: 71d8f8e6fc7d88551f695d3a2924cf403fcc47d0 [file] [log] [blame]
NightStrike748174d2010-02-24 17:55:02 +00001# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.65])
Jonathan Yongb9d79612014-01-25 03:09:24 +00005AC_INIT([mingw-w64],[4.0b],[mingw-w64-public@lists.sourceforge.net])
NightStrike748174d2010-02-24 17:55:02 +00006AC_CONFIG_AUX_DIR([build-aux])
7AC_CONFIG_SRCDIR([AUTHORS])
8AC_CONFIG_HEADERS([config.h])
9
10AM_MAINTAINER_MODE
11AM_INIT_AUTOMAKE([foreign])
12
13AC_CANONICAL_HOST
14
NightStriked6b2d4b2010-03-04 16:48:56 +000015AC_DEFUN([MW64_OPTION_ERROR],[AC_MSG_ERROR([Invalid argument to --$1: $AS_TR_SH([$1])])])
16
NightStrike748174d2010-02-24 17:55:02 +000017# Checks for programs.
18
19# Checks for libraries.
20
21# Checks for header files.
22
23# Checks for typedefs, structures, and compiler characteristics.
24
25# Checks for library functions.
26
27AC_MSG_CHECKING([whether to build the headers])
28AC_ARG_WITH([headers],
29 [AS_HELP_STRING([--without-headers],
30 [Skip building the mingw-w64 headers])],
31 [],
32 [with_headers=yes])
33AS_CASE([$with_headers],
34 [yes],[AC_CONFIG_SUBDIRS([mingw-w64-headers])],
35 [no],[],
NightStriked6b2d4b2010-03-04 16:48:56 +000036 [MW64_OPTION_ERROR([with-headers])])
NightStrike748174d2010-02-24 17:55:02 +000037AM_CONDITIONAL([HEADER],[test "x$with_headers" = xyes])
38AC_MSG_RESULT([$with_headers])
39
40AC_MSG_CHECKING([whether to build the crt])
41AC_ARG_WITH([crt],
42 [AS_HELP_STRING([--without-crt],
43 [Skip building the mingw-w64 crt])],
44 [],
45 [with_crt=yes])
46AS_CASE([$with_crt],
47 [yes],[AC_CONFIG_SUBDIRS([mingw-w64-crt])],
48 [no],[],
NightStriked6b2d4b2010-03-04 16:48:56 +000049 [MW64_OPTION_ERROR([with-crt])])
NightStrike748174d2010-02-24 17:55:02 +000050AM_CONDITIONAL([CRT],[test "x$with_crt" = xyes])
51AC_MSG_RESULT([$with_crt])
52
53AC_MSG_CHECKING([whether to build the optional libraries])
54AC_ARG_WITH([libraries],
55 [AS_HELP_STRING([--with-libraries=ARG],
Alon Bar-Lev771d5012017-11-04 23:02:30 +020056 [Build the extra mingw-w64 libs, where ARG is comma separated list of libmangle, pseh, winpthreads, or all])],
NightStrike748174d2010-02-24 17:55:02 +000057 [],
58 [with_libraries=no])
Alon Bar-Lev771d5012017-11-04 23:02:30 +020059libraries="winpthreads mangle"
60AS_CASE([$host_cpu],
61 [i?86], [
62 libraries="$libraries pseh"
63 ])
64for l in $libraries; do
65 res=`echo "$with_libraries" | grep $l > /dev/null && echo yes || echo no`
66 AS_CASE([$with_libraries],
67 [all|yes],[res=yes])
68 AS_VAR_COPY([with_libraries_$l], [res])
69done
NightStrike748174d2010-02-24 17:55:02 +000070AM_CONDITIONAL([LIBRARIES_MANGLE],[test "x$with_libraries_mangle" = xyes])
71AM_CONDITIONAL([LIBRARIES_PSEH],[test "x$with_libraries_pseh" = xyes])
Alon Bar-Lev95be0652015-05-04 20:39:52 +030072AM_CONDITIONAL([LIBRARIES_WINPTHREADS],[test "x$with_libraries_winpthreads" = xyes])
NightStrike748174d2010-02-24 17:55:02 +000073AM_COND_IF([LIBRARIES_MANGLE],[AC_CONFIG_SUBDIRS([mingw-w64-libraries/libmangle])])
74AM_COND_IF([LIBRARIES_PSEH],[AC_CONFIG_SUBDIRS([mingw-w64-libraries/pseh])])
Alon Bar-Lev95be0652015-05-04 20:39:52 +030075AM_COND_IF([LIBRARIES_WINPTHREADS],[AC_CONFIG_SUBDIRS([mingw-w64-libraries/winpthreads])])
NightStrike748174d2010-02-24 17:55:02 +000076AC_MSG_RESULT([$with_libraries])
77
78AC_MSG_CHECKING([whether to build the optional tools])
79AC_ARG_WITH([tools],
80 [AS_HELP_STRING([--with-tools=ARG],
Alon Bar-Lev771d5012017-11-04 23:02:30 +020081 [Build the extra mingw-w64 tools, where ARG is comma separated list of gendef, genidl, or all])],
NightStrike748174d2010-02-24 17:55:02 +000082 [],
83 [with_tools=no])
Alon Bar-Lev771d5012017-11-04 23:02:30 +020084for t in gendef genidl; do
85 res=`echo "${with_tools}" | grep $t > /dev/null && echo yes || echo no`
86 AS_CASE([$with_tools],
87 [all|yes],[res=yes])
88 AS_VAR_COPY([with_tools_$t], [res])
89done
NightStrike748174d2010-02-24 17:55:02 +000090AM_CONDITIONAL([TOOLS_GENDEF],[test "x$with_tools_gendef" = xyes])
NightStrikeadb344b2010-02-26 14:13:00 +000091AM_CONDITIONAL([TOOLS_GENIDL],[test "x$with_tools_genidl" = xyes])
NightStrike748174d2010-02-24 17:55:02 +000092AM_COND_IF([TOOLS_GENDEF],[AC_CONFIG_SUBDIRS([mingw-w64-tools/gendef])])
NightStrikeadb344b2010-02-26 14:13:00 +000093AM_COND_IF([TOOLS_GENIDL],[AC_CONFIG_SUBDIRS([mingw-w64-tools/genidl])])
NightStrike748174d2010-02-24 17:55:02 +000094AC_MSG_RESULT([$with_tools])
95
96AC_CONFIG_FILES([Makefile])
97AC_OUTPUT
NightStrikeadb344b2010-02-26 14:13:00 +000098