build-configure.sh
changeset 0 2b3e5ec03512
equal deleted inserted replaced
-1:000000000000 0:2b3e5ec03512
       
     1 #!/bin/sh
       
     2 
       
     3 #
       
     4 #    Copyright 2005-2006 Intel Corporation
       
     5 # 
       
     6 #    Licensed under the Apache License, Version 2.0 (the "License");
       
     7 #    you may not use this file except in compliance with the License.
       
     8 #    You may obtain a copy of the License at
       
     9 # 
       
    10 #        http://www.apache.org/licenses/LICENSE-2.0
       
    11 # 
       
    12 #    Unless required by applicable law or agreed to in writing, software
       
    13 #    distributed under the License is distributed on an "AS IS" BASIS,
       
    14 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    15 #    See the License for the specific language governing permissions and
       
    16 #    limitations under the License.
       
    17 #
       
    18 
       
    19 
       
    20 #
       
    21 # Simple script to run various autoconf related commands to generate
       
    22 # the configure script. 
       
    23 #
       
    24 # This should not need to be run often, only when things like library
       
    25 # dependencies change or when some changes are made to the configure.ac
       
    26 # script. In particular, all generated files are cross-platform
       
    27 # and are therefore stored in the version control repository.
       
    28 
       
    29 echo "build-configure: building aclocal.m4..."
       
    30 rm -f aclocal.m4
       
    31 cat aclocal/*.ac > aclocal.m4
       
    32 
       
    33 if [ -d "$1" ] ; then
       
    34     oasys_dir=$1
       
    35 
       
    36 elif [ -d ../oasys ] ; then
       
    37     oasys_dir=../oasys
       
    38 
       
    39 elif [ -d /usr/share/oasys ] ; then
       
    40     oasys_dir=/usr/share/oasys
       
    41 
       
    42 else
       
    43     echo "build-configure: ERROR -- can't find oasys for autoconf macros"
       
    44     exit 1
       
    45 fi
       
    46 
       
    47 echo "build-configure: loading oasys functions from $oasys_dir into aclocal.m4..."
       
    48 cat $oasys_dir/aclocal/*.ac >> aclocal.m4
       
    49 
       
    50 echo "build-configure: running autoheader to build dtn-config.h.in..."
       
    51 rm -f dtn-config.h dtn-config.h.in
       
    52 autoheader
       
    53 
       
    54 cat >> dtn-config.h.in <<EOF
       
    55 
       
    56 /* Include oasys configuration state */
       
    57 #include <oasys/oasys-config.h>
       
    58 EOF
       
    59 
       
    60 echo "build-configure: running autoconf to build configure..."
       
    61 rm -f configure
       
    62 autoconf
       
    63 
       
    64 echo "build-configure: purging configure cache..."
       
    65 rm -rf autom4te.cache
       
    66 rm -f config.cache
       
    67 
       
    68 echo "build-configure: done."