NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 1 | # -*- Autoconf -*- |
| 2 | # Process this file with autoconf to produce a configure script. |
| 3 | |
| 4 | AC_PREREQ([2.65]) |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 5 | AC_INIT([mingw-w64],[1.0b],[mingw-w64-public@lists.sourceforge.net]) |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 6 | AC_CONFIG_AUX_DIR([build-aux]) |
| 7 | AC_CONFIG_SRCDIR([AUTHORS]) |
| 8 | AC_CONFIG_HEADERS([config.h]) |
| 9 | |
| 10 | AM_MAINTAINER_MODE |
| 11 | AM_INIT_AUTOMAKE([foreign]) |
| 12 | |
| 13 | AC_CANONICAL_HOST |
| 14 | |
NightStrike | d6b2d4b | 2010-03-04 16:48:56 +0000 | [diff] [blame] | 15 | AC_DEFUN([MW64_OPTION_ERROR],[AC_MSG_ERROR([Invalid argument to --$1: $AS_TR_SH([$1])])]) |
| 16 | |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 17 | # 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 | |
| 27 | AC_MSG_CHECKING([whether to build the headers]) |
| 28 | AC_ARG_WITH([headers], |
| 29 | [AS_HELP_STRING([--without-headers], |
| 30 | [Skip building the mingw-w64 headers])], |
| 31 | [], |
| 32 | [with_headers=yes]) |
| 33 | AS_CASE([$with_headers], |
| 34 | [yes],[AC_CONFIG_SUBDIRS([mingw-w64-headers])], |
| 35 | [no],[], |
NightStrike | d6b2d4b | 2010-03-04 16:48:56 +0000 | [diff] [blame] | 36 | [MW64_OPTION_ERROR([with-headers])]) |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 37 | AM_CONDITIONAL([HEADER],[test "x$with_headers" = xyes]) |
| 38 | AC_MSG_RESULT([$with_headers]) |
| 39 | |
| 40 | AC_MSG_CHECKING([whether to build the crt]) |
| 41 | AC_ARG_WITH([crt], |
| 42 | [AS_HELP_STRING([--without-crt], |
| 43 | [Skip building the mingw-w64 crt])], |
| 44 | [], |
| 45 | [with_crt=yes]) |
| 46 | AS_CASE([$with_crt], |
| 47 | [yes],[AC_CONFIG_SUBDIRS([mingw-w64-crt])], |
| 48 | [no],[], |
NightStrike | d6b2d4b | 2010-03-04 16:48:56 +0000 | [diff] [blame] | 49 | [MW64_OPTION_ERROR([with-crt])]) |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 50 | AM_CONDITIONAL([CRT],[test "x$with_crt" = xyes]) |
| 51 | AC_MSG_RESULT([$with_crt]) |
| 52 | |
| 53 | AC_MSG_CHECKING([whether to build the optional libraries]) |
| 54 | AC_ARG_WITH([libraries], |
| 55 | [AS_HELP_STRING([--with-libraries=ARG], |
| 56 | [Build the extra mingw-w64 libs, where ARG is one of libmangle, pseh, or all])], |
| 57 | [], |
| 58 | [with_libraries=no]) |
| 59 | AS_CASE([$with_libraries], |
| 60 | [yes|all],[ |
| 61 | with_libraries="libmangle,pseh" |
| 62 | with_libraries_mangle=yes |
| 63 | with_libraries_pseh=yes], |
| 64 | [libmangle],[ |
| 65 | with_libraries="libmangle" |
| 66 | with_libraries_mangle=yes |
| 67 | with_libraries_pseh=no], |
| 68 | [pseh],[ |
| 69 | with_libraries="pseh" |
| 70 | with_libraries_mangle=no |
| 71 | with_libraries_pseh=yes], |
| 72 | [no],[ |
| 73 | with_libraries_mangle=no |
| 74 | with_libraries_pseh=no], |
NightStrike | d6b2d4b | 2010-03-04 16:48:56 +0000 | [diff] [blame] | 75 | [MW64_OPTION_ERROR([with-libraries])]) |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 76 | AM_CONDITIONAL([LIBRARIES_MANGLE],[test "x$with_libraries_mangle" = xyes]) |
| 77 | AM_CONDITIONAL([LIBRARIES_PSEH],[test "x$with_libraries_pseh" = xyes]) |
| 78 | AM_COND_IF([LIBRARIES_MANGLE],[AC_CONFIG_SUBDIRS([mingw-w64-libraries/libmangle])]) |
| 79 | AM_COND_IF([LIBRARIES_PSEH],[AC_CONFIG_SUBDIRS([mingw-w64-libraries/pseh])]) |
| 80 | AC_MSG_RESULT([$with_libraries]) |
| 81 | |
| 82 | AC_MSG_CHECKING([whether to build the optional tools]) |
| 83 | AC_ARG_WITH([tools], |
| 84 | [AS_HELP_STRING([--with-tools=ARG], |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 85 | [Build the extra mingw-w64 tools, where ARG is one of gendef, genidl, or all])], |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 86 | [], |
| 87 | [with_tools=no]) |
| 88 | AS_CASE([$with_tools], |
| 89 | [yes|all],[ |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 90 | with_tools="gendef,genidl" |
| 91 | with_tools_gendef=yes |
| 92 | with_tools_genidl=yes], |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 93 | [gendef],[ |
| 94 | with_tools="gendef" |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 95 | with_tools_gendef=yes |
| 96 | with_tools_genidl=no], |
| 97 | [genidl],[ |
| 98 | with_tools="genidl" |
| 99 | with_tools_gendef=no |
| 100 | with_tools_genidl=yes], |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 101 | [no],[ |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 102 | with_tools_gendef=no |
| 103 | with_tools_genidl=no], |
NightStrike | d6b2d4b | 2010-03-04 16:48:56 +0000 | [diff] [blame] | 104 | [MW64_OPTION_ERROR([with-tools])]) |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 105 | AM_CONDITIONAL([TOOLS_GENDEF],[test "x$with_tools_gendef" = xyes]) |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 106 | AM_CONDITIONAL([TOOLS_GENIDL],[test "x$with_tools_genidl" = xyes]) |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 107 | AM_COND_IF([TOOLS_GENDEF],[AC_CONFIG_SUBDIRS([mingw-w64-tools/gendef])]) |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 108 | AM_COND_IF([TOOLS_GENIDL],[AC_CONFIG_SUBDIRS([mingw-w64-tools/genidl])]) |
NightStrike | 748174d | 2010-02-24 17:55:02 +0000 | [diff] [blame] | 109 | AC_MSG_RESULT([$with_tools]) |
| 110 | |
| 111 | AC_CONFIG_FILES([Makefile]) |
| 112 | AC_OUTPUT |
NightStrike | adb344b | 2010-02-26 14:13:00 +0000 | [diff] [blame] | 113 | |