pcp
[Top] [All Lists]

build issue with AC_PROG_AWK

To: pcp@xxxxxxxxxxx
Subject: build issue with AC_PROG_AWK
From: James Peach <jamespeach@xxxxxxx>
Date: Mon, 24 Mar 2008 20:18:55 -0700
Sender: pcp-bounce@xxxxxxxxxxx
Hi all,

I just experienced a minor but confusing build issue with awk. configure found /opt/local/bin/gawk, but it didn't get set in pcp.conf with the full path:

blacko:pcp-2.7.4 jpeach$ grep awk config.log
configure:4584: checking for gawk
configure:4600: found /opt/local/bin/gawk
configure:4611: result: gawk
ac_cv_prog_AWK=gawk
AWK='gawk'
awk='gawk'

Now, somewhere later in the build PCP_AWK_PROG is run but $PATH is reset. This means that awk isn't found and mysterious build failures ensue.

IMO, AC_PROG_AWK should give the absolute path, but something like this should take care of the problem:

--- pcp-2.7.4/configure.in      2007-09-07 04:37:11.000000000 -0700
+++ pcp-2.7.4.jpeach/configure.in       2008-03-24 20:14:14.000000000 -0700
@@ -409,6 +409,10 @@
 dnl installed on linux.
 test "$AWK" = "mawk" -a -x /usr/bin/awk && AWK=awk
 awk=$AWK
+case $awk in
+    /*) ;;
+    *) awk=`which $awk` ;;
+esac
 AC_SUBST(awk)

 test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed)




<Prev in Thread] Current Thread [Next in Thread>