On Win32, build Ethereal as a Windows-subsystem program rather than a

console-subsystem program, so that when not run from a shell window it
doesn't cause a shell window to be popped up.  (Yes, this means that any
messages it prints, when not popped up from a shell window, get lost,
but the same is true of Ethereal on UNIX/X.)  Trick for doing this
shamelessly stolen from the Win32 port of the GIMP.

We do not want to build Tethereal or editcap as Windows-subsystem
programs, however, so we take the "/SUBSYSTEM" flag out of LDFLAGS and
put it into the link commands for Ethereal, Tethereal, and editcap.

svn path=/trunk/; revision=1857
This commit is contained in:
Guy Harris 2000-04-14 09:00:25 +00:00
parent c7c8e8e458
commit eef42ea392
2 changed files with 27 additions and 7 deletions

View File

@ -1,7 +1,7 @@
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: nmake -f makefile.nmake
#
# $Id: Makefile.nmake,v 1.27 2000/04/13 21:08:16 oabad Exp $
# $Id: Makefile.nmake,v 1.28 2000/04/14 09:00:12 guy Exp $
include config.nmake
@ -10,8 +10,7 @@ include config.nmake
CC = cl
LINK= link
LDFLAGS = /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /MACHINE:I386 \
$(LOCAL_LDFLAGS)
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
CFLAGS=/MT -DHAVE_CONFIG_H $(LOCAL_CFLAGS) /I$(GLIB_DIR) /I$(GLIB_DIR)\gmodule \
/I$(GTK_DIR) /Iwiretap /I$(GTK_DIR)\gdk /I$(GTK_DIR)\gdk\win32 \
@ -198,17 +197,17 @@ all: $(EXECUTABLES)
ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) wiretap gtk plugins
$(LINK) @<<
/OUT:ethereal.exe $(LDFLAGS) $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS)
/OUT:ethereal.exe $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS)
<<
tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) wiretap plugins
$(LINK) @<<
/OUT:tethereal.exe $(LDFLAGS) $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS)
/OUT:tethereal.exe $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS)
<<
editcap.exe : config.h editcap.obj getopt.obj wiretap
$(LINK) @<<
/OUT:editcap.exe $(LDFLAGS) editcap.obj getopt.obj $(editcap_LIBS)
/OUT:editcap.exe $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS)
<<
config.h : config.h.win32

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.116 2000/04/13 20:39:36 gram Exp $
* $Id: main.c,v 1.117 2000/04/14 09:00:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -1557,6 +1557,27 @@ main(int argc, char *argv[])
return 0; /* not reached */
}
#ifdef WIN32
/* We build this as a GUI subsystem application on Win32, so
"WinMain()", not "main()", gets called.
Hack shamelessly stolen from the Win32 port of the GIMP. */
#ifdef __GNUC__
#define _stdcall __attribute__((stdcall))
#endif
int _stdcall
WinMain (struct HINSTANCE__ *hInstance,
struct HINSTANCE__ *hPrevInstance,
char *lpszCmdLine,
int nCmdShow)
{
return main (__argc, __argv);
}
#endif
static void
create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs)
{