You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/11/11 16:13:31 UTC

svn commit: r834900 - in /httpd/mod_fcgid/trunk: Makefile.apxs configure.apxs

Author: trawick
Date: Wed Nov 11 15:13:31 2009
New Revision: 834900

URL: http://svn.apache.org/viewvc?rev=834900&view=rev
Log:
Follow up the awk compatibility fix in r834729 by selecting the most
suitable awk, following the AC_PROG_AWK order (gawk, mawk, nawk, awk).
As with AC_PROG_AWK, AWK=foo overrides.

After r834729 a working conf was generated on Solaris when using
/usr/bin/awk, but only by some fluke of command-line processing
(-v was sort-of ignored; see PR for discussion).  Also, the LoadModule
wasn't added in the right spot due to awk engine differences.

PR: 48067
Helped by: rjung, Hans Werner Strube <strube physik3.gwdg.de>

Modified:
    httpd/mod_fcgid/trunk/Makefile.apxs
    httpd/mod_fcgid/trunk/configure.apxs

Modified: httpd/mod_fcgid/trunk/Makefile.apxs
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/Makefile.apxs?rev=834900&r1=834899&r2=834900&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/Makefile.apxs (original)
+++ httpd/mod_fcgid/trunk/Makefile.apxs Wed Nov 11 15:13:31 2009
@@ -15,6 +15,7 @@
 fcgid_srcdir=.
 builddir=.
 srcdir=.
+awk=.
 
 SUBDIRS = modules/fcgid
 CLEAN_SUBDIRS = 
@@ -43,7 +44,7 @@
 			  $(DESTDIR)$(exp_sysconfdir)/original
 	for i in $(DESTDIR)$(httpd_conffile) $(DESTDIR)$(httpd_origconffile); do \
 	    if test -f $$i; then \
-		(awk -f $(fcgid_srcdir)/build/addloadexample.awk \
+		($(awk) -f $(fcgid_srcdir)/build/addloadexample.awk \
 		    -v MODULE=fcgid -v DSO=.so -v LIBPATH=$(rel_libexecdir) \
 		    < $$i > $$i.new && \
 		 mv $$i $$i.bak && mv $$i.new $$i \

Modified: httpd/mod_fcgid/trunk/configure.apxs
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/configure.apxs?rev=834900&r1=834899&r2=834900&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/configure.apxs (original)
+++ httpd/mod_fcgid/trunk/configure.apxs Wed Nov 11 15:13:31 2009
@@ -40,6 +40,19 @@
 rel_logfiledir=`$APXS -q exp_logfiledir | sed -e "s#^$rel_fix_prefix/##;"`
 httpd_conffile=`$APXS -q exp_sysconfdir`/`$APXS -q progname`.conf
 
+echo "Selecting a suitable awk"
+# find the most suitable awk in PATH, allowing user to override with AWK
+for a in gawk mawk nawk; do
+    if test -z "$AWK"; then
+        if $a '{print}' <$0 >/dev/null 2>&1; then
+            AWK=$a
+        fi
+    fi
+done
+if test -z "$AWK"; then
+    AWK=awk
+fi
+
 for i in Makefile build/Makefile modules/fcgid/Makefile modules/fcgid/modules.mk; do
     l_r=`echo $i|sed -e "s#/*[^/]*\\\$##;s#^\(..*\)\\\$#/\1#"`
     sed -e "s#^\(exp_installbuilddir\)=.*#\1=$exp_installbuilddir#;" \
@@ -54,6 +67,7 @@
         -e "s#^\(rel_sysconfdir\)=.*#\1=$rel_sysconfdir#;" \
         -e "s#^\(rel_logfiledir\)=.*#\1=$rel_logfiledir#;" \
         -e "s#^\(httpd_conffile\)=.*#\1=$httpd_conffile#;" \
+        -e "s#^\(awk\)=.*#\1=$AWK#;" \
         < $i.apxs > $i
 done
 



Re: svn commit: r834900 - in /httpd/mod_fcgid/trunk: Makefile.apxs configure.apxs

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Nov 11, 2009 at 10:13 AM,  <tr...@apache.org> wrote:
> Author: trawick
> Date: Wed Nov 11 15:13:31 2009
> New Revision: 834900
>
> URL: http://svn.apache.org/viewvc?rev=834900&view=rev
> Log:
> Follow up the awk compatibility fix in r834729 by selecting the most
> suitable awk, following the AC_PROG_AWK order (gawk, mawk, nawk, awk).
> As with AC_PROG_AWK, AWK=foo overrides.
>
> After r834729 a working conf was generated on Solaris when using
> /usr/bin/awk, but only by some fluke of command-line processing
> (-v was sort-of ignored; see PR for discussion).  Also, the LoadModule
> wasn't added in the right spot due to awk engine differences.

Any comments on this before I integrate it into mod_ftp?

I know of at least one remaining ugly: on Solaris 10, the tests for
missing awks result in a couple of

xxx: not found

before it settles on nawk.  I didn't see how to squelch stderr with
/bin/sh, and I didn't want to follow AC_PROG_AWK's lead on parsing
PATH and checking for file existence in each PATH dir.