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) \