Skip to content

Commit

Permalink
Fix some NetBSD-specific build problems.
Browse files Browse the repository at this point in the history
Use proper identification macros for NetBSD and its defined
architectures. While at it, define the correct constant in the Amiga
block.  With these changes sniffit can build and start (but still does
not work correctly) on at least one architecture:

NetBSD octeon 10.0 NetBSD 10.0 (OCTEON) #0: Thu Mar 28 08:33:33 UTC 2024
  [email protected]:/usr/src/sys/arch/evbmips/compile/OCTEON
  evbmips

The configure script does not use pkg-config and thus needs to be
invoked as follows to detect pkgsrc ncurses:

CFLAGS=$(pkg-config --cflags ncurses) \
  LDFLAGS=$(pkg-config --libs ncurses) ./configure
  • Loading branch information
infrastation committed Sep 24, 2024
1 parent 347bd0e commit 22ab988
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/sn_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,24 @@ char *NETDEV[]={"ln"};
int HEADSIZE[]={14};
#endif

#ifdef NETBSD
#ifdef i386
#ifdef __NetBSD__
#if defined(i386) || defined(__amd64__)
#define NETDEV_NR 21
char *NETDEV[]={"ppp","ai","de","ec","ef","eg","el","en","ep","fe","fea","fpa","fxp","ix","iy","lc","le","ne","sm","tl","we"};
int HEADSIZE[]={4 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 ,14 };
#elif defined(sparc)
#elif defined(__sparc__)
#define NETDEV_NR 3
char *NETDEV[]={"ppp","le","ie"};
int HEADSIZE[]={4 ,14 ,14};
#elif defined(amiga)
#define ETH_DEV_NR 6
#elif defined(__m68k__)
#define NETDEV_NR 6
char *NETDEV[]={"ppp","bah","ed","es","le","qn"};
int HEADSIZE[]={4 ,14 ,14 ,14 ,14 ,14};
#elif defined(__mips64) && defined(__MIPSEB__)
/* Assume Octeon. */
#define NETDEV_NR 1
char *NETDEV[]={"cnmac"};
int HEADSIZE[]={14};
#else
#error Unknown network devices for this NetBSD architecture.
#endif
Expand Down

0 comments on commit 22ab988

Please sign in to comment.