From: Eli Zaretskii Date: Thu, 28 Mar 2013 18:13:59 +0000 (+0200) Subject: Merge from trunk and resolve conflicts. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~63^2~74 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/d76bf86f438d4f5f9fe493ab76f02ffc78f3ae2e Merge from trunk and resolve conflicts. --- d76bf86f438d4f5f9fe493ab76f02ffc78f3ae2e diff --cc configure.ac index c941fcb212,0cff34b8a1..e412dd342e --- a/configure.ac +++ b/configure.ac @@@ -1069,22 -1064,11 +1075,14 @@@ case $opsys i SYSTEM_TYPE=berkeley-unix ;; gnu-linux | gnu-kfreebsd ) - LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o' - START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o' ;; hpux10-20 | hpux11 ) - LIB_STANDARD=-lc - START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o' ;; + mingw32 ) + LIB_MATH= + ;; dnl NB this may be adjusted below. netbsd | openbsd ) - LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' - START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' SYSTEM_TYPE=berkeley-unix ;; @@@ -1615,45 -1508,26 +1523,53 @@@ AC_SUBST(NS_OBJC_OBJ HAVE_W32=no W32_OBJ= W32_LIBS= + W32_RES= + W32_RES_LINK= if test "${with_w32}" != no; then if test "${opsys}" != "cygwin"; then - AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.]) + if test "${opsys}" != "mingw32"; then + 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.])]) +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) + 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.]) + fi +fi + +if test "${HAVE_W32}" = "yes"; then AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) + AC_CHECK_TOOL(WINDRES, [windres], + [AC_MSG_ERROR([No resource compiler found.])]) W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" - W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" - W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" - W32_RES="emacs.res" - # Tell the linker that emacs.res is an object (which we compile from - # the rc file), not a linker script. - W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res" + if test "${opsys}" = "cygwin"; then + W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" + W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" ++ W32_RES="emacs.res" ++ # Tell the linker that emacs.res is an object (which we compile from ++ # the rc file), not a linker script. ++ W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res" + else + W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" + W32_LIBS="$W32_LIBS -lwinmm -ladvapi32 -lgdi32 -lcomdlg32 -luser32" + W32_LIBS="$W32_LIBS -lmpr -lshell32 -lwinspool -lole32 -lcomctl32 -lusp10" + fi fi AC_SUBST(W32_OBJ) AC_SUBST(W32_LIBS) @@@ -2014,42 -1900,43 +1942,45 @@@ HAVE_GTK=n GTK_OBJ= check_gtk2=no gtk3_pkg_errors= -if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then - GLIB_REQUIRED=2.28 - GTK_REQUIRED=3.0 - GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" - - dnl Checks for libraries. - PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then - AC_MSG_ERROR($GTK_PKG_ERRORS) - fi - if test "$pkg_check_gtk" = "yes"; then - AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) - GTK_OBJ=emacsgtkfixed.o - term_header=gtkutil.h - USE_GTK_TOOLKIT="GTK3" - if test "x$ac_enable_gtk_deprecation_warnings" = x; then - GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS" - fi - else - check_gtk2=yes - gtk3_pkg_errors="$GTK_PKG_ERRORS " +if test "${opsys}" != "mingw32"; then + if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then + GLIB_REQUIRED=2.28 + GTK_REQUIRED=3.0 + GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" + + dnl Checks for libraries. + PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) + if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then + AC_MSG_ERROR($GTK_PKG_ERRORS) + fi + if test "$pkg_check_gtk" = "yes"; then + AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) + GTK_OBJ=emacsgtkfixed.o + term_header=gtkutil.h + USE_GTK_TOOLKIT="GTK3" ++ if test "x$ac_enable_gtk_deprecation_warnings" = x; then ++ GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS" ++ fi + else + check_gtk2=yes + gtk3_pkg_errors="$GTK_PKG_ERRORS " + fi fi -fi -if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then - GLIB_REQUIRED=2.10 - GTK_REQUIRED=2.10 - GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" - - dnl Checks for libraries. - PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no" && - { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } - then - AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) + if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then + GLIB_REQUIRED=2.10 + GTK_REQUIRED=2.10 + GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" + + dnl Checks for libraries. + PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) + if test "$pkg_check_gtk" = "no" && + { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } + then + AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) + fi + test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2" fi - test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2" fi if test x"$pkg_check_gtk" = xyes; then diff --cc nt/inc/sys/time.h index 2d2c3abe22,80c725385b..aa51041bcd --- a/nt/inc/sys/time.h +++ b/nt/inc/sys/time.h @@@ -6,23 -6,17 +6,28 @@@ * have the below stuff. */ + /* The guards are for MinGW64, which defines these structs on its + system headers which are included by ms-w32.h. */ + #ifndef _W64 +/* Allow inclusion of sys/time.h and winsock2.h in any order. Needed + for running the configure test, which is only relevant to MinGW. */ +#ifndef _TIMEVAL_DEFINED +#define _TIMEVAL_DEFINED struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; -#endif +#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#define timercmp(tvp, uvp, cmp) \ + (((tvp)->tv_sec != (uvp)->tv_sec) ? \ + ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ + ((tvp)->tv_usec cmp (uvp)->tv_usec)) +#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 +#endif /* _TIMEVAL_DEFINED */ ++#endif /* _W64 */ + #ifndef _TIMEZONE_DEFINED struct timezone { int tz_minuteswest; /* minutes west of Greenwich */