httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wilfredo Sanchez <wsanc...@apple.com>
Subject [PATCH: apxs: allow for override of CFG_* values]
Date Wed, 07 Jul 1999 03:15:53 GMT
<fontfamily><param>Helvetica</param>  I ran into a problem using apxs while
trying to build mod_dav into a distribution.  Basically, apxs knows that the configuration
files are over yonder and the module go over here, etc., but these paths are assuming that
you are installing onto your local system.  So "apxs -i ..." ends up editing my machines config
and installing nicely onto my machine, when I'm just hoping to create a separate root that
I can package into a tarball or something.


  I'd like to change the value of </fontfamily><fixed><fontfamily><param>Courier</param>CFG_LIBEXECDIR</fontfamily></fixed><fontfamily><param>Helvetica</param>
and </fontfamily><fixed><fontfamily><param>Courier</param>CFG_SYSCONFDIR</fontfamily></fixed><fontfamily><param>Helvetica</param>
when installing in this manner.  In my case I want, for example, </fontfamily><fixed><fontfamily><param>Courier</param>SYSCONFDIR="$(DSTROOT)`apxs
-q SYSCONFDIR`"</fontfamily></fixed><fontfamily><param>Helvetica</param>.


  I can also see a situation where you might not want to use the same compile options as were
used by apache.  Perhaps I need a different compiler, even because I wrote my module in CLU
or something.


  So I added an option "</fontfamily><fixed><fontfamily><param>Courier</param>-S
<<var>=<<value></fontfamily></fixed><fontfamily><param>Helvetica</param>"
which lets me set these things:


</fontfamily><fixed><fontfamily><param>Courier</param>	<bold>wsanchez%</bold>
apxs -S SYSCONFDIR=/foo -q SYSCONFDIR

	/foo

</fontfamily></fixed><fontfamily><param>Helvetica</param>

	-Fred



</fontfamily><fixed><fontfamily><param>Courier</param>Index:
apxs.8

===================================================================

RCS file: /CVSRoot/CoreOS/Services/apache/apache/src/support/apxs.8,v

retrieving revision 1.1.1.2

diff -u -d -b -w -r1.1.1.2 apxs.8

--- apxs.8      1999/01/12 21:49:23     1.1.1.2

+++ apxs.8      1999/07/07 03:15:37

@@ -56,15 +56,24 @@

 .SH SYNOPSIS

 .B apxs

 .B \-g

+[

+.BI \-S " name=value

+]

 .BI \-n " modname"

 

 .B apxs

 .B \-q

+[

+.BI \-S " name=value

+]

 .IR query " ..."

 

 .B apxs

 .B \-c

 [

+.BI \-S " name=value

+]

+[

 .BI \-o " dsofile"

 ]

 [

@@ -90,6 +99,9 @@

 .B apxs

 .B \-i

 [

+.BI \-S " name=value

+]

+[

 .BI \-n " modname"

 ]

 [

@@ -218,6 +230,11 @@

 .fi

 inside your own Makefiles if you need manual access

 to Apache's C header files.

+.PP

+Configuration options:

+.TP 12

+.BI \-S " name=value"

+This option changes the apxs settings described above.

 .PP

 Template Generation options:

 .TP 12

Index: apxs.pl

===================================================================

RCS file: /CVSRoot/CoreOS/Services/apache/apache/src/support/apxs.pl,v

retrieving revision 1.5

diff -u -d -b -w -r1.5 apxs.pl

--- apxs.pl     1999/03/31 20:12:42     1.5

+++ apxs.pl     1999/07/07 03:15:37

@@ -117,6 +117,7 @@

 my @opt_L = ();

 my @opt_l = ();

 my @opt_W = ();

+my @opt_S = ();

 my $opt_i = 0;

 my $opt_a = 0;

 my $opt_A = 0;

@@ -188,18 +189,18 @@

 }

 

 sub usage {

-    print STDERR "Usage: apxs -g -n <<modname>\n";

-    print STDERR "       apxs -q <<query> ...\n";

-    print STDERR "       apxs -c [-o <<dsofile>] [-D <<name>[=<<value>]]
[-I <<incdir>]\n";

-    print STDERR "               [-L <<libdir>] [-l <<libname>] [-Wc,<<flags>]
[-Wl,<<flags>]\n";

-    print STDERR "               <<files> ...\n";

-    print STDERR "       apxs -i [-a] [-A] [-n <<modname>] <<dsofile> ...\n";

+    print STDERR "Usage: apxs -g [-S <<var>=<<val>] -n <<modname>\n";

+    print STDERR "       apxs -q [-S <<var>=<<val>] <<query> ...\n";

+    print STDERR "       apxs -c [-S <<var>=<<val>] [-o <<dsofile>]
[-D <<name>[=<<value>]]\n";

+    print STDERR "               [-I <<incdir>] [-L <<libdir>] [-l <<libname>]
[-Wc,<<flags>]\n";

+    print STDERR "               [-Wl,<<flags>] <<files> ...\n";

+    print STDERR "       apxs -i [-S <<var>=<<val>] [-a] [-A] [-n <<modname>]
<<dsofile> ...\n";

     exit(1);

 }

 

 #   option handling

 my $rc;

-($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+iaA", @ARGV);

+($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+S+iaA", @ARGV);

 &usage if ($rc == 0);

 &usage if ($#ARGV == -1 and not $opt_g);

 &usage if (not $opt_q and not ($opt_g and $opt_n) and not $opt_i and not $opt_c);

@@ -208,6 +209,27 @@

 my @args = @ARGV;

 my $name = 'unknown';

 $name = $opt_n if ($opt_n ne '');

+

+if (@opt_S) {

+    my ($opt_S);

+    foreach $opt_S (@opt_S) {

+       if ($opt_S =~ m/^([^=]+)=(.*)$/) {

+           my ($var) = $1;

+           my ($val) = $2;

+           my $oldval = eval "\$CFG_$var";

+

+           unless ($var and $oldval) {

+               print STDERR "apxs:Error: no config variable $var\n";

+               &usage;

+           }

+

+           eval "\$CFG_${var}=\"${val}\"";

+       } else {

+           print STDERR "apxs:Error: malformatted -S option\n";

+           &usage;

+       }

+    }

+}

 

 ##

 ##  Operation

</fontfamily>


--

<bold><flushleft><fontfamily><param>Courier</param>Wilfredo
Sánchez, wsanchez@apple.com

</fontfamily></flushleft></bold><fontfamily><param>Courier</param>Apple
Computer, Inc., Core Operating Systems / BSD

Technical Lead, Darwin Project

1 Infinite Loop, 302-4K, Cupertino, CA 95014


Mime
View raw message