]> granicus.if.org Git - apache/commitdiff
Sanitize the installed config_vars.mk to remove references to the
authorJoe Orton <jorton@apache.org>
Mon, 13 Jun 2005 12:49:58 +0000 (12:49 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 13 Jun 2005 12:49:58 +0000 (12:49 +0000)
build and source directories, and to remove variables which are
internal to the httpd build system:

* build/config_vars.sh.in: New file.

* Makefile.in (build/config_vars.out): New target.
(install-build): Install build/config_vars.out as config_vars.mk.

* configure.in: Add include path for srclib/pcre to INCLUDES rather
than CPPFLAGS, and use a topdir-relative not absolute path name.
Generate build/config_vars.sh.

Reviewed by: Paul Querna
PR: 20874, 28145

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190392 13f79535-47bb-0310-9956-ffa450edef68

Makefile.in
build/config_vars.sh.in [new file with mode: 0644]
configure.in

index 8bbbc30275454f80b94bc6434b70d157b5ff3d34..c5652549275f08f56f76eb9f4fdb425a53c9f0cf 100644 (file)
@@ -21,7 +21,7 @@ INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
 DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_layout.h \
        modules.c config.cache config.log config.status build/config_vars.mk \
        build/rules.mk docs/conf/httpd.conf docs/conf/extra/*.conf shlibtool \
-       build/pkg/pkginfo
+       build/pkg/pkginfo build/config_vars.sh
 EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists \
        httpd.spec
 
@@ -85,7 +85,11 @@ install-conf:
            fi ; \
        fi
 
-install-build:
+# Create a sanitized config_vars.mk
+build/config_vars.out: build/config_vars.mk
+       @$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out
+
+install-build: build/config_vars.out
        @echo Installing build system files 
        @$(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir) 
        @for f in $(top_srcdir)/build/*.mk build/*.mk; do \
@@ -96,8 +100,8 @@ install-build:
                  $(top_srcdir)/build/instdso.sh; do \
         $(INSTALL_PROGRAM) $$f $(DESTDIR)$(installbuilddir); \
        done
-       @sed "/^LIBTOOL/s#/[^ ]*/libtool \(.*\)#`$(APR_CONFIG) --apr-libtool` $(LTFLAGS)#" \
-           build/config_vars.mk > $(DESTDIR)$(installbuilddir)/config_vars.mk
+       @$(INSTALL_DATA) build/config_vars.out $(DESTDIR)$(installbuilddir)/config_vars.mk
+       @rm build/config_vars.out
 
 htdocs-srcdir = $(top_srcdir)/docs/docroot
 
diff --git a/build/config_vars.sh.in b/build/config_vars.sh.in
new file mode 100644 (file)
index 0000000..23aea35
--- /dev/null
@@ -0,0 +1,60 @@
+#! @SHELL@
+# -*- sh -*-
+#
+# Copyright 2005 The Apache Software Foundation or its licensors, as
+# applicable.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# config_vars.sh is generated by configure, and is run by the "install-build"
+# target to generate a version of config_vars.mk which is suitable to be
+# installed.  Such a file cannot be generated at configure-time, since it
+# requires the output of the *installed* ap*-config scripts.
+
+APR_CONFIG=@APR_CONFIG@
+APU_CONFIG=@APU_CONFIG@
+
+APR_LIBTOOL="`${APR_CONFIG} --apr-libtool`"
+APR_INCLUDEDIR="`${APR_CONFIG} --includedir`"
+APU_INCLUDEDIR="`${APU_CONFIG} --includedir`"
+
+exec sed "
+/^[A-Z_]*_LDADD/d
+/MPM_LIB/d
+/APACHECTL_ULIMIT/d
+/[a-z]*_LTFLAGS/d
+/^DSO_MODULES/d
+/^MODULE_/d
+/^PORT/d
+/^nonssl_/d
+/^CORE_IMPLIB/d
+/^rel_/d
+/^abs_srcdir/d
+/^BUILTIN_LIBS/d
+/^[A-Z]*_SHARED_CMDS/d
+/^shared_build/d
+/^OS_DIR/d
+/^AP_LIBS/d
+/^OS_SPECIFIC_VARS/d
+/^MPM_SUBDIR_NAME/d
+/^EXTRA_INCLUDES/{ 
+  s, = , = -I\$(includedir) ,
+  s, -I\$(top_srcdir)/[^ ]*,,g
+  s, -I\$(top_builddir)/[^ ]*,,g
+}
+/^HTTPD_LDFLAGS/d
+/^UTIL_LDFLAGS/d
+/^APR_INCLUDEDIR.*$/s,.*,APR_INCLUDEDIR = ${APR_INCLUDEDIR},
+/^APU_INCLUDEDIR.*$/s,.*,APU_INCLUDEDIR = ${APU_INCLUDEDIR},
+/^LIBTOOL.*$/s,/[^ ]*/libtool \(.*\),${APR_LIBTOOL} \$(LTFLAGS),
+"
index c7e43e9a32dbab84d47adc16f333697791da1c53..531e51e0d7b6493f3b6563b20c7afac2949e06fc 100644 (file)
@@ -166,7 +166,7 @@ else
                   [--prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir])
 
   APR_ADDTO(AP_LIBS, [$abs_builddir/srclib/pcre/libpcre.la])
-  APR_ADDTO(CPPFLAGS, [-I$abs_builddir/srclib/pcre])
+  APR_ADDTO(INCLUDES, [-I\$(top_builddir)/srclib/pcre])
 
   AP_BUILD_SRCLIB_DIRS="$AP_BUILD_SRCLIB_DIRS pcre"
   AP_CLEAN_SRCLIB_DIRS="$AP_CLEAN_SRCLIB_DIRS pcre" 
@@ -648,7 +648,7 @@ dnl Ensure that the httpd version is included
 HTTPD_VERSION=`$abs_srcdir/build/get-version.sh all $abs_srcdir/include/ap_release.h AP_SERVER`
 AC_SUBST(HTTPD_VERSION)
 
-AC_OUTPUT($APACHE_OUTPUT_FILES docs/conf/httpd.conf docs/conf/extra/httpd-autoindex.conf docs/conf/extra/httpd-dav.conf docs/conf/extra/httpd-default.conf docs/conf/extra/httpd-info.conf docs/conf/extra/httpd-languages.conf docs/conf/extra/httpd-manual.conf docs/conf/extra/httpd-mpm.conf docs/conf/extra/httpd-multilang-errordoc.conf docs/conf/extra/httpd-ssl.conf docs/conf/extra/httpd-userdir.conf docs/conf/extra/httpd-vhosts.conf include/ap_config_layout.h 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 build/pkg/pkginfo,[true],[
+AC_OUTPUT($APACHE_OUTPUT_FILES docs/conf/httpd.conf docs/conf/extra/httpd-autoindex.conf docs/conf/extra/httpd-dav.conf docs/conf/extra/httpd-default.conf docs/conf/extra/httpd-info.conf docs/conf/extra/httpd-languages.conf docs/conf/extra/httpd-manual.conf docs/conf/extra/httpd-mpm.conf docs/conf/extra/httpd-multilang-errordoc.conf docs/conf/extra/httpd-ssl.conf docs/conf/extra/httpd-userdir.conf docs/conf/extra/httpd-vhosts.conf include/ap_config_layout.h 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 build/pkg/pkginfo build/config_vars.sh,[true],[
   APACHE_GEN_MAKEFILES
 ])