-
Notifications
You must be signed in to change notification settings - Fork 3
/
build-configure.sh
executable file
·68 lines (53 loc) · 1.87 KB
/
build-configure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
#
# Copyright 2005-2006 Intel Corporation
#
# 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.
#
#
# Simple script to run various autoconf related commands to generate
# the configure script.
#
# This should not need to be run often, only when things like library
# dependencies change or when some changes are made to the configure.ac
# script. In particular, all generated files are cross-platform
# and are therefore stored in the version control repository.
echo "build-configure: building aclocal.m4..."
rm -f aclocal.m4
cat aclocal/*.ac > aclocal.m4
if [ -d "$1" ] ; then
oasys_dir=$1
elif [ -d ../oasys ] ; then
oasys_dir=../oasys
elif [ -d /usr/share/oasys ] ; then
oasys_dir=/usr/share/oasys
else
echo "build-configure: ERROR -- can't find oasys for autoconf macros"
exit 1
fi
echo "build-configure: loading oasys functions from $oasys_dir into aclocal.m4..."
cat $oasys_dir/aclocal/*.ac >> aclocal.m4
echo "build-configure: running autoheader to build dtn-config.h.in..."
rm -f dtn-config.h dtn-config.h.in
autoheader
cat >> dtn-config.h.in <<EOF
/* Include oasys configuration state */
#include <oasys/oasys-config.h>
EOF
echo "build-configure: running autoconf to build configure..."
rm -f configure
autoconf
echo "build-configure: purging configure cache..."
rm -rf autom4te.cache
rm -f config.cache
echo "build-configure: done."