Commit a74b0e1b authored by Eli Zaretskii's avatar Eli Zaretskii

Added nt/gnulib.mk and removed kludges from ms-w32.h and ntlib.h.

parent 65d72c1b
......@@ -599,6 +599,11 @@ else
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
dnl This is used in lib/Makefile.am to use nt/gnulib.mk, the
dnl alternative to lib/gnulib.mk, so as to avoid generating header files
dnl that clash with MinGW.
AM_CONDITIONAL([BUILDING_FOR_WINDOWSNT], [test "x$opsys" = "xmingw32"])
# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
# as we don't use them.
AC_DEFUN([gl_FCNTL_O_FLAGS])
......@@ -1027,7 +1032,7 @@ AC_SUBST(C_SWITCH_SYSTEM)
LIBS_SYSTEM=
LIB_WSOCK32=
NTLIB_O=
NTLIB=
case "$opsys" in
## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
......@@ -1043,13 +1048,13 @@ case "$opsys" in
mingw32) LIBS_SYSTEM="-lcomctl32"
LIB_WSOCK32="$LIB_WSOCK32 -lwsock32"
NTLIB_O="ntlib.$ac_objext"
NTLIB="ntlib.$ac_objext"
;;
esac
AC_SUBST(LIBS_SYSTEM)
AC_SUBST(LIB_WSOCK32)
AC_SUBST(NTLIB_O)
AC_SUBST(NTLIB)
### Make sure subsequent tests use flags consistent with the build flags.
......
......@@ -171,7 +171,7 @@ LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
$(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
## Extra object files for linking emacsclient
NTLIB_O = @NTLIB_O@
NTLIB = @NTLIB@
## Some systems define this to request special libraries.
LIBS_SYSTEM = @LIBS_SYSTEM@
......@@ -331,15 +331,15 @@ make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h)
$(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
-o make-docfile${EXEEXT}
movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB_O) $(config_h)
movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
$(NTLIB_O) $(LIB_WSOCK32) $(LOADLIBES) $(LIBS_MOVE) \
$(NTLIB) $(LIB_WSOCK32) $(LOADLIBES) $(LIBS_MOVE) \
-o movemail${EXEEXT}
pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h)
$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB_O) $(config_h)
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
-DVERSION="\"${version}\"" $(LIB_WSOCK32) \
$(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient${EXEEXT}
......@@ -350,9 +350,9 @@ ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h
hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h)
$(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB_O) $(config_h)
update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
${srcdir}/update-game-score.c $(NTLIB_O) $(LOADLIBES) \
${srcdir}/update-game-score.c $(NTLIB) $(LOADLIBES) \
-o update-game-score${EXEEXT}
## Makefile ends here.
......@@ -20,20 +20,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef __MINGW32__
/* A kludge to avoid including header files in lib/. They cannot be
configured-out, and their stuff interferes with what we have
defined in this header and in other headers in nt/inc. Yuck! */
#define __need_system_fcntl_h
#define _GL_FCNTL_H
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
#define _GL_ALREADY_INCLUDING_SIGNAL_H
#define _GL_ALREADY_INCLUDING_STDIO_H
#define __need_system_stdlib_h
#define _GL_TIME_H
#define __need_system_sys_stat_h
#endif
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
......
......@@ -7,6 +7,10 @@ noinst_LIBRARIES =
AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src
if BUILDING_FOR_WINDOWSNT
include ../nt/gnulib.mk
else
include gnulib.mk
libgnu_a_SOURCES += openat-die.c save-cwd.c
endif
This diff is collapsed.
......@@ -133,20 +133,6 @@ typedef unsigned short mode_t;
extern char *getenv ();
#endif
#ifdef __MINGW32__
/* A kludge to avoid including header files in lib/. They cannot be
configured-out, and their stuff interferes with what we have
defined in this header and in other headers in nt/inc. Yuck! */
#define __need_system_fcntl_h
#define _GL_FCNTL_H
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
#define _GL_ALREADY_INCLUDING_SIGNAL_H
#define _GL_ALREADY_INCLUDING_STDIO_H
#define __need_system_stdlib_h
#define _GL_TIME_H
#define __need_system_sys_stat_h
#endif
/* Prevent accidental use of features unavailable in older Windows
versions we still support. MinGW64 defines this to a higher value
in its system headers, and is not really compatible with values
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment