From: Eli Zaretskii Date: Thu, 18 Apr 2013 18:02:48 +0000 (+0300) Subject: Refactored tests for windows.h as suggested by Paul Eggert. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~63^2~24 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=09e94df23efedd7544de1be61d017337829363f5;p=emacs.git Refactored tests for windows.h as suggested by Paul Eggert. --- 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 if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then case "$opsys" in dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ - gnu-linux|freebsd|netbsd) - AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) - ;; - mingw32) + gnu-linux|freebsd|netbsd|mingw32) AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) ;; esac @@ -1586,26 +1583,31 @@ CLIENTW= W32_RES_LINK= EMACS_MANIFEST= if test "${with_w32}" != no; then - if test "${opsys}" != "cygwin"; then - if test "${opsys}" != "mingw32"; then + case "${opsys}" in + cygwin) + AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], + [AC_MSG_ERROR([`--with-w32' was specified, but windows.h + cannot be found.])]) + ;; + mingw32) + ## Using --with-w32 with MinGW is a no-op, but we allow it. + ;; + *) AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.]) - fi - fi - AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], - [AC_MSG_ERROR([`--with-w32' was specified, but windows.h - cannot be found.])]) + ;; + esac fi + if test "${opsys}" = "mingw32"; then - AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], - [AC_MSG_ERROR([The windows.h header file is required, - but cannot be found.])]) AC_MSG_CHECKING([whether Windows API headers are recent enough]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[void test(PIMAGE_NT_HEADERS pHeader) {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);}]])], - emacs_cv_w32api=yes, emacs_cv_w32api=no) + [emacs_cv_w32api=yes + HAVE_W32=yes], + emacs_cv_w32api=no) AC_MSG_RESULT($emacs_cv_w32api) if test "${emacs_cv_w32api}" = "no"; then AC_MSG_ERROR([the Windows API headers are too old to support this build.]) @@ -2715,6 +2717,10 @@ no_return_alloc_pixels fi fi +### FIXME: Perhaps regroup to minimize code duplication due to MinGW's +### slightly different requirements wrt image libraries (it doesn't +### use -lXpm because it loads the xpm shared library dynamically at +### run time). if test "${opsys}" = "mingw32"; then if test "${with_xpm}" != "no"; then AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [