Skip to content

Commit

Permalink
Added support for compiling on win32 with Visual C and 'nmake'. It co…
Browse files Browse the repository at this point in the history
…mpiles,

but does not link. Perhaps someone who understands the MS tools can help
out. I made it link a few months ago, but with different version of glib/gtk+.
I can't remember how I made it link.

Most of the compatibility issues were resolved with adding
#ifdef HAVE_UNISTD_H the the source code. Please be sure to add this to all
future code.

svn path=/trunk/; revision=359
  • Loading branch information
gilramir committed Jul 13, 1999
1 parent 093f28c commit 601c52f
Show file tree
Hide file tree
Showing 53 changed files with 788 additions and 338 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
CPP = @CPP@
DATAFILE_DIR = @DATAFILE_DIR@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_CONFIG = @GTK_CONFIG@
Expand Down
53 changes: 53 additions & 0 deletions Makefile.nmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: nmake -f makefile.nmake

GTK_VERSION=1.3
GLIB_VERSION=1.3

GLIB_DIR=d:\prj\w\src\glib
GTK_DIR=d:\prj\w\src\gtk+

LOCAL_CFLAGS=/Ic:\tools\msdev\include

############### no need to modify below this line #########

CC = cl
LDFLAGS = /link

CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) /I$(GLIB_DIR) /I$(GTK_DIR) /Iwiretap \
/I$(GTK_DIR)\gdk\win32

OBJECTS=capture.obj column.obj dfilter-grammar.obj dfilter.obj \
display.obj ethereal.obj ethertype.obj file.obj filter.obj \
follow.obj gtkpacket.obj menu.obj \
packet-aarp.obj packet-arp.obj \
packet-atalk.obj packet-bootp.obj packet-cdp.obj packet-data.obj \
packet-dns.obj packet-eth.obj packet-fddi.obj packet-ftp.obj \
packet-giop.obj packet-gre.obj packet-http.obj packet-icmpv6.obj \
packet-ip.obj packet-ipsec.obj packet-ipv6.obj packet-ipx.obj \
packet-isakmp.obj packet-llc.obj packet-lpd.obj packet-nbipx.obj \
packet-nbns.obj packet-ncp.obj packet-nntp.obj packet-null.obj \
packet-osi.obj packet-ospf.obj packet-pop.obj packet-ppp.obj \
packet-pppoe.obj packet-pptp.obj packet-radius.obj packet-raw.obj \
packet-rip.obj packet-rsvp.obj packet-rtsp.obj packet-sdp.obj \
packet-smb.obj packet-snmp.obj packet-tcp.obj packet-telnet.obj \
packet-tftp.obj packet-tr.obj packet-trmac.obj packet-udp.obj \
packet-vines.obj packet.obj prefs.obj print.obj proto.obj \
resolv.obj snprintf.obj strerror.obj summary.obj util.obj

LIBS=wiretap\libwtap.lib \
$(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \
$(GTK_DIR)\gdk\win32\gdk-$(GTK_VERSION).lib \
$(GLIB_DIR)\glib-$(GTK_VERSION).lib \
$(GLIB_DIR)\gmodule-$(GTK_VERSION).lib


ethereal.exe : config.h $(OBJECTS) $(LIBS)
$(CC) $(CFLAGS) -Feethereal.exe $(OBJECTS) $(LIBS) $(LDFLAGS)

config.h : config.h.win32
copy config.h.win32 $@

ps.c : rdps.exe print.ps
rdps print.ps ps.c

30 changes: 30 additions & 0 deletions README.win32
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$Id: README.win32,v 1.1 1999/07/13 02:52:46 gram Exp $

Ethereal can be compiled on Win32 platforms. Some libraries are
needed, however.

The glib, gtk, glib-dev, and gtk-dev packages for win32 can be found
at http://www.gimp.org/~tml/gimp/win32 You will definitely need these.

I have seen mention of a UCD SNMP library for win32 on the cygwin
home page, but I have not tried it with ethereal.

There is no open-source libpcap for win32 yet.


Instructions for MS Visual C
----------------------------
Download and install the glib-dev and gtk-dev packages. Modify
the top lines of Makefile.nmake and wiretap/Makefile.nmake accordingly.
In the wiretap directory, type "nmake -f makefile.nmake"
Then in the ethereal directory, type "nmake -f makefile.nmake"

You must set your HOME environment variable for ethereal to work.


Instructions for cygwin
-----------------------
No one has ever compiled ethereal with cygwin. It should not be difficult,
however. This spot is reserverd for your instructions on how to compile
ethereal with cygwin.

31 changes: 31 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,34 @@ yes
fi
AC_MSG_RESULT(["$v6type, $v6lib"])
])

