Operating System - HP-UX
1752786 Members
6108 Online
108789 Solutions
New Discussion юеВ

Re: Compilation of libpcap

 
SOLVED
Go to solution
Bob Bean
Advisor

Compilation of libpcap

I am attempting to install the libpcap library
(Version 0.8.3) on my HPUX 11.0 system, and I am running into the following errors, after I run the make. Any suggestions would be appreciated.

# ./configure
checking build system type... hppa2.0w-hp-hpux11.00
checking host system type... hppa2.0w-hp-hpux11.00
checking target system type... hppa2.0w-hp-hpux11.00
checking for gcc... /opt/ansic/bin/cc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/ansic/bin/cc accepts -g... yes
checking for /opt/ansic/bin/cc option to accept ANSI C... none needed
checking that /opt/ansic/bin/cc handles ansi prototypes... yes
checking for inline... __inline
checking for __attribute__... no
checking for u_int8_t using /opt/ansic/bin/cc... no
checking for u_int16_t using /opt/ansic/bin/cc... no
checking for u_int32_t using /opt/ansic/bin/cc... no
checking how to run the C preprocessor... /opt/ansic/bin/cc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking sys/ioccom.h usability... no
checking sys/ioccom.h presence... no
checking for sys/ioccom.h... no
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking ifaddrs.h usability... no
checking ifaddrs.h presence... no
checking for ifaddrs.h... no
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for netinet/if_ether.h... no
checking for ether_hostton... no
checking for strerror... yes
checking for strlcpy... no
checking for vsnprintf... yes
checking for snprintf... yes
checking if --disable-protochain option is specified... enabled
checking packet capture type... dlpi
checking for getifaddrs... no
checking whether we have SIOCGLIFCONF... no
checking if --enable-ipv6 option is specified... no
checking whether to build optimizer debugging code... no
checking whether to build parser debugging code... no
checking sys/bufmod.h usability... no
checking sys/bufmod.h presence... no
checking for sys/bufmod.h... no
checking sys/dlpi_ext.h usability... yes
checking sys/dlpi_ext.h presence... yes
checking for sys/dlpi_ext.h... yes
checking for /dev/dlpi device... yes
checking whether we have /proc/net/dev... no
checking whether we have DAG API... no
checking for flex... no
checking for bison... no
checking for capable lex... yes
checking for ranlib... ranlib
checking if sockaddr struct has sa_len member... no
checking if sockaddr_storage struct exists... no
checking if dl_hp_ppa_info_t struct has dl_module_id_1 member... yes
checking if unaligned accesses fail... yes
checking for a BSD-compatible install... ./install-sh -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
# make
/opt/ansic/bin/cc -O -I. -I/usr/local/include -DHAVE_CONFIG_H -D_U_=""
-c ./pcap-dlpi.c
/opt/ansic/bin/cc -O -I. -I/usr/local/include -DHAVE_CONFIG_H -D_U_=""
-c ./fad-gifc.c
sed -e 's/.*/static const char pcap_version_string[] = "libpcap version
&";/' ./VERSION > version.h
/opt/ansic/bin/cc -O -I. -I/usr/local/include -DHAVE_CONFIG_H -D_U_=""
-c ./pcap.c
/opt/ansic/bin/cc -O -I. -I/usr/local/include -DHAVE_CONFIG_H -D_U_=""
-c ./inet.c
/opt/ansic/bin/cc -O -I. -I/usr/local/include -DHAVE_CONFIG_H -D_U_=""
-c ./gencode.c
cc: "pf.h", line 67: error 1000: Unexpected symbol: "sa_family_t".
cc: "gencode.c", line 272: warning 871: "inline" is allowed only for a function.
cc: "gencode.c", line 285: warning 871: "inline" is allowed only for a function.
cc: "gencode.c", line 5067: warning 604: Pointers are not assignment-compatible.
cc: "gencode.c", line 5067: warning 563: Argument #3 is not the correct type.
cc: "gencode.c", line 5086: warning 604: Pointers are not assignment-compatible.
cc: "gencode.c", line 5086: warning 563: Argument #3 is not the correct type.
*** Error exit code 1

Stop.
8 REPLIES 8
Sridhar Bhaskarla
Honored Contributor

Re: Compilation of libpcap

Bob,

I generally try 'gcc' to compile any GNU related source codes. I have had only few lucks with HP's C compilers.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
rick jones
Honored Contributor

Re: Compilation of libpcap

Which version of libpcap are you trying to compile? I've compiled a number of versions on HP-UX, using the HP compiler, with success. The "inline" warnings are expected.

A bit of find and grep:

find /usr/include -exec grep -l sa_family_t {} \;

suggests that sa_family_t is defined in /usr/include/sys/socket.h, so I would make sure that either pf.h, or the file that includes it includes sys/socket.h. However, that is wrapped with an #ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED

The sa_family_t type is also defined in /usr/include/netinet.in.h, and is wrapped by an #ifdef _XOPEN_SOURCE_EXTENDED.

