-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure
executable file
·233 lines (206 loc) · 4.08 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#!/bin/sh
#
#
# Configures to build the Icom PCR1000 Applications and supporting
# library.
#
# Copyright 1999, 2000 Polywog, Javaman of Ghetto.Org. All rights reserved.
#
USEQT=y
if [ -z ${QTDIR} ];
then
echo ''
echo ' The enviornment variable $QTDIR is not set. Will not '
echo ' build the QT PCR1000 X-Windows GUI.'
echo ''
USEQT=n
fi
# remove the build options file
[ -f .buildopts ] && rm .buildopts
######################################################
# get system info
MACHINE=`(uname -m) 2>/dev/null` || MACHINE=unkown
RELEASE=`(uname -r) 2>/dev/null` || RELEASE=unknown
SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM=unknown
VERSION=`(uname -v) 2>/dev/null` || VERSION=unknown
#if [ "${SYSTEM}" = "BSD/OS" -o "${SYSTEM}" = "OpenBSD" ]; then
if [ "${SYSTEM}" = "BSD/OS" ]; then
SYSTEM=BSD
fi
######################################################
# set the variable's defaults
DEBUG="n"
SHARED="y"
PREFIX="/usr/local"
P_CC=gcc
P_CXX=g++
P_DEBUG="-O2"
P_PIPE=""
P_SYS="-D$SYSTEM"
P_QTDIR=${QTDIR}
P_QTLIB=${QTDIR}/lib
P_QTINC=${QTDIR}/include
P_GUISTYLE="-DCDE_STYLE"
P_MOC=${QTDIR}/bin/moc
P_LINKER=${P_CXX}
SRCDIR=`pwd`
I_FLAGS=
l_FLAGS=
L_FLAGS=
GUISTYLE=
# parse the arguments seting y or n.
while [ -n "$1" ]; do
case $1 in
-guistyle)
shift; GUISTYLE=$1
;;
-platform)
shift; PLATFORM=$1
;;
-cc)
shift; P_CC=$1
;;
-CC)
shift; P_CXX=$1
;;
-prefix)
shift; PREFIX=$1
;;
-release)
DEBUG=n
echo " Building with release code "
;;
-debug)
DEBUG=y
echo " Building with verbose debugging information -you prolly dont want this"
;;
-shared)
SHARED=y
echo " Building shared "
;;
-static)
SHARED=n
echo " Static libraries not yet supported "
HELP=y
ERROR=y
;;
-moc)
shift; P_MOC=$1
USEQT=y
;;
-qtdir)
USEQT=y
shift; P_QTDIR=$1
P_QTINC="${P_QTDIR}/include"
P_QTLIB="${P_QTDIR}/lib"
;;
-qtinc)
USEQT=y
shift; P_QTINC=$1
;;
-qtlibs)
USEQT=y
shift; P_QTLIB=$1
;;
-h | -help | --help)
HELP=y
;;
*)
echo $1: unknown argument
HELP=y
ERROR=y
;;
esac
shift
done
# usage message if something got f0x0red
if [ "$HELP" = "y" ]; then
[ "$ERROR" = "y" ] && echo
cat <<EOF
Usage: $0 [-debug | -release] \\
[-shared | -static] \\
[-platform <Linux | SunOS | BSD>] \\
[ -prefix </usr/local> ] \\
[ -guistyle <cde | motif | win95 | sgi | none> ]\\
[ -linker <ld | g++ | ...> ] \\
[[ -qtlibs </path/to/qt/lib> \\
-qtinc </path/to/qt/include> \\
-moc </path/to/moc> ] |\\
[ -qtdir </path/to/qt> ]]
EOF
[ "$ERROR" = "y" ] && exit 1
exit 0;
fi
# debug?
if [ "${DEBUG}" = "y" ]; then
P_DEBUG="-g -Wall -W -DDEBUG_VER_"
fi
if [ -z "${GUISTYLE}" ]; then
P_GUISTYLE="-DSGI_STYLE"
GUISTYLE="SGI_STYLE"
else
case ${GUISTYLE} in
cde)
P_GUISTYLE="-DCDE_STYLE"
;;
motif)
P_GUISTYLE="-DMOTIF_STYLE"
;;
sgi)
P_GUISTYLE="-DSGI_STYLE"
;;
win95)
P_GUISTYLE="-DWINDOWS_STYLE"
;;
none)
P_GUISTYLE="-DQT_STYLE"
;;
esac
fi
######################################################
# give feedback
echo
echo " Configuring for $SYSTEM"
echo " Building with C Compiler = $P_CC "
echo " Building with C++ Compiler, $P_CXX"
echo " Using 'moc' in $P_MOC "
if [ "$USEQT" = "y" ]; then
echo " Using QTDIR in $P_QTDIR "
echo " Using QT Include files from $P_QTINC "
echo " Using QT Libraries from $P_QTLIB "
echo " Using GUI Style of $GUISTYLE "
fi
################################################
# create the build options file.
cat > .buildopts <<EOF
SRCDIR =$SRCDIR
PREFIX =$PREFIX
P_DEBUG =$P_DEBUG
P_CC =$P_CC
P_CXX =$P_CXX
P_SYS =$P_SYS
P_MOC =$P_MOC
P_QTLIB =$P_QTLIB
P_QTINC =$P_QTINC
P_LINKER=$P_LINKER
P_LINK =$P_LINKER
P_QTOK =$USEQT
P_GUISTYLE=$P_GUISTYLE
EOF
#################################################
# select the configuration file
#
CONFIG="configs/${SYSTEM}"
#####################################################
# create the makefiles for the individual directories
for i in `find . -name Makefile.in -print | sort`; do
D=`dirname $i`/Makefile
Mf=${D}.in
cat > ${D} <<EOF
######
# automagically built by $0
######
EOF
cat .buildopts $CONFIG $Mf >> $D
echo ' created ' $D
done