]> granicus.if.org Git - apache/commitdiff
Add Convert-to-BSD-Makefiles-On-The-Fly system
authorSascha Schumann <sascha@apache.org>
Fri, 22 Sep 2000 17:07:47 +0000 (17:07 +0000)
committerSascha Schumann <sascha@apache.org>
Fri, 22 Sep 2000 17:07:47 +0000 (17:07 +0000)
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
build/bsd_makefile [new file with mode: 0755]
build/fastgen.sh
buildconf
configure.in

index 8719cf0673a0a09356d5aa7c885c758fa1c7b444..bbbf875e522967ee8b940f73788806c883332bfe 100644 (file)
@@ -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 (executable)
index 0000000..90ce5fe
--- /dev/null
@@ -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
+# <http://www.apache.org/>.
+#
+# 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
index 8fa020a82b965bfc79c2969819684ea3e875d1df..eb9d83e6f74dfb1acaa605d1e5fea7c3408d2a52 100755 (executable)
@@ -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 <<EOF >$makefile
+    cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$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 <<EOF >$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
index 0657e1b9477c7130c1998f6444595f0dfc769546..3e47e77cab7cd658b26a64eef11ae0f2c2bb4205 100755 (executable)
--- 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+"$@"}
index 30fa4006d36c1d37838ee7bb4f21f9d18a310804..1c8f0fa64dc5bcf398012aa4dfbdf1838a4f13c0 100644 (file)
@@ -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
 ])