aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Colascione2012-12-10 09:52:35 -0800
committerDaniel Colascione2012-12-10 09:52:35 -0800
commit743fa5cbdd42a820c4320599a14aab925dcdbc8b (patch)
tree7c330bf115347bbb0fa87b59f88c87a50745d432
parent98a07056558be8c13945a3a99b4801996af685a4 (diff)
parent1cf1bbd51e91f02a1d3fabb4f7ea4b1322c4259c (diff)
downloademacs-743fa5cbdd42a820c4320599a14aab925dcdbc8b.tar.gz
emacs-743fa5cbdd42a820c4320599a14aab925dcdbc8b.zip
Move fix for cygw32 icon issue from emacs-24 branch to trunk as Stefan Monnier requests
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac10
-rw-r--r--nt/ChangeLog6
-rw-r--r--nt/emacs.rc4
-rw-r--r--src/ChangeLog21
-rw-r--r--src/Makefile.in21
-rw-r--r--src/emacs.c8
-rw-r--r--src/unexw32.c16
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32gui.h3
10 files changed, 73 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 4bdbee1ad0e..5969d5726fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
12012-12-10 Daniel Colascione <dancol@dancol.org>
2
3 * configure.ac (W32_RES, W32_RES_LINK, WINDRES): Teach the cygw32
4 build how to compile Windows resource files; use these variables
5 to tell src/Makefile.in how and whether to compile resources.
6
12012-12-10 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> 72012-12-10 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
2 8
3 * configure.ac (inotify): New option. 9 * configure.ac (inotify): New option.
diff --git a/configure.ac b/configure.ac
index abdf515144b..6f188a54bd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1606,6 +1606,8 @@ AC_SUBST(LIB_STANDARD)
1606HAVE_W32=no 1606HAVE_W32=no
1607W32_OBJ= 1607W32_OBJ=
1608W32_LIBS= 1608W32_LIBS=
1609W32_RES=
1610W32_RES_LINK=
1609if test "${with_w32}" != no; then 1611if test "${with_w32}" != no; then
1610 if test "${opsys}" != "cygwin"; then 1612 if test "${opsys}" != "cygwin"; then
1611 AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.]) 1613 AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.])
@@ -1614,13 +1616,21 @@ if test "${with_w32}" != no; then
1614 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h 1616 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
1615 cannot be found.])]) 1617 cannot be found.])])
1616 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) 1618 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
1619 AC_CHECK_TOOL(WINDRES, [windres],
1620 [AC_MSG_ERROR([No resource compiler found.])])
1617 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" 1621 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
1618 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" 1622 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
1619 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" 1623 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
1620 W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" 1624 W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
1625 W32_RES="emacs.res"
1626 # Tell the linker that emacs.res is an object (which we compile from
1627 # the rc file), not a linker script.
1628 W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res"
1621fi 1629fi
1622AC_SUBST(W32_OBJ) 1630AC_SUBST(W32_OBJ)
1623AC_SUBST(W32_LIBS) 1631AC_SUBST(W32_LIBS)
1632AC_SUBST(W32_RES)
1633AC_SUBST(W32_RES_LINK)
1624 1634
1625if test "${HAVE_W32}" = "yes"; then 1635if test "${HAVE_W32}" = "yes"; then
1626 window_system=w32 1636 window_system=w32
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 35fcefe5b1b..60307469232 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,9 @@
12012-12-10 Daniel Colascione <dancol@dancol.org>
2
3 * emacs.rc: Use forward slashes in relative paths in order to
4 avoid complaints from Cygwin. (Forward slashes work perfectly
5 well in the NT build.)
6
12012-12-09 Eli Zaretskii <eliz@gnu.org> 72012-12-09 Eli Zaretskii <eliz@gnu.org>
2 8
3 * inc/unistd.h (unsetenv): Provide a prototype. 9 * inc/unistd.h (unsetenv): Provide a prototype.
diff --git a/nt/emacs.rc b/nt/emacs.rc
index 72aa47212ac..da4283b6fd1 100644
--- a/nt/emacs.rc
+++ b/nt/emacs.rc
@@ -1,5 +1,5 @@
1Emacs ICON icons\emacs.ico 1Emacs ICON icons/emacs.ico
232649 CURSOR icons\hand.cur 232649 CURSOR icons/hand.cur
3#ifdef WIN64 3#ifdef WIN64
41 24 "emacs-x64.manifest" 41 24 "emacs-x64.manifest"
5#else 5#else
diff --git a/src/ChangeLog b/src/ChangeLog
index ecaa60697ea..8df51058840 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,24 @@
12012-12-10 Daniel Colascione <dancol@dancol.org>
2
3 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
4 declarations.
5
6 * w32fns.c (cache_system_info): Initialize the global hinst
7 variable here so various initialization calls DTRT.
8
9 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused
10 variables.
11 (hinst): Remove unneeded extern declaration.
12 (_start): Remove initialization of above variables; remove
13 initialization of hinst, as cache_system_info now does that.
14
15 * emacs.c (main): Call cache_system_info early in startup; we
16 previously weren't calling it in Cygwin builds.
17
18 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK): Teach
19 the autoconf build system how to compile a Windows resource file
20 and link it to Emacs.
21
12012-12-10 Dmitry Antipov <dmantipov@yandex.ru> 222012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2 23
3 Per-buffer window counters. 24 Per-buffer window counters.
diff --git a/src/Makefile.in b/src/Makefile.in
index cd0b9318ccb..5f5fdfdc5eb 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -28,9 +28,11 @@ SHELL = /bin/sh
28# Here are the things that we expect ../configure to edit. 28# Here are the things that we expect ../configure to edit.
29# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH. 29# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
30srcdir = @srcdir@ 30srcdir = @srcdir@
31ntsource = $(srcdir)/../nt
31abs_builddir = @abs_builddir@ 32abs_builddir = @abs_builddir@
32VPATH = $(srcdir) 33VPATH = $(srcdir)
33CC = @CC@ 34CC = @CC@
35WINDRES = @WINDRES@
34CFLAGS = @CFLAGS@ 36CFLAGS = @CFLAGS@
35CPPFLAGS = @CPPFLAGS@ 37CPPFLAGS = @CPPFLAGS@
36LDFLAGS = @LDFLAGS@ 38LDFLAGS = @LDFLAGS@
@@ -267,6 +269,13 @@ W32_OBJ=@W32_OBJ@
267## --lwinspool if HAVE_W32, else empty. 269## --lwinspool if HAVE_W32, else empty.
268W32_LIBS=@W32_LIBS@ 270W32_LIBS=@W32_LIBS@
269 271
272## emacs.res if HAVE_W32
273W32_RES=@W32_RES@
274## If HAVE_W32, compiler arguments for including
275## the resource file in the binary.
276## XXX -Wl,-b -Wl,pe-i386 -Wl,emacs.res
277W32_RES_LINK=@W32_RES_LINK@
278
270## Empty if !HAVE_X_WINDOWS 279## Empty if !HAVE_X_WINDOWS
271## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT 280## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
272## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE 281## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
@@ -329,7 +338,6 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
329 @$(MKDEPDIR) 338 @$(MKDEPDIR)
330 $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $< 339 $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
331 340
332
333## lastfile must follow all files whose initialized data areas should 341## lastfile must follow all files whose initialized data areas should
334## be dumped as pure by dump-emacs. 342## be dumped as pure by dump-emacs.
335base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ 343base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
@@ -463,9 +471,11 @@ $(obj) $(otherobj): globals.h
463$(lib)/libgnu.a: $(config_h) 471$(lib)/libgnu.a: $(config_h)
464 cd $(lib) && $(MAKE) libgnu.a 472 cd $(lib) && $(MAKE) libgnu.a
465 473
466temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.a 474temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \
475 $(lib)/libgnu.a $(W32_RES)
467 $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(TEMACS_LDFLAGS2) \ 476 $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(TEMACS_LDFLAGS2) \
468 -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) 477 -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \
478 $(W32_RES_LINK)
469 test "$(CANNOT_DUMP)" = "yes" || \ 479 test "$(CANNOT_DUMP)" = "yes" || \
470 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) 480 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
471 481
@@ -506,11 +516,14 @@ $(OLDXMENU): $(OLDXMENU_TARGET)
506 516
507doc.o: buildobj.h 517doc.o: buildobj.h
508 518
519emacs.res: $(ntsource)/emacs.rc \
520 $(ntsource)/icons/emacs.ico \
521 $(ntsource)/emacs-x86.manifest
522 $(WINDRES) -O COFF -o $@ $(ntsource)/emacs.rc
509 523
510ns-app: emacs$(EXEEXT) 524ns-app: emacs$(EXEEXT)
511 cd ../nextstep && $(MAKE) $(MFLAGS) all 525 cd ../nextstep && $(MAKE) $(MFLAGS) all
512 526
513
514.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean 527.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
515.PHONY: versionclean extraclean frc 528.PHONY: versionclean extraclean frc
516 529
diff --git a/src/emacs.c b/src/emacs.c
index 2e580ea700a..8da2f66e536 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -41,6 +41,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
41#if defined WINDOWSNT || defined HAVE_NTGUI 41#if defined WINDOWSNT || defined HAVE_NTGUI
42#include "w32select.h" 42#include "w32select.h"
43#include "w32font.h" 43#include "w32font.h"
44#include "w32common.h"
44#endif 45#endif
45 46
46#if defined HAVE_NTGUI && defined CYGWIN 47#if defined HAVE_NTGUI && defined CYGWIN
@@ -733,6 +734,13 @@ main (int argc, char **argv)
733 } 734 }
734#endif 735#endif
735 736
737#if defined WINDOWSNT || defined HAVE_NTGUI
738 /* Set global variables used to detect Windows version. Do this as
739 early as possible. (unexw32.c calls this function as well, but
740 the additional call here is harmless.) */
741 cache_system_info ();
742#endif
743
736#ifdef RUN_TIME_REMAP 744#ifdef RUN_TIME_REMAP
737 if (initialized) 745 if (initialized)
738 run_time_remap (argv[0]); 746 run_time_remap (argv[0]);
diff --git a/src/unexw32.c b/src/unexw32.c
index 1e591a78b73..ee1deb5f92e 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -85,13 +85,6 @@ DWORD_PTR extra_bss_size_static = 0;
85 85
86PIMAGE_SECTION_HEADER heap_section; 86PIMAGE_SECTION_HEADER heap_section;
87 87
88#ifdef HAVE_NTGUI
89extern HINSTANCE hinst;
90HINSTANCE hprevinst = NULL;
91LPSTR lpCmdLine = "";
92int nCmdShow = 0;
93#endif /* HAVE_NTGUI */
94
95/* Startup code for running on NT. When we are running as the dumped 88/* Startup code for running on NT. When we are running as the dumped
96 version, we need to bootstrap our heap and .bss section into our 89 version, we need to bootstrap our heap and .bss section into our
97 address space before we can actually hand off control to the startup 90 address space before we can actually hand off control to the startup
@@ -121,15 +114,6 @@ _start (void)
121 /* Prevent Emacs from being locked up (eg. in batch mode) when 114 /* Prevent Emacs from being locked up (eg. in batch mode) when
122 accessing devices that aren't mounted (eg. removable media drives). */ 115 accessing devices that aren't mounted (eg. removable media drives). */
123 SetErrorMode (SEM_FAILCRITICALERRORS); 116 SetErrorMode (SEM_FAILCRITICALERRORS);
124
125 /* Invoke the NT CRT startup routine now that our housecleaning
126 is finished. */
127#ifdef HAVE_NTGUI
128 /* determine WinMain args like crt0.c does */
129 hinst = GetModuleHandle (NULL);
130 lpCmdLine = GetCommandLine ();
131 nCmdShow = SW_SHOWDEFAULT;
132#endif
133 mainCRTStartup (); 117 mainCRTStartup ();
134} 118}
135 119
diff --git a/src/w32fns.c b/src/w32fns.c
index 9aee60d7079..f69fbe05a6d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1821,7 +1821,6 @@ static LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM);
1821static BOOL 1821static BOOL
1822w32_init_class (HINSTANCE hinst) 1822w32_init_class (HINSTANCE hinst)
1823{ 1823{
1824
1825 if (w32_unicode_gui) 1824 if (w32_unicode_gui)
1826 { 1825 {
1827 WNDCLASSW uwc; 1826 WNDCLASSW uwc;
@@ -7027,6 +7026,9 @@ cache_system_info (void)
7027 DWORD data; 7026 DWORD data;
7028 } version; 7027 } version;
7029 7028
7029 /* Cache the module handle of Emacs itself. */
7030 hinst = GetModuleHandle (NULL);
7031
7030 /* Cache the version of the operating system. */ 7032 /* Cache the version of the operating system. */
7031 version.data = GetVersion (); 7033 version.data = GetVersion ();
7032 w32_major_version = version.info.major; 7034 w32_major_version = version.info.major;
diff --git a/src/w32gui.h b/src/w32gui.h
index 0da8de97f23..fe2bb2334b5 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -79,9 +79,6 @@ typedef struct _XImage
79#define FACE_DEFAULT (~0) 79#define FACE_DEFAULT (~0)
80 80
81extern HINSTANCE hinst; 81extern HINSTANCE hinst;
82extern HINSTANCE hprevinst;
83extern LPSTR lpCmdLine;
84extern int nCmdShow;
85 82
86/* Bit Gravity */ 83/* Bit Gravity */
87 84