summaryrefslogtreecommitdiff
path: root/scripts/preconfig
blob: 95068a03c8ddbf8158fc20ef52468231e27149f8 (plain)
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
#!/bin/sh
#
# $Id$

disclaimer="Do NOT edit - this file is generated by preconfig"

# security check - simply overwriting existing files could be harmful
if test -w acconfig.h.new ; then
	echo "Please remove acconfig.h.new and rerun this command"
	exit 1
fi

echo "/* $disclaimer */" > acconfig.h.new
cat acconfig.h.in >> acconfig.h.new
confighfiles=`echo ext/*/config.h.stub`
if test "$confighfiles" != "ext/*/config.h.stub"; then
    for file in $confighfiles; do
	cat $file >> acconfig.h.new
    done
fi
confighfiles=`echo sapi/*/config.h.stub`
if test "$confighfiles" != "sapi/*/config.h.stub"; then
    for file in $confighfiles; do
	cat $file >> acconfig.h.new
    done
fi
cmp acconfig.h acconfig.h.new > /dev/null 2>&1
if test $? -ne 0 ; then
    mv acconfig.h.new acconfig.h
else
    rm -f acconfig.h.new
fi