I cannot recall if those get enabled automagically if you add the -Ae compiler option or not - but you might try settings CFLAGS="-Ae" before you try a fresh configure (make distclean first).

Those include file searches were on my 11.11 system - you might want to verify them on your 11.0 system.

If you were on 11.11, (11i v1) then the "if all else fails" would be to get libpcap from the HP Internet Express bundle. There may also be a pre-compiled libpcap in the HP-UX porting archives.

You can find the latest libpcap sources at http://www.tcpdump.org/
there is no rest for the wicked yet the virtuous have no pillows
Bob Bean
Advisor

Re: Compilation of libpcap

The version I was trying to compile is the latest one (0.8.3)
Bob Bean
Advisor

Re: Compilation of libpcap

In the pf.h file, I added the following four lines at the beginning of the file

#ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED
#include "sys/socket.h"
#include "netinet/in.h"
#endif

I also added the CFLAGS="-Ae" to my environment

I then ran make distclean, configure, and then ran the make and received the same errors as before.

rick jones
Honored Contributor

Re: Compilation of libpcap

You don't (I think) need to include both inlcude files, and you should't further wrap them with an ifdef. You can try adding a -D_INDLUDE_mumble to CFLAGS on the configure and try again.

You might also consider trying the latest TOT version from tcpdump.org's CVS - a little further down their web page should be a link. I am not certain, but the issue _feel_ familiar and if so, it may be fixed in TOT bits (top of trunk)
there is no rest for the wicked yet the virtuous have no pillows
Bob Bean
Advisor

Re: Compilation of libpcap

# echo $CFLAGS
-Ae -D_INCLUDE_XOPEN_SOURCE_EXTENDED
# make
/opt/ansic/bin/cc -O -Ae -D_INCLUDE_XOPEN_SOURCE_EXTENDED -I. -I/usr/lo
cal/include -DHAVE_CONFIG_H -D_U_="" -c ./pcap-dlpi.c
cpp: "/usr/include/sys/stdsyms.h", line 20: warning 2001: Redefinition of macro
_INCLUDE_XOPEN_SOURCE_EXTENDED.
/opt/ansic/bin/cc -O -Ae -D_INCLUDE_XOPEN_SOURCE_EXTENDED -I. -I/usr/lo
cal/include -DHAVE_CONFIG_H -D_U_="" -c ./fad-gifc.c
cpp: "/usr/include/sys/stdsyms.h", line 20: warning 2001: Redefinition of macro
_INCLUDE_XOPEN_SOURCE_EXTENDED.
sed -e 's/.*/static const char pcap_version_string[] = "libpcap version
&";/' ./VERSION > version.h
/opt/ansic/bin/cc -O -Ae -D_INCLUDE_XOPEN_SOURCE_EXTENDED -I. -I/usr/lo
cal/include -DHAVE_CONFIG_H -D_U_="" -c ./pcap.c
cpp: "/usr/include/sys/stdsyms.h", line 20: warning 2001: Redefinition of macro
_INCLUDE_XOPEN_SOURCE_EXTENDED.
/opt/ansic/bin/cc -O -Ae -D_INCLUDE_XOPEN_SOURCE_EXTENDED -I. -I/usr/lo
cal/include -DHAVE_CONFIG_H -D_U_="" -c ./inet.c
cpp: "/usr/include/sys/stdsyms.h", line 20: warning 2001: Redefinition of macro
_INCLUDE_XOPEN_SOURCE_EXTENDED.
/opt/ansic/bin/cc -O -Ae -D_INCLUDE_XOPEN_SOURCE_EXTENDED -I. -I/usr/lo
cal/include -DHAVE_CONFIG_H -D_U_="" -c ./gencode.c
cpp: "/usr/include/sys/stdsyms.h", line 20: warning 2001: Redefinition of macro
_INCLUDE_XOPEN_SOURCE_EXTENDED.
cc: "pf.h", line 70: error 1000: Unexpected symbol: "sa_family_t".
cc: "gencode.c", line 272: warning 871: "inline" is allowed only for a function.
cc: "gencode.c", line 285: warning 871: "inline" is allowed only for a function.
cc: "gencode.c", line 5067: warning 604: Pointers are not assignment-compatible.
cc: "gencode.c", line 5067: warning 563: Argument #3 is not the correct type.
cc: "gencode.c", line 5086: warning 604: Pointers are not assignment-compatible.
cc: "gencode.c", line 5086: warning 563: Argument #3 is not the correct type.
*** Error exit code 1
rick jones
Honored Contributor
Solution

Re: Compilation of libpcap

I guess then that -Ae is already causing that XOPEN define to be defined.

I _just_ compiled TOT from tcpdump.org on my 11.11 system and it was clean. I don't have any 11.0 systems to check any longer :( So, if you haven't already, try that - pf.h in TOT does not have "sa_family_t" in it to begin with.
there is no rest for the wicked yet the virtuous have no pillows
Bob Bean
Advisor

Re: Compilation of libpcap

Thanks for the help Rick. I pulled the current version from tcpdump.org and it compiled with no problems. I also had to do the same for the tcpdump program as well.