For 2.0 we currently have a key environment variable set in apachectl
to tell the loader how to find our shared libraries (e.g., libapr).
On some platforms we want to set additional environment variables so
that Apache runs better.  End-users sometimes need to set environment
variables to be used by httpd/modules as well (e.g., set loader path
to find shared library that some DSO needs).

This patch introduces a separate file for environment variables which
gets installed in the same dir as apachectl.  apachectl sources the
file to pick up any settings for httpd.  As with httpd.conf, we won't
overwrite any user modifications during make install.  The important
file to be installed is envvars-std and that will be copied to envvars
if envvars doesn't already exist.

Any comments while I finish up?

still to do: 

resolve bindir vs. sbindir discrepancy

fix install-bindist script to do the right thing
(remove "#binbuild " from envvars-std, not from apachectl and copy
envvars-std to envvars if it doesn't already exist)

? support/envvars-std.in

# envvars-std - default environment variables for apachectl
#
# This file is generated from envvars-std.in
#
# the following lines are automatically uncommented for
# binary builds
#binbuild LD_LIBRARY_PATH='/home/trawick/apacheinst/lib/:$LD_LIBRARY_PATH'
#binbuild export LD_LIBRARY_PATH
#


Index: configure.in
===================================================================
RCS file: /cvs/apache/httpd-2.0/configure.in,v
retrieving revision 1.189
diff -u -r1.189 configure.in
--- configure.in        2001/12/05 17:32:52     1.189
+++ configure.in        2001/12/14 17:54:52
@@ -240,6 +240,19 @@
 bindprocessor \
 )
 
+dnl ## Set up any appropriate OS-specific environment variables for apachectl
+
+case $host in
+    *aix*)
+        OS_SPECIFIC_VARS="export LDR_CNTRL=MAXDATA=0x80000000\nexport 
+AIXTHREAD_SCOPE=S"
+        ;;
+    *os390*)
+        OS_SPECIFIC_VARS="export _CEE_RUNOPTS=\"(STACK(,,ANY))\"\nexport 
+_EDC_ADD_ERRNO2=1"
+        ;;
+    *)
+        OS_SPECIFIC_VARS=""
+esac
+      
 AC_ARG_WITH(port,APACHE_HELP_STRING(--with-port=PORT,Port on which to listen (default 
is 80)),
         [if test "$withval" = "yes"; then AC_MSG_ERROR('option --with-port requires a 
value (the TCP port number)'); else PORT="$withval"; fi],
        [PORT=80])
@@ -262,6 +275,7 @@
 APACHE_SUBST(OS_DIR)
 APACHE_SUBST(BUILTIN_LIBS)
 APACHE_SUBST(SHLIBPATH_VAR)
+APACHE_SUBST(OS_SPECIFIC_VARS)
 
 PRE_SHARED_CMDS='echo ""'
 POST_SHARED_CMDS='echo ""'
@@ -437,7 +451,7 @@
     ;;
 esac
 
-AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl support/dbmmanage 
support/log_server_status support/logresolve.pl support/phf_abuse_log.cgi 
support/split-logfile build/rules.mk,,[
+AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs support/apachectl support/dbmmanage 
+support/envvars-std support/log_server_status support/logresolve.pl 
+support/phf_abuse_log.cgi support/split-logfile build/rules.mk,,[
   APACHE_GEN_MAKEFILES
 ])
 
Index: support/.cvsignore
===================================================================
RCS file: /cvs/apache/httpd-2.0/support/.cvsignore,v
retrieving revision 1.14
diff -u -r1.14 .cvsignore
--- .cvsignore  2001/10/27 13:00:55     1.14
+++ .cvsignore  2001/12/14 17:54:53
@@ -18,6 +18,7 @@
 apachectl
 checkgid
 dbmmanage
+envvars-std
 log_server_status
 logresolve.pl
 split-logfile
Index: support/Makefile.in
===================================================================
RCS file: /cvs/apache/httpd-2.0/support/Makefile.in,v
retrieving revision 1.29
diff -u -r1.29 Makefile.in
--- Makefile.in 2001/11/02 21:49:35     1.29
+++ Makefile.in 2001/12/14 17:54:53
@@ -21,6 +21,12 @@
                chmod 755 $(sbindir)/$$i; \
            fi ; \
        done
+       @if test -f "$(builddir)/envvars-std"; then \
+           cp -p envvars-std $(sbindir); \
+           if test ! -f $(sbindir)/envvars; then \
+               cp -p envvars-std $(sbindir)/envvars ; \
+           fi ; \
+       fi
 
 htpasswd_OBJECTS = htpasswd.lo
 htpasswd: $(htpasswd_OBJECTS)
Index: support/apachectl.in
===================================================================
RCS file: /cvs/apache/httpd-2.0/support/apachectl.in,v
retrieving revision 1.8
diff -u -r1.8 apachectl.in
--- apachectl.in        2001/12/03 18:00:04     1.8
+++ apachectl.in        2001/12/14 17:54:53
@@ -30,10 +30,10 @@
 # the path to your httpd binary, including options if necessary
 HTTPD='@prefix@/bin/@progname@'
 #
-# the following lines are automatically uncommented for
-# binary builds
-#binbuild @SHLIBPATH_VAR@='@prefix@/lib/:$@SHLIBPATH_VAR@'
-#binbuild export @SHLIBPATH_VAR@
+# pick up any necessary environment variables
+if test -f @prefix@/bin/envvars; then
+  . @prefix@/bin/envvars
+fi
 #
 # a command that outputs a formatted text version of the HTML at the
 # url given on the command line.  Designed for lynx, however other


-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Reply via email to