Ethereal-dev: [Ethereal-dev] ethereal 0.10.0a: Build-problems on HPUX 10.20

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jost Martin <martin.jost@xxxxxxxxxxx>
Date: Thu, 12 Feb 2004 16:06:50 +0100
Hello,

this is ethereal 0.10.0a on HP-UX B.10.20 using gtk-config --version: 1.2.10.
I had some difficulties to get it build.

When I finally get it to compile and link it says:
ethereal 0.10.0a
Compiled with GTK+ 1.2.7, with GLib 1.2.10, with libpcap 0.8, with libz 1.1.4,
with libpcre 4.3, without UCD-SNMP or Net-SNMP, without ADNS.
Running with libpcap version 0.8 on HP-UX B.10.20


I'm using HPs ANSI C compiler and GNU make.
The configure call is:
export CC=cc
export CPPFLAGS="-I/pd/libs/include/"
export LDFLAGS=" -L/pd/libs/lib/"
export CFLAGS="+DAportable -Ae +O2"
./configure -prefix=/pd/ethereal0.10.0a --without-gcc --includedir=/pd/libs/include --libdir=/pd/libs/lib

During build libtool tried to use cc (instead of ld) to build shared libs:
------------------------- snippet form make-output ---------------------------------
/bin/sh ../../libtool --mode=link cc -Ae  -Ae +O2 -D_U_="" -g -I/usr/local/include -I/pd/libs/include/gtk-1.2 -I/pd/libs/include/glib-1.2 -I/pd/libs/lib/glib/include  -L/pd/libs/lib/ -L/usr/local/lib -L/usr/local/lib -o acn.la -rpath /pd/libs/lib/ethereal/plugins/0.10.0a -module -avoid-version packet-acn.lo
mkdir .libs
rm -fr .libs/acn.la .libs/acn.* .libs/acn.*
(cd . && ln -s packet-acn.lo packet-acn.o)
cc -b +h acn.sl +b /pd/libs/lib/ethereal/plugins/0.10.0a -o .libs/acn.sl  packet-acn.lo  -L/pd/libs/lib/ -L/usr/local/lib -lc
cc: warning 422: Unknown option "b" ignored.
cc: warning 440: Bad argument to option -h; ignored.
cc: warning 422: Unknown option "+b" ignored.
/usr/ccs/bin/ld: Can't open acn.sl
/usr/ccs/bin/ld: No such file or directory
gmake[3]: *** [acn.la] Error 1

--------------------------------------------------------------------------------------------------

This fails due to unrecognized and misinterpreted options and arguments
Shared libs (from ANSI C output) should be build using 'ld' instead of cc.
(shared libs from C++ sources need to use the C++ compiler to do the link step to get the static constructors/destructors right)

So I tried:
find . -name 'Makefile' -exec perl -pi'.bak' -e 's|^CCLD\s*=.*$|CCLD = "/usr/bin/ld"|' {} \;

(to replace CCLD=$(CC) by CCLD="/usr/bin/ld" in all Makefiles)

Now compiling works (including the shared libs), but linking (the executables) fails, because ld gets called with the (compiler) option '+O2'.

So I changed CCLD=.. back to CCLD=$(CC) (only in toplevel-makefile and tools/lemon/Makefile)

A second 'make all' now builds the tools correctly.

I hope it is possible to fix the configure/libtool/build complex to get this right automatically...

TIA

Martin