From 7cb5b586764dcf8565aa28d531dd718a3e6ad79a Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Fri, 22 Sep 2000 17:07:47 +0000 Subject: [PATCH] Add Convert-to-BSD-Makefiles-On-The-Fly system Note 1: Only needed for BSD/OS. Note 2: Invent better heuristic (timestamp checks for build/*.mk). Note 3: Conversion is currently one-way Note 4: Don't package on BSD/OS. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86284 13f79535-47bb-0310-9956-ffa450edef68 --- acinclude.m4 | 3 +- build/bsd_makefile | 71 ++++++++++++++++++++++++++++++++++++++++++++++ build/fastgen.sh | 39 ++++++++++++++++++++----- buildconf | 5 ++++ configure.in | 12 ++++---- 5 files changed, 117 insertions(+), 13 deletions(-) create mode 100755 build/bsd_makefile diff --git a/acinclude.m4 b/acinclude.m4 index 8719cf0673..bbbf875e52 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -90,7 +90,8 @@ AC_DEFUN(APACHE_GEN_CONFIG_VARS,[ dnl APACHE_GEN_MAKEFILES dnl Creates Makefiles AC_DEFUN(APACHE_GEN_MAKEFILES,[ - $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $APACHE_FAST_OUTPUT_FILES + test -z "$BSD_MAKEFILE" && BSD_MAKEFILE=no + $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES ]) AC_DEFUN(APACHE_LIBTOOL_SILENT,[ diff --git a/build/bsd_makefile b/build/bsd_makefile new file mode 100755 index 0000000000..90ce5fee3d --- /dev/null +++ b/build/bsd_makefile @@ -0,0 +1,71 @@ +#! /bin/sh +# ==================================================================== +# The Apache Software License, Version 1.1 +# +# Copyright (c) 2000 The Apache Software Foundation. All rights +# reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. The end-user documentation included with the redistribution, +# if any, must include the following acknowledgment: +# "This product includes software developed by the +# Apache Software Foundation (http://www.apache.org/)." +# Alternately, this acknowledgment may appear in the software itself, +# if and wherever such third-party acknowledgments normally appear. +# +# 4. The names "Apache" and "Apache Software Foundation" must +# not be used to endorse or promote products derived from this +# software without prior written permission. For written +# permission, please contact apache@apache.org. +# +# 5. Products derived from this software may not be called "Apache", +# nor may "Apache" appear in their name, without prior written +# permission of the Apache Software Foundation. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# ==================================================================== +# +# This software consists of voluntary contributions made by many +# individuals on behalf of the Apache Software Foundation. For more +# information on the Apache Software Foundation, please see +# . +# +# The build environment was provided by Sascha Schumann. +# + +# cwd must be top_srcdir +test -f build/bsd_makefile || exit 2 + +test -f bsd_converted && exit 0 + +tmpfile=`mktemp /tmp/$0.XXXXXX` || exit 1 +for i in build/*.mk; do + sed 's/^include \(.*\)/.include "\1"/' $i >$tmpfile \ + && cp $tmpfile $i +done +rm -f $tmpfile + +touch bsd_converted +exit 0 diff --git a/build/fastgen.sh b/build/fastgen.sh index 8fa020a82b..eb9d83e6f7 100755 --- a/build/fastgen.sh +++ b/build/fastgen.sh @@ -61,6 +61,9 @@ shift mkdir_p=$1 shift +bsd_makefile=$1 +shift + top_srcdir=`(cd $srcdir; pwd)` top_builddir=`pwd` @@ -70,18 +73,40 @@ else mkdir_p="$top_srcdir/helpers/mkdir.sh" fi -for makefile in $@; do - echo "creating $makefile" - dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` - test -d "$dir/" || $mkdir_p "$dir/" +if test "$bsd_makefile" = "yes"; then + (cd $top_srcdir; ./build/bsd_makefile) + + for makefile in $@; do + echo "creating $makefile" + dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` + $mkdir_p "$dir/" - cat - $top_srcdir/$makefile.in <$makefile + cat - $top_srcdir/$makefile.in <$makefile top_srcdir = $top_srcdir top_builddir = $top_builddir srcdir = $top_srcdir/$dir builddir = $top_builddir/$dir VPATH = $top_srcdir/$dir EOF + + test -z "$dir" && dir="." + touch $dir/.deps + done +else + for makefile in $@; do + echo "creating $makefile" + dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` + $mkdir_p "$dir/" - touch "$top_builddir/$dir/.deps" -done + cat - $top_srcdir/$makefile.in <$makefile +top_srcdir = $top_srcdir +top_builddir = $top_builddir +srcdir = $top_srcdir/$dir +builddir = $top_builddir/$dir +VPATH = $top_srcdir/$dir +EOF + + test -z "$dir" && dir="." + touch $dir/.deps + done +fi diff --git a/buildconf b/buildconf index 0657e1b947..3e47e77cab 100755 --- a/buildconf +++ b/buildconf @@ -5,4 +5,9 @@ export BUILD_BASE rm -f generated_lists +case "`./config.guess`" in +*bsdi*) + ./build/bsd_makefile;; +esac + ${MAKE:-make} -f build/build.mk ${1+"$@"} diff --git a/configure.in b/configure.in index 30fa4006d3..1c8f0fa64d 100644 --- a/configure.in +++ b/configure.in @@ -209,11 +209,6 @@ RUN_SUBDIR_CONFIG_NOW(lib/pcre) APACHE_GEN_CONFIG_VARS -dnl There needs to be a .deps file in the top build directory. -dnl All others are created dynamically by rules.mk. - -touch .deps - dnl ## Build modules.c rm -f $srcdir/modules.c echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c @@ -247,6 +242,13 @@ AC_TYPE_RLIM_T perlbin=`$srcdir/helpers/PrintPath perl` AC_SUBST(perlbin) +dnl If we are running on BSD/OS, we need to use the BSD .include syntax. + +case "$host_alias" in +*bsdi*) + BSD_MAKEFILE=yes;; +esac + AC_OUTPUT($APACHE_OUTPUT_FILES support/apxs,,[ APACHE_GEN_MAKEFILES ]) -- 2.50.1