diff options
| author | Eli Zaretskii | 2012-11-24 18:02:07 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-11-24 18:02:07 +0200 |
| commit | 9e821c83d328207d418ade2a5fb36168dd0fa9c6 (patch) | |
| tree | 113be2961dc1c1082216b8ca578ad02aee2a21aa | |
| parent | bc9ce0d9c9e5c49737685523c2ac172f90c9e5f7 (diff) | |
| download | emacs-9e821c83d328207d418ade2a5fb36168dd0fa9c6.tar.gz emacs-9e821c83d328207d418ade2a5fb36168dd0fa9c6.zip | |
Fixed configure.ac and headers in nt/inc. Emulated functions not handled yet.
| -rw-r--r-- | configure.ac | 31 | ||||
| -rw-r--r-- | nt/inc/sys/socket.h | 12 | ||||
| -rw-r--r-- | nt/inc/sys/time.h | 11 | ||||
| -rw-r--r-- | nt/inc/unistd.h | 3 |
4 files changed, 44 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 5a893293093..cb11cde98be 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -526,7 +526,8 @@ case "${canonical}" in | |||
| 526 | *-darwin* ) opsys=darwin ;; | 526 | *-darwin* ) opsys=darwin ;; |
| 527 | *-mingw32 ) | 527 | *-mingw32 ) |
| 528 | opsys=mingw32 | 528 | opsys=mingw32 |
| 529 | CFLAGS="-mtune=pentium4 $CFLAGS" | 529 | # MinGW overrides and adds some system headers in nt/inc. |
| 530 | GCC_TEST_OPTIONS="-I nt/inc" | ||
| 530 | ;; | 531 | ;; |
| 531 | *-sysv4.2uw* ) opsys=unixware ;; | 532 | *-sysv4.2uw* ) opsys=unixware ;; |
| 532 | *-sysv5uw* ) opsys=unixware ;; | 533 | *-sysv5uw* ) opsys=unixware ;; |
| @@ -988,7 +989,7 @@ C_SWITCH_SYSTEM= | |||
| 988 | ## additional optimization. --nils@exp-math.uni-essen.de | 989 | ## additional optimization. --nils@exp-math.uni-essen.de |
| 989 | test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \ | 990 | test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \ |
| 990 | C_SWITCH_SYSTEM="-ma -qmaxmem=4000" | 991 | C_SWITCH_SYSTEM="-ma -qmaxmem=4000" |
| 991 | test "$opsys" = "mingw32" && C_SWITCH_SYSTEM="-DUSE_CRT_DLL=1 -I../nt/inc" | 992 | test "$opsys" = "mingw32" && C_SWITCH_SYSTEM="-mtune=pentium4" |
| 992 | ## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. | 993 | ## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. |
| 993 | ## It is redundant in glibc2, since we define _GNU_SOURCE. | 994 | ## It is redundant in glibc2, since we define _GNU_SOURCE. |
| 994 | AC_SUBST(C_SWITCH_SYSTEM) | 995 | AC_SUBST(C_SWITCH_SYSTEM) |
| @@ -2905,7 +2906,7 @@ AC_SUBST(LIBXML2_LIBS) | |||
| 2905 | AC_SUBST(LIBXML2_CFLAGS) | 2906 | AC_SUBST(LIBXML2_CFLAGS) |
| 2906 | 2907 | ||
| 2907 | # If netdb.h doesn't declare h_errno, we must declare it by hand. | 2908 | # If netdb.h doesn't declare h_errno, we must declare it by hand. |
| 2908 | # On MinGW, that is provided by nt/inc/sys/socket.h. | 2909 | # On MinGW, that is provided by nt/inc/sys/socket.h and w32.c. |
| 2909 | if test "${opsys}" = "mingw32"; then | 2910 | if test "${opsys}" = "mingw32"; then |
| 2910 | emacs_cv_netdb_declares_h_errno=yes | 2911 | emacs_cv_netdb_declares_h_errno=yes |
| 2911 | fi | 2912 | fi |
| @@ -3926,10 +3927,14 @@ else | |||
| 3926 | esac | 3927 | esac |
| 3927 | fi dnl GCC? | 3928 | fi dnl GCC? |
| 3928 | 3929 | ||
| 3930 | dnl In a weird quirk, MS runtime uses _setjmp and longjmp. | ||
| 3929 | AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp], | 3931 | AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp], |
| 3930 | [AC_LINK_IFELSE( | 3932 | [AC_LINK_IFELSE( |
| 3931 | [AC_LANG_PROGRAM( | 3933 | [AC_LANG_PROGRAM( |
| 3932 | [[#include <setjmp.h> | 3934 | [[#include <setjmp.h> |
| 3935 | #ifdef __MINGW32__ | ||
| 3936 | # define _longjmp longjmp | ||
| 3937 | #endif | ||
| 3933 | ]], | 3938 | ]], |
| 3934 | [[jmp_buf j; | 3939 | [[jmp_buf j; |
| 3935 | if (! _setjmp (j)) | 3940 | if (! _setjmp (j)) |
| @@ -4275,12 +4280,14 @@ case "$USE_X_TOOLKIT" in | |||
| 4275 | esac | 4280 | esac |
| 4276 | AC_SUBST(TOOLKIT_LIBW) | 4281 | AC_SUBST(TOOLKIT_LIBW) |
| 4277 | 4282 | ||
| 4278 | if test "$USE_X_TOOLKIT" = "none"; then | 4283 | if test "${opsys}" != "mingw32"; then |
| 4279 | LIBXT_OTHER="\$(LIBXSM)" | 4284 | if test "$USE_X_TOOLKIT" = "none"; then |
| 4280 | OLDXMENU_TARGET="really-oldXMenu" | 4285 | LIBXT_OTHER="\$(LIBXSM)" |
| 4281 | else | 4286 | OLDXMENU_TARGET="really-oldXMenu" |
| 4282 | LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext" | 4287 | else |
| 4283 | OLDXMENU_TARGET="really-lwlib" | 4288 | LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext" |
| 4289 | OLDXMENU_TARGET="really-lwlib" | ||
| 4290 | fi | ||
| 4284 | fi | 4291 | fi |
| 4285 | AC_SUBST(LIBXT_OTHER) | 4292 | AC_SUBST(LIBXT_OTHER) |
| 4286 | 4293 | ||
| @@ -4385,6 +4392,12 @@ gl_INIT | |||
| 4385 | CFLAGS=$SAVE_CFLAGS | 4392 | CFLAGS=$SAVE_CFLAGS |
| 4386 | LIBS=$SAVE_LIBS | 4393 | LIBS=$SAVE_LIBS |
| 4387 | 4394 | ||
| 4395 | if test "${opsys}" = "mingw32"; then | ||
| 4396 | CPPFLAGS="-DUSE_CRT_DLL=1 -I../nt/inc" | ||
| 4397 | # Remove unneeded switches from the value of CC that goes to Makefiles | ||
| 4398 | CC=`echo $CC | sed -e "s,$GCC_TEST_OPTIONS,,"` | ||
| 4399 | fi | ||
| 4400 | |||
| 4388 | case "$opsys" in | 4401 | case "$opsys" in |
| 4389 | aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; | 4402 | aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; |
| 4390 | 4403 | ||
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h index 95fee4c4659..1c8be6c452f 100644 --- a/nt/inc/sys/socket.h +++ b/nt/inc/sys/socket.h | |||
| @@ -43,8 +43,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 43 | #undef FD_ZERO | 43 | #undef FD_ZERO |
| 44 | #endif | 44 | #endif |
| 45 | 45 | ||
| 46 | /* avoid duplicate definition of timeval */ | 46 | /* Avoid duplicate definition of timeval. MinGW uses _TIMEVAL_DEFINED |
| 47 | #ifdef HAVE_TIMEVAL | 47 | in sys/time.h to avoid that. */ |
| 48 | #if defined (HAVE_TIMEVAL) && defined (_MSC_VER) | ||
| 48 | #define timeval ws_timeval | 49 | #define timeval ws_timeval |
| 49 | #endif | 50 | #endif |
| 50 | 51 | ||
| @@ -62,7 +63,9 @@ typedef unsigned short uint16_t; | |||
| 62 | #undef MUST_REDEF_SELECT | 63 | #undef MUST_REDEF_SELECT |
| 63 | #endif | 64 | #endif |
| 64 | 65 | ||
| 65 | /* revert to our version of FD_SET */ | 66 | /* Revert to our version of FD_SET, but not when included from test |
| 67 | programs run by configure. */ | ||
| 68 | #ifdef EMACS_CONFIG_H | ||
| 66 | #undef FD_SET | 69 | #undef FD_SET |
| 67 | #undef FD_CLR | 70 | #undef FD_CLR |
| 68 | #undef FD_ISSET | 71 | #undef FD_ISSET |
| @@ -71,8 +74,9 @@ typedef unsigned short uint16_t; | |||
| 71 | /* allow us to provide our own version of fd_set */ | 74 | /* allow us to provide our own version of fd_set */ |
| 72 | #define fd_set ws_fd_set | 75 | #define fd_set ws_fd_set |
| 73 | #include "w32.h" | 76 | #include "w32.h" |
| 77 | #endif /* EMACS_CONFIG_H */ | ||
| 74 | 78 | ||
| 75 | #ifdef HAVE_TIMEVAL | 79 | #if defined (HAVE_TIMEVAL) && defined (_MSC_VER) |
| 76 | #undef timeval | 80 | #undef timeval |
| 77 | #endif | 81 | #endif |
| 78 | 82 | ||
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h index c12c194fd2a..2d2c3abe222 100644 --- a/nt/inc/sys/time.h +++ b/nt/inc/sys/time.h | |||
| @@ -6,11 +6,22 @@ | |||
| 6 | * have the below stuff. | 6 | * have the below stuff. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | /* Allow inclusion of sys/time.h and winsock2.h in any order. Needed | ||
| 10 | for running the configure test, which is only relevant to MinGW. */ | ||
| 11 | #ifndef _TIMEVAL_DEFINED | ||
| 12 | #define _TIMEVAL_DEFINED | ||
| 9 | struct timeval | 13 | struct timeval |
| 10 | { | 14 | { |
| 11 | long tv_sec; /* seconds */ | 15 | long tv_sec; /* seconds */ |
| 12 | long tv_usec; /* microseconds */ | 16 | long tv_usec; /* microseconds */ |
| 13 | }; | 17 | }; |
| 18 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) | ||
| 19 | #define timercmp(tvp, uvp, cmp) \ | ||
| 20 | (((tvp)->tv_sec != (uvp)->tv_sec) ? \ | ||
| 21 | ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ | ||
| 22 | ((tvp)->tv_usec cmp (uvp)->tv_usec)) | ||
| 23 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 | ||
| 24 | #endif /* _TIMEVAL_DEFINED */ | ||
| 14 | 25 | ||
| 15 | struct timezone | 26 | struct timezone |
| 16 | { | 27 | { |
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h index e751ed124d3..b75e7d7d6bf 100644 --- a/nt/inc/unistd.h +++ b/nt/inc/unistd.h | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | #ifndef _UNISTD_H | 3 | #ifndef _UNISTD_H |
| 4 | #define _UNISTD_H | 4 | #define _UNISTD_H |
| 5 | 5 | ||
| 6 | #include <sys/types.h> | ||
| 7 | #include <pwd.h> | ||
| 8 | |||
| 6 | /* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX | 9 | /* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX |
| 7 | platforms, <unistd.h> does. Every file in Emacs that includes | 10 | platforms, <unistd.h> does. Every file in Emacs that includes |
| 8 | <unistd.h> also includes <stdlib.h>, so there's no need to declare | 11 | <unistd.h> also includes <stdlib.h>, so there's no need to declare |