#
# AC_ETHEREAL_PCAP_CHECK
#
AC_DEFUN(AC_ETHEREAL_PCAP_CHECK,
[
# Evidently, some systems have pcap.h, etc. in */include/pcap
AC_MSG_CHECKING(for extraneous pcap header directories)
found_pcap_dir=""
for pcap_dir in /usr/include/pcap /usr/local/include/pcap
do
if test -d $pcap_dir ; then
LIBS="$LIBS -L$pcap_dir"
CFLAGS="$CFLAGS -I$pcap_dir"
CPPFLAGS="$CPPFLAGS -I$pcap_dir"
found_pcap_dir=" $found_pcap_dir -L$pcap_dir"
fi
done
if test "$found_pcap_dir" != "" ; then
AC_MSG_RESULT(found --$found_pcap_dir added to LIBS)
else
AC_MSG_RESULT(not found)
fi
# Pcap checks
AC_CHECK_HEADER(net/bpf.h,, AC_MSG_ERROR(Header file net/bpf.h not found.))
AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.))
AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.))
])

31 changes: 31 additions & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,37 @@ yes
AC_MSG_RESULT(["$v6type, $v6lib"])
])

#
# AC_ETHEREAL_PCAP_CHECK
#
AC_DEFUN(AC_ETHEREAL_PCAP_CHECK,
[
# Evidently, some systems have pcap.h, etc. in */include/pcap
AC_MSG_CHECKING(for extraneous pcap header directories)
found_pcap_dir=""
for pcap_dir in /usr/include/pcap /usr/local/include/pcap
do
if test -d $pcap_dir ; then
LIBS="$LIBS -L$pcap_dir"
CFLAGS="$CFLAGS -I$pcap_dir"
CPPFLAGS="$CPPFLAGS -I$pcap_dir"
found_pcap_dir=" $found_pcap_dir -L$pcap_dir"
fi
done
if test "$found_pcap_dir" != "" ; then
AC_MSG_RESULT(found --$found_pcap_dir added to LIBS)
else
AC_MSG_RESULT(not found)
fi
# Pcap checks
AC_CHECK_HEADER(net/bpf.h,, AC_MSG_ERROR(Header file net/bpf.h not found.))
AC_CHECK_HEADER(pcap.h,, AC_MSG_ERROR(Header file pcap.h not found.))
AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.))
])


# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
Expand Down
6 changes: 5 additions & 1 deletion column.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* column.c
* Routines for handling column preferences
*
* $Id: column.c,v 1.14 1999/06/21 19:04:34 gram Exp $
* $Id: column.c,v 1.15 1999/07/13 02:52:46 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
Expand Down Expand Up @@ -36,7 +36,11 @@
#include <stdio.h>
#include <ctype.h>
#include <errno.h>

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include <sys/stat.h>

#include "timestamp.h"
Expand Down
9 changes: 9 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H

/* Define if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H

/* Define if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H

/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H

Expand All @@ -30,6 +36,9 @@
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H

/* Define if you have the <sys/socket> header file. */
#undef HAVE_SYS_SOCKET

/* Define if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H

Expand Down
63 changes: 63 additions & 0 deletions config.h.win32
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */

/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */

/* #undef HAVE_SA_LEN */

#define DATAFILE_DIR "/usr/local/etc"

/* #undef NEED_SNPRINTF_H */

/* #undef NEED_STRERROR_H */

/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1

/* Define if you have the <netinet/in.h> header file. */
/* #define HAVE_NETINET_IN_H 1 */

/* Define if you have the <snmp/snmp.h> header file. */
/* #undef HAVE_SNMP_SNMP_H */

/* Define if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1

/* Define if you have the <sys/ioctl.h> header file. */
/* #undef HAVE_SYS_IOCTL_H */

/* Define if you have the <sys/sockio.h> header file. */
/* #undef HAVE_SYS_SOCKIO_H */

/* Define if you have the <sys/time.h> header file. */
/* #define HAVE_SYS_TIME_H 1 */

/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define if you have the <ucd-snmp/snmp.h> header file. */
/* #undef HAVE_UCD_SNMP_SNMP_H */

/* Define if you have the <unistd.h> header file. */
/* #define HAVE_UNISTD_H 1 */

/* Define if you have the pcap library (-lpcap). */
/* #define HAVE_LIBPCAP 1 */

/* Name of package */
#define PACKAGE "ethereal"

/* Version number of package */
#define VERSION "0.6.3"

#define HAVE_WINSOCK_H
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define HAVE_DIRECT_H
#define HAVE_IO_H
#define strncasecmp strnicmp
Loading

0 comments on commit 601c52f

Please sign in to comment.