diff options
| author | Eli Zaretskii | 2013-04-18 21:02:48 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-04-18 21:02:48 +0300 |
| commit | 09e94df23efedd7544de1be61d017337829363f5 (patch) | |
| tree | 1802330b6f80f6c7768d2e67d406073de734dfec | |
| parent | da53c452e5a1c7201cfe9fd5cd94b63414a11b9e (diff) | |
| download | emacs-09e94df23efedd7544de1be61d017337829363f5.tar.gz emacs-09e94df23efedd7544de1be61d017337829363f5.zip | |
Refactored tests for windows.h as suggested by Paul Eggert.
| -rw-r--r-- | configure.ac | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 4dfbc224335..dfe35dab9d1 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -1255,10 +1255,7 @@ if test "${with_sound}" != "no"; then | |||
| 1255 | if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then | 1255 | if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then |
| 1256 | case "$opsys" in | 1256 | case "$opsys" in |
| 1257 | dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ | 1257 | dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ |
| 1258 | gnu-linux|freebsd|netbsd) | 1258 | gnu-linux|freebsd|netbsd|mingw32) |
| 1259 | AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) | ||
| 1260 | ;; | ||
| 1261 | mingw32) | ||
| 1262 | AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) | 1259 | AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) |
| 1263 | ;; | 1260 | ;; |
| 1264 | esac | 1261 | esac |
| @@ -1586,26 +1583,31 @@ CLIENTW= | |||
| 1586 | W32_RES_LINK= | 1583 | W32_RES_LINK= |
| 1587 | EMACS_MANIFEST= | 1584 | EMACS_MANIFEST= |
| 1588 | if test "${with_w32}" != no; then | 1585 | if test "${with_w32}" != no; then |
| 1589 | if test "${opsys}" != "cygwin"; then | 1586 | case "${opsys}" in |
| 1590 | if test "${opsys}" != "mingw32"; then | 1587 | cygwin) |
| 1588 | AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], | ||
| 1589 | [AC_MSG_ERROR([`--with-w32' was specified, but windows.h | ||
| 1590 | cannot be found.])]) | ||
| 1591 | ;; | ||
| 1592 | mingw32) | ||
| 1593 | ## Using --with-w32 with MinGW is a no-op, but we allow it. | ||
| 1594 | ;; | ||
| 1595 | *) | ||
| 1591 | AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.]) | 1596 | AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.]) |
| 1592 | fi | 1597 | ;; |
| 1593 | fi | 1598 | esac |
| 1594 | AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], | ||
| 1595 | [AC_MSG_ERROR([`--with-w32' was specified, but windows.h | ||
| 1596 | cannot be found.])]) | ||
| 1597 | fi | 1599 | fi |
| 1600 | |||
| 1598 | if test "${opsys}" = "mingw32"; then | 1601 | if test "${opsys}" = "mingw32"; then |
| 1599 | AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], | ||
| 1600 | [AC_MSG_ERROR([The windows.h header file is required, | ||
| 1601 | but cannot be found.])]) | ||
| 1602 | AC_MSG_CHECKING([whether Windows API headers are recent enough]) | 1602 | AC_MSG_CHECKING([whether Windows API headers are recent enough]) |
| 1603 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | 1603 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 1604 | #include <windows.h> | 1604 | #include <windows.h> |
| 1605 | #include <usp10.h>]], | 1605 | #include <usp10.h>]], |
| 1606 | [[void test(PIMAGE_NT_HEADERS pHeader) | 1606 | [[void test(PIMAGE_NT_HEADERS pHeader) |
| 1607 | {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);}]])], | 1607 | {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);}]])], |
| 1608 | emacs_cv_w32api=yes, emacs_cv_w32api=no) | 1608 | [emacs_cv_w32api=yes |
| 1609 | HAVE_W32=yes], | ||
| 1610 | emacs_cv_w32api=no) | ||
| 1609 | AC_MSG_RESULT($emacs_cv_w32api) | 1611 | AC_MSG_RESULT($emacs_cv_w32api) |
| 1610 | if test "${emacs_cv_w32api}" = "no"; then | 1612 | if test "${emacs_cv_w32api}" = "no"; then |
| 1611 | AC_MSG_ERROR([the Windows API headers are too old to support this build.]) | 1613 | AC_MSG_ERROR([the Windows API headers are too old to support this build.]) |
| @@ -2715,6 +2717,10 @@ no_return_alloc_pixels | |||
| 2715 | fi | 2717 | fi |
| 2716 | fi | 2718 | fi |
| 2717 | 2719 | ||
| 2720 | ### FIXME: Perhaps regroup to minimize code duplication due to MinGW's | ||
| 2721 | ### slightly different requirements wrt image libraries (it doesn't | ||
| 2722 | ### use -lXpm because it loads the xpm shared library dynamically at | ||
| 2723 | ### run time). | ||
| 2718 | if test "${opsys}" = "mingw32"; then | 2724 | if test "${opsys}" = "mingw32"; then |
| 2719 | if test "${with_xpm}" != "no"; then | 2725 | if test "${with_xpm}" != "no"; then |
| 2720 | AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [ | 2726 | AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [ |