You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ws...@hyperreal.org on 1999/07/07 20:55:28 UTC
cvs commit: apache-1.3/src/support apxs.8 apxs.pl
wsanchez 99/07/07 11:55:28
Modified: src/support apxs.8 apxs.pl
Log:
Add "-S var=val" option which allows for override of CFG_* built-in values.
Revision Changes Path
1.7 +17 -0 apache-1.3/src/support/apxs.8
Index: apxs.8
===================================================================
RCS file: /home/cvs/apache-1.3/src/support/apxs.8,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- apxs.8 1999/04/22 21:04:53 1.6
+++ apxs.8 1999/07/07 18:55:26 1.7
@@ -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
1.22 +40 -18 apache-1.3/src/support/apxs.pl
Index: apxs.pl
===================================================================
RCS file: /home/cvs/apache-1.3/src/support/apxs.pl,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- apxs.pl 1999/06/25 21:24:36 1.21
+++ apxs.pl 1999/07/07 18:55:26 1.22
@@ -68,18 +68,18 @@
## Configuration
##
-my $CFG_TARGET = '@TARGET@'; # substituted via Makefile.tmpl
-my $CFG_CC = '@CC@'; # substituted via Makefile.tmpl
-my $CFG_CFLAGS = '@CFLAGS@'; # substituted via Makefile.tmpl
-my $CFG_CFLAGS_SHLIB = '@CFLAGS_SHLIB@'; # substituted via Makefile.tmpl
-my $CFG_LD_SHLIB = '@LD_SHLIB@'; # substituted via Makefile.tmpl
+my $CFG_TARGET = '@TARGET@'; # substituted via Makefile.tmpl
+my $CFG_CC = '@CC@'; # substituted via Makefile.tmpl
+my $CFG_CFLAGS = '@CFLAGS@'; # substituted via Makefile.tmpl
+my $CFG_CFLAGS_SHLIB = '@CFLAGS_SHLIB@'; # substituted via Makefile.tmpl
+my $CFG_LD_SHLIB = '@LD_SHLIB@'; # substituted via Makefile.tmpl
my $CFG_LDFLAGS_SHLIB = '@LDFLAGS_MOD_SHLIB@'; # substituted via Makefile.tmpl
-my $CFG_LIBS_SHLIB = '@LIBS_SHLIB@'; # substituted via Makefile.tmpl
-my $CFG_PREFIX = '@prefix@'; # substituted via APACI install
-my $CFG_SBINDIR = '@sbindir@'; # substituted via APACI install
-my $CFG_INCLUDEDIR = '@includedir@'; # substituted via APACI install
-my $CFG_LIBEXECDIR = '@libexecdir@'; # substituted via APACI install
-my $CFG_SYSCONFDIR = '@sysconfdir@'; # substituted via APACI install
+my $CFG_LIBS_SHLIB = '@LIBS_SHLIB@'; # substituted via Makefile.tmpl
+my $CFG_PREFIX = '@prefix@'; # substituted via APACI install
+my $CFG_SBINDIR = '@sbindir@'; # substituted via APACI install
+my $CFG_INCLUDEDIR = '@includedir@'; # substituted via APACI install
+my $CFG_LIBEXECDIR = '@libexecdir@'; # substituted via APACI install
+my $CFG_SYSCONFDIR = '@sysconfdir@'; # substituted via APACI install
##
## Cleanup the above stuff
@@ -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