aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
6 files changed, 49 insertions, 24 deletions
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