diff options
| author | Daniel Colascione | 2012-12-09 23:11:21 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2012-12-09 23:11:21 -0800 |
| commit | 1cf1bbd51e91f02a1d3fabb4f7ea4b1322c4259c (patch) | |
| tree | 6a1f7358551d0ce22522ba9dbf816a75a0321bec /src | |
| parent | f433306af510e86a614e9f9f082b6d2d5f56a968 (diff) | |
| download | emacs-1cf1bbd51e91f02a1d3fabb4f7ea4b1322c4259c.tar.gz emacs-1cf1bbd51e91f02a1d3fabb4f7ea4b1322c4259c.zip | |
Compile Windows resources into cygw32 Emacs
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 21 | ||||
| -rw-r--r-- | src/Makefile.in | 21 | ||||
| -rw-r--r-- | src/emacs.c | 8 | ||||
| -rw-r--r-- | src/unexw32.c | 16 | ||||
| -rw-r--r-- | src/w32fns.c | 4 | ||||
| -rw-r--r-- | src/w32gui.h | 3 |
6 files changed, 49 insertions, 24 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9d9c1fdaff5..be2d3dd6a6f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,24 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-12-08 Jan Djärv <jan.h.d@swipnet.se> | 22 | 2012-12-08 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 23 | ||
| 3 | * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103). | 24 | * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103). |
diff --git a/src/Makefile.in b/src/Makefile.in index c24e421bbbc..75624dc0631 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. |
| 30 | srcdir = @srcdir@ | 30 | srcdir = @srcdir@ |
| 31 | ntsource = $(srcdir)/../nt | ||
| 31 | abs_builddir = @abs_builddir@ | 32 | abs_builddir = @abs_builddir@ |
| 32 | VPATH = $(srcdir) | 33 | VPATH = $(srcdir) |
| 33 | CC = @CC@ | 34 | CC = @CC@ |
| 35 | WINDRES = @WINDRES@ | ||
| 34 | CFLAGS = @CFLAGS@ | 36 | CFLAGS = @CFLAGS@ |
| 35 | CPPFLAGS = @CPPFLAGS@ | 37 | CPPFLAGS = @CPPFLAGS@ |
| 36 | LDFLAGS = @LDFLAGS@ | 38 | LDFLAGS = @LDFLAGS@ |
| @@ -266,6 +268,13 @@ W32_OBJ=@W32_OBJ@ | |||
| 266 | ## --lwinspool if HAVE_W32, else empty. | 268 | ## --lwinspool if HAVE_W32, else empty. |
| 267 | W32_LIBS=@W32_LIBS@ | 269 | W32_LIBS=@W32_LIBS@ |
| 268 | 270 | ||
| 271 | ## emacs.res if HAVE_W32 | ||
| 272 | W32_RES=@W32_RES@ | ||
| 273 | ## If HAVE_W32, compiler arguments for including | ||
| 274 | ## the resource file in the binary. | ||
| 275 | ## XXX -Wl,-b -Wl,pe-i386 -Wl,emacs.res | ||
| 276 | W32_RES_LINK=@W32_RES_LINK@ | ||
| 277 | |||
| 269 | ## Empty if !HAVE_X_WINDOWS | 278 | ## Empty if !HAVE_X_WINDOWS |
| 270 | ## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT | 279 | ## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT |
| 271 | ## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE | 280 | ## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE |
| @@ -328,7 +337,6 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS) | |||
| 328 | @$(MKDEPDIR) | 337 | @$(MKDEPDIR) |
| 329 | $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $< | 338 | $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $< |
| 330 | 339 | ||
| 331 | |||
| 332 | ## lastfile must follow all files whose initialized data areas should | 340 | ## lastfile must follow all files whose initialized data areas should |
| 333 | ## be dumped as pure by dump-emacs. | 341 | ## be dumped as pure by dump-emacs. |
| 334 | base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ | 342 | base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ |
| @@ -462,9 +470,11 @@ $(obj) $(otherobj): globals.h | |||
| 462 | $(lib)/libgnu.a: $(config_h) | 470 | $(lib)/libgnu.a: $(config_h) |
| 463 | cd $(lib) && $(MAKE) libgnu.a | 471 | cd $(lib) && $(MAKE) libgnu.a |
| 464 | 472 | ||
| 465 | temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) $(lib)/libgnu.a | 473 | temacs$(EXEEXT): $(START_FILES) stamp-oldxmenu $(obj) $(otherobj) \ |
| 474 | $(lib)/libgnu.a $(W32_RES) | ||
| 466 | $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(TEMACS_LDFLAGS2) \ | 475 | $(CC) $(LD_FIRSTFLAG) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(TEMACS_LDFLAGS2) \ |
| 467 | -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) | 476 | -o temacs $(START_FILES) $(obj) $(otherobj) $(lib)/libgnu.a $(LIBES) \ |
| 477 | $(W32_RES_LINK) | ||
| 468 | test "$(CANNOT_DUMP)" = "yes" || \ | 478 | test "$(CANNOT_DUMP)" = "yes" || \ |
| 469 | test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) | 479 | test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) |
| 470 | 480 | ||
| @@ -505,11 +515,14 @@ $(OLDXMENU): $(OLDXMENU_TARGET) | |||
| 505 | 515 | ||
| 506 | doc.o: buildobj.h | 516 | doc.o: buildobj.h |
| 507 | 517 | ||
| 518 | emacs.res: $(ntsource)/emacs.rc \ | ||
| 519 | $(ntsource)/icons/emacs.ico \ | ||
| 520 | $(ntsource)/emacs-x86.manifest | ||
| 521 | $(WINDRES) -O COFF -o $@ $(ntsource)/emacs.rc | ||
| 508 | 522 | ||
| 509 | ns-app: emacs$(EXEEXT) | 523 | ns-app: emacs$(EXEEXT) |
| 510 | cd ../nextstep && $(MAKE) $(MFLAGS) all | 524 | cd ../nextstep && $(MAKE) $(MFLAGS) all |
| 511 | 525 | ||
| 512 | |||
| 513 | .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean | 526 | .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean |
| 514 | .PHONY: versionclean extraclean frc | 527 | .PHONY: versionclean extraclean frc |
| 515 | 528 | ||
diff --git a/src/emacs.c b/src/emacs.c index f533c3ae983..4f5044db1c5 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -40,6 +40,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 40 | #if defined WINDOWSNT || defined HAVE_NTGUI | 40 | #if defined WINDOWSNT || defined HAVE_NTGUI |
| 41 | #include "w32select.h" | 41 | #include "w32select.h" |
| 42 | #include "w32font.h" | 42 | #include "w32font.h" |
| 43 | #include "w32common.h" | ||
| 43 | #endif | 44 | #endif |
| 44 | 45 | ||
| 45 | #if defined HAVE_NTGUI && defined CYGWIN | 46 | #if defined HAVE_NTGUI && defined CYGWIN |
| @@ -720,6 +721,13 @@ main (int argc, char **argv) | |||
| 720 | } | 721 | } |
| 721 | #endif | 722 | #endif |
| 722 | 723 | ||
| 724 | #if defined WINDOWSNT || defined HAVE_NTGUI | ||
| 725 | /* Set global variables used to detect Windows version. Do this as | ||
| 726 | early as possible. (unexw32.c calls this function as well, but | ||
| 727 | the additional call here is harmless.) */ | ||
| 728 | cache_system_info (); | ||
| 729 | #endif | ||
| 730 | |||
| 723 | #ifdef RUN_TIME_REMAP | 731 | #ifdef RUN_TIME_REMAP |
| 724 | if (initialized) | 732 | if (initialized) |
| 725 | run_time_remap (argv[0]); | 733 | 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 | ||
| 86 | PIMAGE_SECTION_HEADER heap_section; | 86 | PIMAGE_SECTION_HEADER heap_section; |
| 87 | 87 | ||
| 88 | #ifdef HAVE_NTGUI | ||
| 89 | extern HINSTANCE hinst; | ||
| 90 | HINSTANCE hprevinst = NULL; | ||
| 91 | LPSTR lpCmdLine = ""; | ||
| 92 | int 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 de5cee1d7a7..90bbc61eec6 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -1828,7 +1828,6 @@ static LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM); | |||
| 1828 | static BOOL | 1828 | static BOOL |
| 1829 | w32_init_class (HINSTANCE hinst) | 1829 | w32_init_class (HINSTANCE hinst) |
| 1830 | { | 1830 | { |
| 1831 | |||
| 1832 | if (w32_unicode_gui) | 1831 | if (w32_unicode_gui) |
| 1833 | { | 1832 | { |
| 1834 | WNDCLASSW uwc; | 1833 | WNDCLASSW uwc; |
| @@ -7020,6 +7019,9 @@ cache_system_info (void) | |||
| 7020 | DWORD data; | 7019 | DWORD data; |
| 7021 | } version; | 7020 | } version; |
| 7022 | 7021 | ||
| 7022 | /* Cache the module handle of Emacs itself. */ | ||
| 7023 | hinst = GetModuleHandle (NULL); | ||
| 7024 | |||
| 7023 | /* Cache the version of the operating system. */ | 7025 | /* Cache the version of the operating system. */ |
| 7024 | version.data = GetVersion (); | 7026 | version.data = GetVersion (); |
| 7025 | w32_major_version = version.info.major; | 7027 | 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 | ||
| 81 | extern HINSTANCE hinst; | 81 | extern HINSTANCE hinst; |
| 82 | extern HINSTANCE hprevinst; | ||
| 83 | extern LPSTR lpCmdLine; | ||
| 84 | extern int nCmdShow; | ||
| 85 | 82 | ||
| 86 | /* Bit Gravity */ | 83 | /* Bit Gravity */ |
| 87 | 84 | ||