could you merge your patch with Dan's patch included below? You both have good
stuff and some overlapping -- e.g. his additions to mingw32.h are good, and are
a better approach than mucking with systime.h and getpagesize.h. if you get a
merged patch to me, i'll put it into cvs right away.
ben
Dan Holmsand wrote:
The mingw build doesn't work again, following the change to
WIN32_NATIVE, etc. I've made a few changes (below) to mingw32.h and a
few other files, that (at least on my machine :-) makes the build work
again.
The code in buffer.c assumed $PWD to be correct, which it almost
certainly isn't on windows. The code in finder.el assumed filenames to
be valid regexps, again on windows they certainly aren't. The makefile
in lib-src tries to build gnuclient, which doesn't work under mingw.
A question remains, though: run.c was deleted from lib-src, which
means no more runxemacs.exe. I kind of miss this (I don't like the
console window)...
/dan
--
Dan Ola Holmsand
Innehållsbolaget
dan(a)innehall.com
cvs server: Diffing .
cvs server: Diffing dynodump
cvs server: Diffing dynodump/i386
cvs server: Diffing dynodump/ppc
cvs server: Diffing dynodump/sparc
cvs server: Diffing etc
cvs server: Diffing etc/custom
cvs server: Diffing etc/custom/example-themes
cvs server: Diffing etc/eos
cvs server: Diffing etc/idd
cvs server: Diffing etc/photos
cvs server: Diffing etc/sparcworks
cvs server: Diffing etc/tests
cvs server: Diffing etc/tests/external-widget
cvs server: Diffing etc/toolbar
cvs server: Diffing info
cvs server: Diffing lib-src
Index: lib-src/Makefile.in.in
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lib-src/Makefile.in.in,v
retrieving revision 1.36.2.14
diff -u -r1.36.2.14 Makefile.in.in
--- Makefile.in.in 2000/06/12 04:17:45 1.36.2.14
+++ Makefile.in.in 2000/06/26 22:16:53
@@ -75,7 +75,11 @@
## Things that a user might actually run,
## which should be installed in bindir.
+#ifdef WIN32_NATIVE
+INSTALLABLES_BASE = etags ctags b2m ootags
+#else
INSTALLABLES_BASE = etags ctags b2m gnuclient ootags
+#endif
INSTALLABLE_SCRIPTS = rcs-checkin gnudoit gnuattach
#ifdef HAVE_SHLIB
INSTALLABLES = $(INSTALLABLES_BASE) ellcc
cvs server: Diffing lisp
Index: lisp/finder.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/finder.el,v
retrieving revision 1.4.2.3
diff -u -r1.4.2.3 finder.el
--- finder.el 2000/04/02 11:58:40 1.4.2.3
+++ finder.el 2000/06/26 22:16:53
@@ -150,7 +150,9 @@
(let ((processed nil)
(directory-abbrev-alist
(append
- (mapcar (function (lambda (dir) (cons dir "")))
+ (mapcar (function (lambda (dir)
+ (cons (concat "^" (regexp-quote dir))
+ "")))
finder-abbreviate-directory-list)
directory-abbrev-alist))
(using-load-path))
Index: lisp/process.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/process.el,v
retrieving revision 1.5.2.12
diff -u -r1.5.2.12 process.el
--- process.el 2000/06/05 08:42:48 1.5.2.12
+++ process.el 2000/06/26 22:16:53
@@ -105,8 +105,10 @@
(setq infile (expand-file-name infile))
(setq inbuf (generate-new-buffer "*call-process*"))
(with-current-buffer inbuf
- (insert-file-contents-internal infile nil nil nil nil
- coding-system-for-read)))
+ ;; Make sure this works with jka-compr
+ (let ((file-name-handler-alist nil))
+ (insert-file-contents-internal infile nil nil nil nil
+ 'binary))))
(let ((stderr (if (consp buffer) (second buffer) t)))
(if (consp buffer) (setq buffer (car buffer)))
(setq buffer
cvs server: Diffing lisp/mule
cvs server: Diffing lisp/term
cvs server: Diffing lock
cvs server: Diffing lwlib
cvs server: Diffing man
cvs server: Diffing man/internals
cvs server: Diffing man/lispref
cvs server: Diffing man/new-users-guide
cvs server: Diffing man/xemacs
cvs server: Diffing modules
cvs server: Diffing modules/base64
cvs server: Diffing modules/ldap
cvs server: Diffing modules/sample
cvs server: Diffing modules/zlib
cvs server: Diffing nt
cvs server: Diffing nt/installer
cvs server: Diffing nt/installer/Wise
cvs server: Diffing src
Index: src/buffer.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/buffer.c,v
retrieving revision 1.36.2.32
diff -u -r1.36.2.32 buffer.c
--- buffer.c 2000/06/12 04:18:06 1.36.2.32
+++ buffer.c 2000/06/26 22:16:58
@@ -3100,6 +3100,7 @@
}
}
+#ifndef WIN32_NATIVE
/* Is PWD another name for `.' ? */
static int
directory_is_current_directory (Extbyte *pwd)
@@ -3119,22 +3120,28 @@
&& dotstat.st_dev == pwdstat.st_dev
&& pwd_internal_len < MAXPATHLEN);
}
+#endif
void
init_initial_directory (void)
{
/* This function can GC */
+#ifndef WIN32_NATIVE
Extbyte *pwd;
+#endif
initial_directory[0] = 0;
/* If PWD is accurate, use it instead of calling getcwd. This is faster
when PWD is right, and may avoid a fatal error. */
+#ifndef WIN32_NATIVE
if ((pwd = (Extbyte *) getenv ("PWD")) != NULL
&& directory_is_current_directory (pwd))
strcpy (initial_directory, (char *) pwd);
- else if (getcwd (initial_directory, MAXPATHLEN) == NULL)
+ else
+#endif
+ if (getcwd (initial_directory, MAXPATHLEN) == NULL)
fatal ("`getcwd' failed: %s\n", strerror (errno));
/* Make sure pwd is DIRECTORY_SEP-terminated.
cvs server: Diffing src/m
cvs server: Diffing src/s
Index: src/s/mingw32.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/s/Attic/mingw32.h,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 mingw32.h
--- mingw32.h 2000/06/13 01:40:09 1.1.2.11
+++ mingw32.h 2000/06/26 22:17:01
@@ -72,6 +72,8 @@
#define ENCAPSULATE_OPEN
#define ENCAPSULATE_FOPEN
#define ENCAPSULATE_MKDIR
+#define ENCAPSULATE_STAT
+#define ENCAPSULATE_FSTAT
/* Data type of load average, as read out of kmem. */
@@ -128,7 +130,7 @@
/* Define this to be the separator between devices and paths */
#define DEVICE_SEP ':'
-#define DIRECTORY_SEP '\\'
+#define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char))
/* The null device on Windows NT. */
#define NULL_DEVICE "NUL:"
@@ -211,6 +213,10 @@
#define HAVE_SETITIMER
#define HAVE_GETTIMEOFDAY
#define HAVE_SELECT
+/* systime.h includes winsock.h, which defines timeval */
+#define HAVE_TIMEVAL
+#define HAVE_GETPAGESIZE
+#define getpagesize() 4096
/*#define HAVE_STRUCT_UTIMBUF*/
#ifndef HAVE_H_ERRNO
#define HAVE_H_ERRNO
@@ -242,6 +248,7 @@
#ifndef MAXPATHLEN
#define MAXPATHLEN _MAX_PATH
+#endif
#endif
/* Define for those source files that do not include enough NT
cvs server: Diffing tests
cvs server: Diffing tests/DLL
cvs server: Diffing tests/Dnd
cvs server: Diffing tests/automated
cvs server: Diffing tests/mule
cvs server: Diffing tests/tooltalk
Craig Lanning wrote:
This patch allows compiling with mingw (-mno-cygwin) again. The
following items are included:
o Installation file is now more accurate for mingw (and cygwin??)
o Can now build without specifying --without-modules (initial module
support??)
o cygwin and mingw builds now include the icons in the .exe file.
o console window has been eliminted for mingw (and cygwin??)
Craig
---------- ChangeLog
2000-07-05 Craig Lanning <lanning(a)scra.org>
* configure.in: Clean up configure support for cygwin and mingw.
* aclocal.m4: First pass at module support for cygwin and mingw.
---------- lib-src/ChangeLog
2000-07-05 Craig Lanning <lanning(a)scra.org>
* Makefile.in.in: mingw support: don't try to build gnuclient, add
support for building and installing minitar
---------- nt/ChangeLog
2000-07-05 Craig Lanning <lanning(a)scra.org>
* xemacs.rc: Uppercase the id's so that windres will work.
---------- src/ChangeLog
2000-07-05 Craig Lanning <lanning(a)scra.org>
* systime.h: mingw defines struct timeval in the <winsock.h>
header.
* sysdll.c: added #include <windows.h> for WIN32_NATIVE case.
* s\mingw32.h: Add -mwindows to eliminate console window.
(HAVE_NATIVE_SOUND): removed; now handled by configure.
(MAIL_USE_POP): removed; now handled by configure.
Added #endif which was left dangling by Ben's mega patch.
* s\cygwin32.h: Add -mwindows to eliminate console window.
(HAVE_NATIVE_SOUND): removed; now handled by configure.
(MAIL_USE_POP): removed; now handled by configure.
* getpagesize.h: Don't include sys/param.h for mingw target.
* Makefile.in.in: Add support for including the Windows resources
when building with the cygwin and mingw targets.
------------------------------------------------------------
Only in xemacs-cl: @lockdir@
diff -urx CVS xemacsb/aclocal.m4 xemacs-cl/aclocal.m4
--- xemacsb/aclocal.m4 Fri Mar 10 03:17:26 2000
+++ xemacs-cl/aclocal.m4 Mon Jul 3 16:26:38 2000
@@ -101,6 +101,9 @@
# like `-m68040'.
dll_cflags='-m68020 -resident32 -malways-restore-a4'
;;
+ *cygwin* | *mingw* )
+ # PIC is the default
+ ;;
*)
dll_cflags='-fPIC'
;;
Only in xemacs-cl: config-log.txt
diff -urx CVS xemacsb/configure.in xemacs-cl/configure.in
--- xemacsb/configure.in Thu Jun 1 03:41:44 2000
+++ xemacs-cl/configure.in Wed Jul 5 10:06:36 2000
@@ -2442,9 +2442,18 @@
test -z "$mail_locking" -a "$mail_use_flock" = "yes"
&& mail_locking=flock
test -z "$mail_locking" -a "$mail_use_lockf" = "yes"
&& mail_locking=lockf
test -z "$mail_locking" -a "$mail_use_locking" = "yes"
&&
mail_locking=locking
+if test -z "$mail_locking"; then
+ case "$opsys" in cygwin* | mingw*)
+ mail_locking=pop ;;
+ esac
+fi
+
if test "$mail_locking" = "lockf"; then
AC_DEFINE(MAIL_LOCK_LOCKF)
elif test "$mail_locking" = "flock"; then
AC_DEFINE(MAIL_LOCK_FLOCK)
elif test "$mail_locking" = "locking"; then
AC_DEFINE(MAIL_LOCK_LOCKING)
+elif test "$mail_locking" = "pop"; then
+ with_pop=yes
+ mail_locking=
else mail_locking="dot-locking"; AC_DEFINE(MAIL_LOCK_DOT)
fi
test "$mail_locking" = "lockf" -a "$ac_cv_func_lockf" !=
"yes" && \
@@ -3821,6 +3830,14 @@
done
fi
+ dnl Win32 Native uses native sound
+ if test -z "$sound_found"; then
+ if test "$with_msw" = "yes"; then
+ sound_found=yes
+ native_sound_lib=
+ fi
+ fi
+
test "$sound_found" = "yes" && with_native_sound=yes
fi
@@ -4068,20 +4085,25 @@
if test "$with_modules" != "no"; then
AC_CHECKING(for module support)
- dnl Find headers and libraries
- AC_CHECK_HEADER(dlfcn.h, [
- AC_CHECK_LIB(dl, dlopen, [ have_dl=yes libdl=dl], [
- AC_CHECK_LIB(c, dlopen, [ have_dl=yes ])])])
- if test -n "$have_dl"; then
- AC_DEFINE(HAVE_DLOPEN)
+ dnl Check for MS-Windows
+ if test "$with_msw" == "yes"; then
+ have_dl=yes;
else
- AC_CHECK_LIB(dld, shl_load, [
- libdl=dld have_dl=yes;
- AC_DEFINE(HAVE_SHL_LOAD)], [
- AC_CHECK_LIB(dld, dld_init, [
- libdl=dld have_dl=yes;
- AC_DEFINE(HAVE_DLD_INIT)])])
- fi
+ dnl Find headers and libraries
+ AC_CHECK_HEADER(dlfcn.h, [
+ AC_CHECK_LIB(dl, dlopen, [ have_dl=yes libdl=dl], [
+ AC_CHECK_LIB(c, dlopen, [ have_dl=yes ])])])
+ if test -n "$have_dl"; then
+ AC_DEFINE(HAVE_DLOPEN)
+ else
+ AC_CHECK_LIB(dld, shl_load, [
+ libdl=dld have_dl=yes;
+ AC_DEFINE(HAVE_SHL_LOAD)], [
+ AC_CHECK_LIB(dld, dld_init, [
+ libdl=dld have_dl=yes;
+ AC_DEFINE(HAVE_DLD_INIT)])])
+ fi
+ fi dnl end !MS-Windows
if test -n "$have_dl"; then
dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared
@@ -4659,7 +4681,7 @@
test "$with_pop" = yes && echo " Compiling in support for POP
mail
retrieval."
test "$with_kerberos" = yes && echo " Compiling in support for
Kerberos POP
authentication."
test "$with_hesiod" = yes && echo " Compiling in support for
Hesiod POP
server access."
-echo " Compiling in support for \"$mail_locking\" mail spool file
locking
method."
+test -n "$mail_locking" && echo " Compiling in support for
\"$mail_locking\"
mail spool file locking method."
echo "
Other Features:"
diff -urx CVS xemacsb/lib-src/Makefile.in.in xemacs-cl/lib-src/Makefile.in.in
--- xemacsb/lib-src/Makefile.in.in Mon Jun 12 00:17:46 2000
+++ xemacs-cl/lib-src/Makefile.in.in Wed Jun 28 11:01:20 2000
@@ -75,7 +75,11 @@
## Things that a user might actually run,
## which should be installed in bindir.
+#ifdef WIN32_NATIVE
+INSTALLABLES_BASE = etags ctags b2m ootags
+#else
INSTALLABLES_BASE = etags ctags b2m gnuclient ootags
+#endif
INSTALLABLE_SCRIPTS = rcs-checkin gnudoit gnuattach
#ifdef HAVE_SHLIB
INSTALLABLES = $(INSTALLABLES_BASE) ellcc
@@ -89,7 +93,7 @@
#ifdef WIN32_NATIVE
UTILITIES= make-path wakeup profile make-docfile digest-doc \
sorted-doc movemail cvtmail yow i hexl \
- mmencode
+ mmencode minitar
#else
UTILITIES= make-path wakeup profile make-docfile digest-doc \
sorted-doc movemail cvtmail fakemail yow hexl \
@@ -339,6 +343,9 @@
i: ${srcdir}/i.c
$(CC) $(cflags) ${srcdir}/i.c $(ldflags) -o $@
+
+minitar: ${srcdir}/../nt/minitar.c
+ $(CC) $(cflags) ${srcdir}/../nt/minitar.c $(ldflags) -lz -o $@
hexl: ${srcdir}/hexl.c
$(CC) $(cflags) ${srcdir}/hexl.c $(ldflags) -o $@
Only in xemacs-cl/lwlib: config.h
Only in xemacs-cl: make-log.txt
Only in xemacs-cl: make.log
diff -urx CVS xemacsb/nt/xemacs.rc xemacs-cl/nt/xemacs.rc
--- xemacsb/nt/xemacs.rc Sat Mar 11 12:53:16 2000
+++ xemacs-cl/nt/xemacs.rc Wed Jul 5 09:46:08 2000
@@ -2,6 +2,6 @@
101 DUMP "xemacs.dmp"
#endif
-XEmacs icon preload "xemacs.ico"
-XEmacsFile icon "File.ico"
-XEmacsLisp icon "Lisp.ico"
+XEmacs ICON PRELOAD "xemacs.ico"
+XEmacsFile ICON "File.ico"
+XEmacsLisp ICON "Lisp.ico"
Only in xemacs-cl/nt: xemacs.rc.cl
Only in xemacs-cl/nt: xemacs.rc.in
Only in xemacs-cl/src: GNUmakefile~
diff -urx CVS xemacsb/src/Makefile.in.in xemacs-cl/src/Makefile.in.in
--- xemacsb/src/Makefile.in.in Mon Jun 12 00:18:06 2000
+++ xemacs-cl/src/Makefile.in.in Wed Jul 5 09:50:52 2000
@@ -138,6 +138,10 @@
sheap_obj=sheap.o
#endif
+#if defined(MINGW) || defined(CYGWIN)
+res_obj=xemacs_res.o
+#endif
+
## -Demacs is needed to make some files produce the correct version
## for use in Emacs.
@@ -191,7 +195,7 @@
rangetab.o redisplay.o redisplay-output.o regex.o\
search.o select.o $(sheap_obj) signal.o sound.o\
specifier.o strftime.o symbols.o syntax.o sysdep.o\
- undo.o $(x_objs) widget.o window.o
+ undo.o $(x_objs) widget.o window.o $(res_obj)
obj_rtl = $(objs:.o=.c.rtl)
@@ -689,6 +693,9 @@
hpplay.o: ${srcdir}/hpplay.c
$(CC) -c -Demacs $(sound_cflags) $(cflags) ${srcdir}/hpplay.c
#endif /* HAVE_NATIVE_SOUND */
+
+xemacs_res.o: ../nt/xemacs.rc
+ windres --include-dir ../nt -i ../nt/xemacs.rc -o $@
## System-specific programs to be made.
## ${other_files}, $(objects_system) and $(objects_machine)
Only in xemacs-cl/src: config.h~
Only in xemacs-cl/src: dump-id.c
diff -urx CVS xemacsb/src/getpagesize.h xemacs-cl/src/getpagesize.h
--- xemacsb/src/getpagesize.h Sat Jan 22 07:04:06 2000
+++ xemacs-cl/src/getpagesize.h Sat Jun 17 09:38:24 2000
@@ -40,7 +40,11 @@
#define getpagesize() sysconf(_SC_PAGESIZE)
#else
+#ifdef MINGW
+#define NBPG 4096
+#else
#include <sys/param.h>
+#endif
#ifdef EXEC_PAGESIZE
#define getpagesize() EXEC_PAGESIZE
Only in xemacs-cl/src/s: .#mingw32.h.1.1.2.10
Only in xemacs-cl/src/s: .#mingw32.h.1.1.2.7
diff -urx CVS xemacsb/src/s/cygwin32.h xemacs-cl/src/s/cygwin32.h
--- xemacsb/src/s/cygwin32.h Mon Jun 12 00:18:30 2000
+++ xemacs-cl/src/s/cygwin32.h Wed Jul 5 10:05:14 2000
@@ -102,8 +102,8 @@
#define ORDINARY_LINK
#endif
-#define C_SWITCH_SYSTEM -Wno-sign-compare -fno-caller-saves
-#define LIBS_SYSTEM -lwinmm
+#define C_SWITCH_SYSTEM -mwindows -Wno-sign-compare -fno-caller-saves
+#define LIBS_SYSTEM -mwindows -lwinmm
#define WIN32_LEAN_AND_MEAN
#define TEXT_START -1
@@ -128,10 +128,8 @@
#define HAVE_SOCKETS
#endif
#define OBJECTS_SYSTEM ntplay.o
-#define HAVE_NATIVE_SOUND
#undef MAIL_USE_SYSTEM_LOCK
-#define MAIL_USE_POP
/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
* group of arguments and treat it as an array of the arguments. */
diff -urx CVS xemacsb/src/s/mingw32.h xemacs-cl/src/s/mingw32.h
--- xemacsb/src/s/mingw32.h Mon Jun 12 21:40:10 2000
+++ xemacs-cl/src/s/mingw32.h Wed Jul 5 08:43:16 2000
@@ -31,8 +31,8 @@
#define ORDINARY_LINK
#endif
-#define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves
-DWIN32_NATIVE"
-#define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32"
+#define C_SWITCH_SYSTEM "-mno-cygwin -mwindows -Wno-sign-compare
-fno-caller-saves -DWIN32_NATIVE"
+#define LIBS_SYSTEM "-mno-cygwin -mwindows -lwinmm -lwsock32"
#define WIN32_LEAN_AND_MEAN
#define TEXT_START -1
@@ -56,10 +56,8 @@
#define HAVE_SOCKETS
/* #endif */
#define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
-#define HAVE_NATIVE_SOUND
#undef MAIL_USE_SYSTEM_LOCK
-#define MAIL_USE_POP
#define HAVE_MSW_C_DIRED
/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
@@ -243,6 +241,7 @@
#ifndef MAXPATHLEN
#define MAXPATHLEN _MAX_PATH
#endif
+#endif /* !NOT_C_CODE */
/* Define for those source files that do not include enough NT
system files. */
diff -urx CVS xemacsb/src/sysdll.c xemacs-cl/src/sysdll.c
--- xemacsb/src/sysdll.c Mon Jun 12 00:18:26 2000
+++ xemacs-cl/src/sysdll.c Mon Jul 3 16:48:48 2000
@@ -217,6 +217,11 @@
return dld_get_symbol(n);
}
#elif defined (WIN32_NATIVE)
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
int
dll_init (const char *arg)
{
diff -urx CVS xemacsb/src/systime.h xemacs-cl/src/systime.h
--- xemacsb/src/systime.h Mon Jun 12 00:18:26 2000
+++ xemacs-cl/src/systime.h Mon Jun 12 09:50:32 2000
@@ -134,11 +134,15 @@
#else /* not HAVE_TIMEVAL */
+#ifdef MINGW
+#include <winsock.h>
+#else
struct timeval
{
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
+#endif
#define EMACS_SELECT_TIME int
#define EMACS_TIME_TO_SELECT_TIME(time, select_time) \
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/chronic-pain/