[syslog-ng]can't compile syslog in HP-UX 11.23

Balazs Scheidler syslog-ng@lists.balabit.hu
Fri, 15 Apr 2005 10:27:33 +0200


On Thu, 2005-04-14 at 18:42 +0900, XX XXXX wrote:
> I get errors when running "make" for syslog-ng1.6.6 on HP-UX 11.23
> maybe it's because that "ld" in HP-UX can't excute "-Bstatic" and "-Bdynamic"
> option.
> does anyone who succeeded in installing syslog in HP-UX 11i?
> I do not know how to solve this problem
> I need help
> 
> /usr/local/bin/gcc  -g -O2 -Wall -I/home/libol-0.3.15/src -D_GNU_SOURCE
>   -o syslog-ng  main.o sources.o center.o  filters.o destinations.o log.o
>  cfgfile.o cfg-grammar.o cfg-lex.o  affile.o afsocket.o afunix.o  afinet.o
> afinter.o afuser.o  afstreams.o afprogram.o afremctrl.o  nscache.o utils.o
> syslog-names.o  macros.o getopt.o getopt1.o -lnsl  /home/libol-0.3.15/src/.libs/libol.a
> -lnsl -lxnet -Wl,-Bstatic -ll -lwrap    -Wl,-Bdynamic
> ld: Bad keyword argument: static
> Fatal error.
> collect2: ld returned 1 exit status

I have committed the patch below to improve ld argument detection. If
you apply it syslog-ng should compile fine, however it might link to -ll
and -lwrap dynamically. To improve the situation I'd need some
information on HP's linker as I currently have no access to a HP-UX
machine.

Can you send me an "ld -V" output and point me a direction where I can
find a manpage for HP's ld ?

--- syslog-ng/ChangeLog:1.80.4.32       Sat Apr  9 12:49:53 2005
+++ syslog-ng/ChangeLog Fri Apr 15 10:24:11 2005
@@ -1,3 +1,10 @@
+2005-04-15  Balazs Scheidler  <bazsi@bzorp.balabit>
+
+       * configure.in: added detection code for ld static linking
+       arguments (-Bstatic and -Bdynamic) which currently works for
+       Solaris/Linux. On other platforms syslog-ng might link to some
+       libraries dynamically.
+
 2005-04-08  Balazs Scheidler  <bazsi@bzorp.balabit>

        * configure.in: bumped to version 1.6.7
Index: syslog-ng/configure.in
diff -u syslog-ng/configure.in:1.72.4.14 syslog-ng/configure.in:1.72.4.15
--- syslog-ng/configure.in:1.72.4.14    Sat Apr  9 12:49:53 2005
+++ syslog-ng/configure.in      Fri Apr 15 10:24:11 2005
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.72.4.14 2005/04/09 10:49:53 bazsi Exp $
+dnl $Id: configure.in,v 1.72.4.15 2005/04/15 08:24:11 bazsi Exp $
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/affile.c)

@@ -286,11 +286,22 @@
        AC_MSG_RESULT(no)
 fi

+AC_MSG_CHECKING(how to enable static linking for certain libraries)
+ldversion=`ld -V | head -1`
+if echo $ldversion | egrep "GNU|Solaris" > /dev/null; then
+       LD_START_STATIC="-Wl,-Bstatic"
+       LD_END_STATIC="-Wl,-Bdynamic"
+       AC_MSG_RESULT(GNU or Solaris)
+else
+       LD_START_STATIC=""
+       LD_END_STATIC=""
+       AC_MSG_RESULT([no clues, linking everything dynamically, please send appropriate ld arguments to syslog-ng@lists.balabit.hu])
+fi

 AC_MSG_CHECKING(libol version >= $LIBOL_REQ_MAJOR.$LIBOL_REQ_MINOR.$LIBOL_REQ_PATCH)

 if test "$with_libol" = ""; then
-       if test ! -x `which libol-config` ; then
+       if test ! -x "`which libol-config`" ; then
                AC_ERROR([libol-config not found, either install libol or supply its location with --with-libol])
        fi
        LIBOL_VERSION=`libol-config --version`
@@ -333,7 +344,7 @@
 if test "$enable_full_static" = "yes"; then
        LIBS="-static $LIBS $LEXLIB $LIBWRAP_LIBS $LIBNET_LIBS $LIBOL_LIBS"
 else
-       LIBS="$LIBS $LIBOL_LIBS -Wl,-Bstatic $LEXLIB $LIBWRAP_LIBS $LIBNET_LIBS   -Wl,-Bdynamic"
+       LIBS="$LIBS $LIBOL_LIBS $LD_START_STATIC $LEXLIB $LIBWRAP_LIBS $LIBNET_LIBS   $LD_END_STATIC"
 fi
 AC_SUBST(YFLAGS)



-- 
Bazsi