For: nessus-core-1.2.7 From: Stephen J. Friedl Date: Mon Feb 24 03:38:59 PST 2003 Subj: numerous nessus-core "configure" issues Patch built with: LC_ALL=C TZ=UTC0 diff -Naur configure.in.orig configure.in > patch.txt These Patch locations: http://www.unixwiz.net/patches/nessus-core-1.2.7-config-patch.txt http://www.unixwiz.net/patches/nessus-core-1.3.4-config-patch.txt http://www.unixwiz.net/patches/nessus-core-2.0.0-config-patch.txt While building nessus-core under Red Hat Linux 8.0, we found problems with configure. A few are outright bugs, while others look like idiosynchracies. These three patches fix all of them, and we're including the same patch header on them all because they fix the same problems. See the first line of this file to see which version this patches. Problem #1 - the AC_PATH_PROG() autoconf macro is used to locate programs such as gtk-config in the system path, and it's called like AC_PATH_PROG(GTKCONFIG, gtk-config,,$XPATH:$PATH) If it's found, the GTKCONFIG variable is set to the full path. The problem is that the autoconf-generated shell code tries to run through the path with something like this: IFS=: for ac_dir in $XPATH:$PATH do # try stuff with $dir done POSIX says that IFS expansion is only supposed to occur during variable expansion (inside $XPATH and $PATH), so the colon separating the two variables is NOT supposed to be a word boundary. Plenty of older shells exhibit non-POSIX behavior, but newer ones do not, and it behooves us to stop depending on on the nonportable behavior. By setting $XPATH to be the entire path, not just the "auxilliary" path, and using just this one variable in AC_PATH_PROG, this obviates the problem altogether. Those curious to read about this bash issue can find it here: http://mail.gnu.org/archive/html/bug-bash/2001-07/msg00083.html Problem #2: if only GTK 2 is found, the configure script generates a warning messages that suggests we complain to the GTK people. But since this is done from the AC_WARN macro, the *comma* in the warning text is treated as an argument separator, so everything after this is silently truncated. We changed the comma to a dash. Problem #3: At one point $PKGCONFIG is misspelled $PKGONFIG Problem #4: a fruitless search for pkg-config reports "gtk-config not found". I don't know the whole GTK business, and the code surrounding this is a little fuzzy, so I might have solved only a partial problem (or maybe even the wrong problem). --- Apply the patches and rebuild: # cd /source/nessus-core # patch -p0 < /tmp/patchfile.txt or wherever # autoconf configure.in > configure # ./configure Our testing used autoconf 2.53 --- configure.in.orig 2003-02-24 08:43:53.000000000 +0000 +++ configure.in 2003-02-24 11:17:35.000000000 +0000 @@ -66,7 +66,8 @@ nessus_lib=-lnessus dnl extending the search path for AC_PATH_PROG when searching for config scripts -XPATH=$prefix/bin:$prefix/bin +dnl this single variable must contain the WHOLE path +XPATH=$prefix/bin:$DESTDIR$prefix/bin:$PATH dnl User options @@ -106,7 +107,7 @@ -AC_PATH_PROG(NESSUSCONFIG, nessus-config,,$XPATH:$PATH) +AC_PATH_PROG(NESSUSCONFIG, nessus-config,,$XPATH) test "x$NESSUSCONFIG" = x && AC_ERROR("" "" @@ -114,7 +115,7 @@ "compile nessus-core." "Get it at ftp://ftp.nessus.org/pub/nessus/") -AC_PATH_PROG(NASLCONFIG, nasl-config,,$XPATH:$PATH) +AC_PATH_PROG(NASLCONFIG, nasl-config,,$XPATH) test "x$NASLCONFIG" = x && AC_ERROR("" "" @@ -693,20 +694,19 @@ fi -AC_PATH_PROG(GTKCONFIG, gtk-config,,$XPATH:$PATH) +AC_PATH_PROG(GTKCONFIG, gtk-config,,$XPATH) test "x$GTKCONFIG" = x && { - AC_PATH_PROG(GTKCONFIG, gtk12-config,,$XPATH:$PATH) - test "x$GTKCONFIG" = x && AC_PATH_PROG(GTKCONFIG, gtk10-config,,$XPATH:$PATH) + AC_PATH_PROG(GTKCONFIG, gtk12-config,,$XPATH) + test "x$GTKCONFIG" = x && AC_PATH_PROG(GTKCONFIG, gtk10-config,,$XPATH) } test "$GTKCONFIG" || { - AC_PATH_PROG(PKGCONFIG, pkg-config,,$XPATH:$PATH) + AC_PATH_PROG(PKGCONFIG, pkg-config,,$XPATH) test -z "$PKGCONFIG" && - AC_WARN("**** gtk-config not found. The client will not \ -be built") + AC_WARN("**** pkg-config not found") } @@ -716,7 +716,7 @@ client=client client_install=client-install test -n "$GTKCONFIG" && GTKVERSION=`$GTKCONFIG --version` - test -z "$GTKCONFIG" && GTKVERSION=`$PKGONFIG --modversion gtk+-2.0` + test -z "$GTKCONFIG" && GTKVERSION=`$PKGCONFIG --modversion gtk+-2.0` AC_MSG_CHECKING([GTK version]) AC_MSG_RESULT($GTKVERSION) GTK_VERSION=`echo $GTKVERSION | sed 's/\./ /g' | awk {'print $1$2'}` @@ -725,9 +725,9 @@ test -n "$GTKCONFIG" && { -AC_PATH_PROG(GLIBCONFIG, glib-config,,$XPATH:$PATH) +AC_PATH_PROG(GLIBCONFIG, glib-config,,$XPATH) test "x$GLIBCONFIG" = x && { - AC_PATH_PROG(GLIBCONFIG, glib12-config,,$XPATH:$PATH) + AC_PATH_PROG(GLIBCONFIG, glib12-config,,$XPATH) } } @@ -880,7 +880,7 @@ test -n "$PKGCONFIG" && { AC_WARN(Only gtk+-2.0 was found : the client will be built but will be extremely buggy. \ Install gtk+-1.2 if you want stability. If you do not understand why you would \ -want to install version 1.2.x when you have 2.0.x, send a mail to the GTK+ team \ +want to install version 1.2.x when you have 2.0.x-send a mail to the GTK+ team \ (www.gtk.org) and complain about their inability to handle backward compatibility) } }