Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xregex.texi issues on openBSD #12

Open
jungle-boogie opened this issue Jul 1, 2018 · 5 comments
Open

xregex.texi issues on openBSD #12

jungle-boogie opened this issue Jul 1, 2018 · 5 comments
Assignees

Comments

@jungle-boogie
Copy link

Hi,

I can't seem to get ngrep 1.47 to compile on openBSD -current:

make   -C regex-0.12 
gcc -g  -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_ALLOCA=1  -I. -I. -c regex.c
for d in doc test; do (cd $d; make    CPPFLAGS='' CFLAGS='-g' CC='gcc'  DEFS='-DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_ALLOCA=1 ' LDFLAGS='' LOADLIBES='' default); done
make: don't know how to make xregex.texi (prerequisite of: regex.texi)
Stop in regex-0.12/doc
*** Error 2 in regex-0.12 (Makefile:67 'default')
*** Error 1 in /home/jungle/bin/ngrep-1_47 (Makefile:62 'regex-0.12/regex.o')

Any suggestions?

I have pcre-8.41 installed:

$ ls -l /usr/local/include/pcre*
-rw-r--r--  1 root  bin  31706 Mar 12 13:47 /usr/local/include/pcre.h
-rw-r--r--  1 root  bin  44180 Apr 28 08:42 /usr/local/include/pcre2.h
-rw-r--r--  1 root  bin   5804 Apr 28 08:42 /usr/local/include/pcre2posix.h
-rw-r--r--  1 root  bin   6600 Mar 12 13:47 /usr/local/include/pcre_scanner.h
-rw-r--r--  1 root  bin   6312 Mar 12 13:47 /usr/local/include/pcre_stringpiece.h
-rw-r--r--  1 root  bin  26529 Mar 12 13:47 /usr/local/include/pcrecpp.h
-rw-r--r--  1 root  bin   6783 Mar 12 13:47 /usr/local/include/pcrecpparg.h
-rw-r--r--  1 root  bin   5452 Mar 12 13:47 /usr/local/include/pcreposix.h
@jungle-boogie
Copy link
Author

And with gmake this occurs:

/usr/local/include/pcap/pcap.h:967: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
ngrep.c: In function 'main':
ngrep.c:250: error: 'UINT32_MAX' undeclared (first use in this function)
ngrep.c:250: error: (Each undeclared identifier is reported only once
ngrep.c:250: error: for each function it appears in.)
ngrep.c:407: warning: assignment makes pointer from integer without a cast
ngrep.c: In function 'setup_pcap_source':
ngrep.c:435: warning: assignment makes pointer from integer without a cast
ngrep.c:449: warning: pointer/integer type mismatch in conditional expression
ngrep.c:457: warning: assignment makes pointer from integer without a cast
ngrep.c:479: error: 'DLT_EN10MB' undeclared (first use in this function)
ngrep.c:483: error: 'DLT_IEEE802' undeclared (first use in this function)
ngrep.c:487: error: 'DLT_FDDI' undeclared (first use in this function)
ngrep.c:491: error: 'DLT_SLIP' undeclared (first use in this function)
ngrep.c:495: error: 'DLT_PPP' undeclared (first use in this function)
ngrep.c:502: error: 'DLT_NULL' undeclared (first use in this function)
gmake: *** [Makefile:51: ngrep.o] Error 1

@jpr5 jpr5 self-assigned this Jul 2, 2018
@jpr5
Copy link
Owner

jpr5 commented Jul 2, 2018

So the first error is with the GNU regex bundled inside ngrep, not ngrep itself. What configure flags are you using? Ngrep is usually pretty good at autodetecting a system PCRE, but it might not have in your case and you might need to specify it explicitly in the configure flags.

The second error is what I would see when unistd.h, sys/types.h and the like aren't included (on your platform). In this case it looks like include paths aren't being set properly, which could possibly be due to the (same) prior issue. Not sure, need more info.

Can you share the output of configure? Not config.log - just the console output.

Also, can you give me the output of bash config.guess from the source directory?

@jungle-boogie
Copy link
Author

Hi @jpr5,

Thanks for writing back!

I'm not using any config flags at this point:

$ ./configure

Configuring System ...

checking build system type... x86_64-unknown-openbsd6.3
checking host system type... x86_64-unknown-openbsd6.3
checking target system type... x86_64-unknown-openbsd6.3
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for prefix by checking for tcpdump... /usr/sbin/tcpdump

Configuring GNU Regular Expression library ...

loading cache ./config.cache
checking host system type... x86_64-unknown-openbsd6.3
checking target system type... x86_64-unknown-openbsd6.3
checking build system type... x86_64-unknown-openbsd6.3
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking how to run the C preprocessor... (cached) gcc -E
checking for AIX... no
checking for getmntent in -lseq... (cached) no
checking for POSIXized ISC... no
checking for minix/config.h... (cached) no
checking for ANSI C header files... (cached) yes
checking for string.h... (cached) yes
checking for working alloca.h... (cached) no
checking for alloca... (cached) yes
checking for working const... (cached) yes
checking for prefix by checking for gcc... (cached) /usr/bin/gcc
creating ./config.status
creating Makefile
creating doc/Makefile
creating test/Makefile

Configuring Network Grep ...

checking for a complete set of pcap headers... found /usr/local/include/pcap
checking for pcap_open_live in -lpcap... yes
checking for BPF include path... pcap/bpf.h
checking for DLT_LINUX_SLL in pcap/bpf.h... no
checking for DLT_LOOP in pcap/bpf.h... no
checking for DLT_IEEE802_11 in pcap/bpf.h... no
checking for DLT_IEEE802_11_RADIO in pcap/bpf.h... no
checking for DLT_RAW in pcap/bpf.h... no
checking for DLT_PFLOG in pcap/bpf.h... no
checking for DLT_IPNET in pcap/bpf.h... no

CONFIG: IPv6 support disabled
CONFIG: privilege dropping enabled (using nobody)
CONFIG: using GNU regex library
CONFIG: tcpkill feature disabled
CONFIG: automatically including VLAN frames

configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged

unistd.h seems to be here:

/usr/include/sys/unistd.h
/usr/include/unistd.h
$ bash config.guess
amd64-unknown-openbsd6.3

Running openBSD -current x64

@jungle-boogie
Copy link
Author

It looks like some patches were applied to 1.45 to build on openBSD, but these patches are years old and may not be required at this point:

https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/net/ngrep/patches/

@jungle-boogie
Copy link
Author

Any suggestions on how to proceed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants