gd is one of those libraries that can be compiled a number of different
ways, depending upon what is installed on the system. If you aren't
careful, installing gd can force you to bring in much of X11 (gd likes to
use libraries such as freetype that are part of or integrally linked into
X11). Sometimes this means that compiling gd from source is your best bet.
Other times, such as Gentoo's portage, there are special parameters so you
don't use the X11 stuff.
With me so far?
OK...
When reading config.log, basically you just have to read the output ...
anything that SOUNDS like an error message is probably an error message:
/usr/local/lib/libgd.so.2.0: undefined reference to `libiconv_open'
/usr/local/lib/libgd.so.2.0: undefined reference to `libiconv_close'
/usr/local/lib/libgd.so.2.0: undefined reference to `libiconv'
Remember the pattern -- libxxxxx is a -lxxxxx in the compile/link.
So you probably need to add -liconv to your compile command.
Now if you search the mailing list back traffic for iconv, you will find
it's a slippery bugger. Sometimes it's required and other times it breaks
things.
So what do you do? Well, there's a specific place in ntop for OS specific
stuff... and I put a lot of work into making it pretty flexible. It's the
configureextra subdirectory.
Look there and you'll see OS specific, OS/distro and even OS/distro/release
files... Look in there and you will usually find a model for pretty much
anything.
grep in there for iconv and you'll see how we solved it for Solaris.
That's probably a good start for openbsd. Rip the iconv lines from
configureextra/solaris8:
$ cat solaris8
#!/bin/sh
echo " Setting Solaris 8 specific flag values"
LDFLAGS="-L/usr/local/lib -lnsl -lsocket ${LDFLAGS}"
. configureextra/functions
# Test for GNU libiconv (e.g. SunFreeware)
test_library iconv iconv_open
and drop them into the openbsd file:
$ cat openbsd
#!/bin/sh
echo " Setting OpenBSD specific flag values"
SO_VERSION_PATCH=.0.0
# This is probably not right, but we can't seem to settle on what IS
right...
MAKE_SHARED_LIBRARY_PARM="-shared"
i.e.
====================================================================
#!/bin/sh
echo " Setting OpenBSD specific flag values"
SO_VERSION_PATCH=.0.0
# This is probably not right, but we can't seem to settle on what IS
right...
MAKE_SHARED_LIBRARY_PARM="-shared"
. configureextra/functions
# Test for GNU libiconv (e.g. SunFreeware)
test_library iconv iconv_open
====================================================================
-----Burton
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
> Michael Anderson
> Sent: Thursday, April 08, 2004 2:10 AM
> To: [EMAIL PROTECTED]
> Subject: [Ntop] Configure problem on OpenBSD 3.4 (gdImageDestroy())
>
>
> Hello,
>
> I am apparently not alone having a problem running ntop 3.0's configure
> under OpenBSD 3.4. I'm including as much information as I can so maybe
> someone can help us figure out what is wrong.
>
>
> gd 2.0.22 installed from source in /usr/local/gd
>
> configure args:
> ./configure --with-gd-root=/usr/local/gd
> --with-gd-include=/usr/local/gd/include
>
>
> pertinent chunk of config.log:
>
> configure:9309: checking gd.h presence
> configure:9320: gcc -E -DOPENBSD -I/usr/local/include
> -I/usr/local/gd/include conftest.c
> configure:9326: $? = 0
> configure:9345: result: yes
> configure:9381: checking for gd.h
> configure:9388: result: yes
> configure:9402: checking for gdImageDestroy in -lgd
> configure:9433: gcc -o conftest -g -O2 -I/usr/local/include -Wshadow
> -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wn
> ested-externs -fPIC -DOPENBSD -I/usr/local/include
> -I/usr/local/gd/include
> -L/usr/local/lib -L/usr/local/gd/lib conftest.c -lgd
> -lgdbm -lpcap -lpcap -lgdbm -lgd >&5
> /usr/local/lib/libgd.so.2.0: undefined reference to `libiconv_open'
> /usr/local/lib/libgd.so.2.0: undefined reference to `libiconv_close'
> /usr/local/lib/libgd.so.2.0: undefined reference to `libiconv'
> collect2: ld returned 1 exit status
> configure:9436: $? = 1
> configure: failed program was:
> | #line 9409 "configure"
> | /* confdefs.h. */
> |
> | #define PACKAGE_NAME "ntop"
> | #define PACKAGE_TARNAME "ntop"
> | #define PACKAGE_VERSION "3.0"
> | #define PACKAGE_STRING "ntop 3.0"
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE "ntop"
> | #define VERSION "3.0"
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_MEMORY_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_UNISTD_H 1
> | #define CFG_LITTLE_ENDIAN 1
> | #define HAVE_PCAP_H 1
> | #define HAVE_NET_BPF_H 1
> | #define HAVE_LIBPCAP 1
> | #define HAVE_GDBM_H 1
> | #define HAVE_LIBGDBM 1
> | #define HAVE_GD_H 1
> | /* end confdefs.h. */
> |
> | /* Override any gcc2 internal prototype to avoid an error. */
> | #ifdef __cplusplus
> | extern "C"
> | #endif
> | /* We use char because int might match the return type of a gcc2
> | builtin and then its argument prototype would still apply. */
> | char gdImageDestroy ();
> | int
> | main ()
> | {
> | gdImageDestroy ();
> | ;
> | return 0;
> | }
> configure:9454: result: no
>
>
> Any help appreciated. Thank you.
>
> _______________________________________________
> Ntop mailing list
> [EMAIL PROTECTED]
> http://listgateway.unipi.it/mailman/listinfo/ntop
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop