This repository has been archived by the owner on May 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
131 lines (119 loc) · 3.07 KB
/
configure
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/sh
#configure - FireMake configuratin script
#Copyright (C) 2002 Ian Gulliver
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of version 2 of the GNU General Public License as
#published by the Free Software Foundation.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
VERSION="1.9.10"
INVERSION="20041018"
ECHO=echo
if test -f /usr/ucb/echo; then
ECHO=/usr/ucb/echo
fi
disp() {
if test ! "$LASTN" = "1"; then
$ECHO -n "$PREPEND" 1>&2
fi
LASTN="0"
$ECHO "$1" 1>&2
}
dispn() {
if test ! "$LASTN" = "1"; then
$ECHO -n "$PREPEND" 1>&2
fi
LASTN="1"
$ECHO -n "$1" 1>&2
}
module() {
test -f firemake/$1
}
PHASES="library init config header makefile"
disp "FireMake v$VERSION starting....";
disp
disp "= Starting dependency check ="
for MODULE in `ls firemake`; do
REQ=`grep "^#require " firemake/$MODULE 2>/dev/null | cut -d ' ' -f 2`;
if test "$?" = "0"; then
# module has requirements, check that these modules exist
for FILE in $REQ; do
if test ! -f firemake/$FILE; then
disp " Module $MODULE requires module $FILE which is not present; aborting"
exit 1;
fi
done
fi
VER=`grep "^#version " firemake/$MODULE 2>/dev/null | cut -d ' ' -f 2`;
if test "$?" = "0" -a "$VER" != ""; then
if test "$VER" -gt "$INVERSION"; then
disp " Module $MODULE requires a newer version of FireMake!"
exit 1;
fi
fi
done
disp "= Done with dependency check ="
disp
for PHASE in $PHASES; do
disp "= Starting $PHASE phase ="
case "$PHASE" in
init)
exec > /dev/null
;;
config)
exec > /dev/null
;;
header)
exec > firemake.h
;;
makefile)
exec > Makefile
;;
esac
NEWDATA="1"
while test "$NEWDATA" = "1"; do
NEWDATA="0"
for MODULE in `ls firemake`; do
$ECHO "$DID " | grep " ${PHASE}_${MODULE} " > /dev/null
if test ! "$?" = "0"; then
grep "^#phase $PHASE" firemake/$MODULE > /dev/null 2>/dev/null
if test "$?" = "0"; then
SAT="1"
DEPS=`grep "^#after ${PHASE}_" firemake/$MODULE | cut -d ' ' -f 2`;
if test "$?" = "0"; then
#runtime dependencies
for DEP in $DEPS; do
$ECHO "$DID " | grep " ${DEP} " > /dev/null
RET="$?"
# skip deps that don't exist; #require should be used instead
FILE=`echo ${DEP} | cut -d _ -f 2-`
if test -f "firemake/$FILE"; then
if test ! "$RET" = "0"; then
SAT="0"
fi
fi
done
fi
if test "$SAT" = "1"; then # dependencies satisfied
PREPEND=" "
. firemake/$MODULE
unset PREPEND
DID="$DID ${PHASE}_${MODULE}"
NEWDATA="1"
fi
fi
fi
done
done
disp "= Done with $PHASE phase ="
disp
done
disp "Finished configuring. Now just run \"make\""