author | lbessard |
Fri, 16 Jun 2006 14:24:59 +0200 | |
changeset 31 | a82b70738e5c |
parent 27 | c16a00df5621 |
child 32 | 8afa33692372 |
permissions | -rwxr-xr-x |
0 | 1 |
#!/bin/bash |
2 |
||
3 |
# |
|
4 |
# Copyright (C) 2004 Edouard TISSERRANT, Laurent BESSARD |
|
5 |
# Based on Gabriel Gerhardsson's cacheprobe configure script. |
|
6 |
# |
|
7 |
# This file is part of CanFestival, a library implementing CanOpen Stack. |
|
8 |
# |
|
9 |
# This library is free software; you can redistribute it and/or |
|
10 |
# modify it under the terms of the GNU Lesser General Public |
|
11 |
# License as published by the Free Software Foundation; either |
|
12 |
# version 2.1 of the License, or (at your option) any later version. |
|
13 |
# |
|
14 |
# This library is distributed in the hope that it will be useful, |
|
15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
# Lesser General Public License for more details. |
|
18 |
# |
|
19 |
# You should have received a copy of the GNU Lesser General Public |
|
20 |
# License along with this library; if not, write to the Free Software |
|
21 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
# |
|
23 |
||
24 |
########################################################################### |
|
25 |
# DEFAULT CANFESTIVAL DEFINES # |
|
26 |
########################################################################### |
|
27 |
||
28 |
# Number of can bus to use |
|
29 |
MAX_CAN_BUS_ID=1 |
|
30 |
||
31 |
# max bytes to transmit by SDO Put 4 if you only support expedited transfert. |
|
32 |
# For a normal transfert, (usually for a string), put the maximum string size to transfer. |
|
33 |
SDO_MAX_LENGTH_TRANSFERT=32 |
|
34 |
||
35 |
# Number of SDO from differents nodes that the node can manage concurrently. |
|
36 |
# for a slave node, usually put 1. |
|
37 |
SDO_MAX_SIMULTANEOUS_TRANSFERTS=4 |
|
38 |
||
39 |
# Used for NMTable[bus][nodeId] |
|
40 |
# You can put less of 128 if on the netwo |
|
41 |
# are connected only smaller nodeId node. |
|
42 |
NMT_MAX_NODE_ID=128 |
|
43 |
||
44 |
#Timeout in milliseconds for SDO. |
|
45 |
# Comment the #define if not used (infinite wait for SDO response message) |
|
46 |
SDO_TIMEOUT_MS=3000 |
|
47 |
||
48 |
MAX_NB_TIMER=32 |
|
49 |
||
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
50 |
# Generic timers declaration defaults |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
51 |
US_TO_TIMEVAL_FACTOR= |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
52 |
TIMEVAL= |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
53 |
TIMEVAL_MAX= |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
54 |
|
0 | 55 |
# Default to little-endian |
56 |
CANOPEN_LITTLE_ENDIAN=1 |
|
57 |
CANOPEN_BIG_ENDIAN= |
|
58 |
||
59 |
########################################################################### |
|
60 |
# DEFAULT BUILD OPTIONS # |
|
61 |
########################################################################### |
|
62 |
||
63 |
# Leave empty for automatic detection |
|
64 |
CC= |
|
65 |
||
66 |
#default target |
|
67 |
SUB_TARGET= |
|
68 |
||
69 |
# First compiler option - we will check if it exists |
|
70 |
CC1=gcc |
|
71 |
# Second compiler option - we will check if it exists |
|
72 |
CC2=cc |
|
73 |
||
74 |
# Install prefix |
|
75 |
SUB_PREFIX= |
|
76 |
||
77 |
SUB_TIMERS_ENABLE=YES |
|
78 |
||
79 |
# Used for C compiler test/detection |
|
80 |
CFLAGS= |
|
81 |
test=conftest |
|
82 |
rm -f $test $test.c |
|
83 |
||
84 |
XENO_CONFIG=/usr/xenomai/bin/xeno-config |
|
85 |
||
86 |
########################################################################### |
|
87 |
# ARGUMENTS PARSING # |
|
88 |
########################################################################### |
|
89 |
while [ $# -ge 1 ]; do |
|
90 |
optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` |
|
91 |
||
92 |
case $1 in |
|
93 |
--cc=*) CC=$optarg;; |
|
94 |
--arch=*) SUB_ARCH_NAME=$optarg;; |
|
95 |
--os=*) SUB_OS_NAME=$optarg;; |
|
96 |
--prefix=*) SUB_PREFIX=$optarg;; |
|
97 |
--target=*) SUB_TARGET=$optarg;; |
|
98 |
--can=*) SUB_CAN_DRIVER=$optarg;; |
|
15
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
99 |
--led=*) SUB_LED_DRIVER=$optarg;; |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
100 |
--nvram=*) SUB_NVRAM_DRIVER=$optarg;; |
0 | 101 |
--timers=*) SUB_TIMERS_DRIVER=$optarg;; |
102 |
--disable-Ox) DISABLE_OPT=1; |
|
103 |
echo "On user request: Won't optimize with \"-Ox\"";; |
|
104 |
--enable-jaxe) DISABLE_JAXE=0; |
|
105 |
echo "On user request: Will not install jaxe";; |
|
106 |
--debug) DEBUG=1; |
|
107 |
echo "Debug messages enabled !!";; |
|
108 |
--debugPDO) DEBUG=PDO; |
|
109 |
echo "Debug messages (PDO) enabled !!";; |
|
110 |
--enable-lss) SUB_LSS_ENABLE=YES; |
|
111 |
echo "On user request: Will enable Auto Baudrate detect Feature";; |
|
112 |
--desable-timers) SUB_TIMERS_ENABLE=NO; |
|
113 |
echo "On user request: Will enable built-in timer dispatch Feature";; |
|
114 |
--MAX_CAN_BUS_ID=*) MAX_CAN_BUS_ID=$1;; |
|
115 |
--SDO_MAX_LENGTH_TRANSFERT=*) SDO_MAX_LENGTH_TRANSFERT=$1;; |
|
116 |
--SDO_MAX_SIMULTANEOUS_TRANSFERTS=*) SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;; |
|
117 |
--NMT_MAX_NODE_ID=*) NMT_MAX_NODE_ID=$1;; |
|
118 |
--SDO_TIMEOUT_MS=*) SDO_TIMEOUT_MS=$1;; |
|
119 |
--CANOPEN_BIG_ENDIAN=*) CANOPEN_BIG_ENDIAN=$1;; |
|
120 |
--MAX_NB_TIMER=*) MAX_NB_TIMER=$1;; |
|
121 |
--help) echo "Usage: ./configure [options]" |
|
122 |
echo "Options:" |
|
123 |
echo " --cc=foo Use compiler 'foo' instead of defaults ${CC1} or ${CC2}." |
|
124 |
echo " --arch=foo Use architecture 'foo' instead of trying to autodetect." |
|
125 |
echo " --os=foo Use operative system 'foo' instead of trying to autodetect." |
|
126 |
echo " --prefix=foo Use prefix 'foo' instead of default ${SUB_PREFIX}." |
|
127 |
echo " --target=foo Use 'foo' as build target." |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
128 |
echo " \"generic\" for have independant CAN and TIMERS driver" |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
129 |
echo " \"unix\" for unix-like systems" |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
130 |
echo " \"win32\" for win32 systems" |
0 | 131 |
echo " \"hcs12\" for HCS12 micro-controller" |
132 |
echo " \"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" |
|
27
c16a00df5621
The LinCAN option is listed as accepted one by configure --can option.
ppavel
parents:
24
diff
changeset
|
133 |
echo " --can=foo Use 'foo' as CAN driver (can be either 'peak', 'lincan' or 'virtual')" |
31 | 134 |
echo " --timers=foo Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')" |
15
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
135 |
echo " --led=foo Use 'foo' as DS-305 LED driver (use 'none' to disable or 'stdout')" |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
136 |
echo " --nvram=foo Use 'foo' as NVRAM driver (use 'none' to disable or 'file')" |
0 | 137 |
echo " --disable-Ox Disable gcc \"-Ox\" optimizations." |
138 |
echo " --enable-jaxe Enable \"jaxe\" installation." |
|
139 |
echo " --debug Enable debug messages." |
|
140 |
echo " --debugPDO Enable debug messages, using PDO." |
|
141 |
echo " --enable-lss Enable Auto Baudrate detect Feature" |
|
142 |
echo |
|
143 |
echo "Stack compilation constants" |
|
144 |
echo " --MAX_CAN_BUS_ID [=1] Number of can bus to use" |
|
145 |
echo " --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO" |
|
146 |
echo " --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently" |
|
147 |
echo " --NMT_MAX_NODE_ID [=128] can be reduced to gain memory on small network" |
|
148 |
echo " --SDO_TIMEOUT_MS [=3000] Timeout in milliseconds for SDO (None to disable the feature)" |
|
149 |
exit 0;; |
|
150 |
*) echo "Unknown argument ${1}"; exit -1;; |
|
151 |
esac |
|
152 |
||
153 |
shift |
|
154 |
done |
|
155 |
||
156 |
if [ "$DISABLE_JAXE" = "1" ]; then |
|
157 |
SUB_OPT_JAXE= |
|
158 |
else |
|
159 |
which java >/dev/null 2>&1 |
|
160 |
if (( $? )); then |
|
161 |
SUB_OPT_JAXE= |
|
162 |
echo "Could not find java VM ! Jaxe XML editor disabled !" |
|
163 |
else |
|
164 |
SUB_OPT_JAXE=jaxe |
|
165 |
fi |
|
166 |
fi |
|
167 |
||
168 |
########################################################################### |
|
169 |
# GUESS OS/ARCH # |
|
170 |
########################################################################### |
|
171 |
||
172 |
if [ "$SUB_OS_NAME" = "" ]; then |
|
173 |
SUB_OS_NAME="`(uname -s | sed \"s/\//-/\" | sed \"s/_/-/\" \ |
|
174 |
| sed \"s/-.*//g\") 2>&1`" |
|
175 |
fi |
|
176 |
if [ "$SUB_OS_NAME" = "HP" -o "$SUB_OS_NAME" = "HP-UX" ]; then |
|
177 |
SUB_OS_NAME=HPUX |
|
178 |
fi |
|
179 |
||
180 |
if [ "$SUB_ARCH_NAME" = "" ]; then |
|
181 |
if [ "$CC" = "" ]; then |
|
182 |
A_NAME="`(uname -m) 2>&1`" |
|
183 |
else |
|
184 |
A_NAME="`$CC -dumpmachine | sed 's:-.*::'`" |
|
185 |
fi |
|
186 |
fi |
|
187 |
||
188 |
# x86 |
|
189 |
if [ "$A_NAME" = "i386" ]; then |
|
190 |
SUB_ARCH_NAME=x86 |
|
191 |
fi |
|
192 |
if [ "$A_NAME" = "i486" ]; then |
|
193 |
SUB_ARCH_NAME=x86 |
|
194 |
fi |
|
195 |
if [ "$A_NAME" = "i586" ]; then |
|
196 |
SUB_ARCH_NAME=x86 |
|
197 |
fi |
|
198 |
if [ "$A_NAME" = "i686" ]; then |
|
199 |
SUB_ARCH_NAME=x86 |
|
200 |
fi |
|
201 |
if [ "$A_NAME" = "x86" ]; then |
|
202 |
SUB_ARCH_NAME=x86 |
|
203 |
fi |
|
204 |
||
205 |
# x86_64 |
|
206 |
if [ "$A_NAME" = "x86_64" ]; then |
|
207 |
SUB_ARCH_NAME=x86_64 |
|
208 |
fi |
|
209 |
||
210 |
# ia64 |
|
211 |
if [ "$A_NAME" = "ia64" ]; then |
|
212 |
SUB_ARCH_NAME=ia64 |
|
213 |
fi |
|
214 |
||
215 |
# alpha |
|
216 |
if [ "$A_NAME" = "alpha" ]; then |
|
217 |
SUB_ARCH_NAME=alpha |
|
218 |
fi |
|
219 |
||
220 |
# parisc |
|
221 |
if [ "$A_NAME" = "parisc" ]; then |
|
222 |
SUB_ARCH_NAME=parisc |
|
223 |
fi |
|
224 |
if [ "$SUB_OS_NAME" = "HPUX" -a "$A_NAME" != "ia64" ]; then |
|
225 |
# If we're on HP-UX and the architecture is *not* ia64, |
|
226 |
# it's most likely parisc |
|
227 |
SUB_ARCH_NAME=parisc |
|
228 |
fi |
|
229 |
||
230 |
# sparc |
|
231 |
if [ "$A_NAME" = "sparc" ]; then |
|
232 |
SUB_ARCH_NAME=sparc |
|
233 |
fi |
|
234 |
if [ "$A_NAME" = "sun4u" ]; then |
|
235 |
SUB_ARCH_NAME=sparc |
|
236 |
fi |
|
237 |
||
238 |
# sparc64 |
|
239 |
if [ "$A_NAME" = "sparc64" ]; then |
|
240 |
SUB_ARCH_NAME=sparc64 |
|
241 |
fi |
|
242 |
||
243 |
||
244 |
# |
|
245 |
# The following has not been verified |
|
246 |
# |
|
247 |
||
248 |
# ppc |
|
249 |
if [ "$A_NAME" = "powerpc" ]; then |
|
250 |
SUB_ARCH_NAME=ppc |
|
251 |
fi |
|
252 |
||
253 |
# ppc64 |
|
254 |
if [ "$A_NAME" = "powerpc64" ]; then |
|
255 |
SUB_ARCH_NAME=ppc64 |
|
256 |
fi |
|
257 |
||
258 |
# arm |
|
259 |
if [ "$A_NAME" = "arm" ]; then |
|
260 |
SUB_ARCH_NAME=arm |
|
261 |
fi |
|
262 |
||
263 |
# mips3 |
|
264 |
if [ "$A_NAME" = "ip32" ]; then # IRIX |
|
265 |
SUB_ARCH_NAME=mips3 |
|
266 |
fi |
|
267 |
if [ "$A_NAME" = "ip35" ]; then # IRIX |
|
268 |
SUB_ARCH_NAME=mips3 |
|
269 |
fi |
|
270 |
||
271 |
# mips32 |
|
272 |
if [ "$A_NAME" = "mips32" ]; then |
|
273 |
SUB_ARCH_NAME=mips32 |
|
274 |
fi |
|
275 |
if [ "$A_NAME" = "mips" ]; then |
|
276 |
SUB_ARCH_NAME=mips32 |
|
277 |
fi |
|
278 |
if [ "$A_NAME" = "MIPS" ]; then |
|
279 |
SUB_ARCH_NAME=mips32 |
|
280 |
fi |
|
281 |
if [ "$A_NAME" = "RISC" ]; then # MIPS Ultrix |
|
282 |
SUB_ARCH_NAME=mips32 |
|
283 |
fi |
|
284 |
||
285 |
# mips64 |
|
286 |
if [ "$A_NAME" = "mips64" ]; then |
|
287 |
SUB_ARCH_NAME=mips64 |
|
288 |
fi |
|
289 |
if [ "$A_NAME" = "MIPS64" ]; then |
|
290 |
SUB_ARCH_NAME=mips64 |
|
291 |
fi |
|
292 |
if [ "$A_NAME" = "IP64" ]; then # IRIX |
|
293 |
SUB_ARCH_NAME=mips64 |
|
294 |
fi |
|
295 |
||
296 |
# power |
|
297 |
if [ "$A_NAME" = "power" ]; then # Manual |
|
298 |
SUB_ARCH_NAME=power |
|
299 |
fi |
|
300 |
||
301 |
echo "Using OS: ${SUB_OS_NAME}" |
|
302 |
echo "Using architecture: ${SUB_ARCH_NAME}" |
|
303 |
||
304 |
if [ "$SUB_ARCH_NAME" = "" ]; then |
|
305 |
echo "Error: could not detect what architecture this system is running!" |
|
306 |
echo "Please supply manually instead with \"--arch=foo\"" |
|
307 |
exit -1 |
|
308 |
fi |
|
309 |
||
310 |
if [ "$SUB_OS_NAME" = "HPUX" -a "$CC" = "gcc" ]; then |
|
311 |
# Only if we are on HP-UX, ia64 and using gcc |
|
312 |
SUB_PROG_CFLAGS=-mlp64 |
|
313 |
fi |
|
314 |
||
315 |
if [ "$SUB_OS_NAME" = "SunOS" -a "$SUB_ARCH_NAME" = "sparc" -a "$CC" = "gcc" ]; then |
|
316 |
# Only if we are on SunOS, sparc and using gcc |
|
317 |
# Tells the assembler that we are dealing with a v8plusa arch sparc |
|
318 |
# and -mimpure-text is needed for shared library linking |
|
319 |
SUB_PROG_CFLAGS="-Wa,-xarch=v8plusa -mimpure-text" |
|
320 |
fi |
|
321 |
||
322 |
if [ "$SUB_OS_NAME" = "AIX" -a "$SUB_ARCH_NAME" = "power" -a "$CC" = "gcc" ]; then |
|
323 |
# Only if we are on AIX, power and using gcc |
|
324 |
# The assembler may default to generating Power and PowerPC compatible |
|
325 |
# code. We need to override that. |
|
326 |
SUB_PROG_CFLAGS=-Wa,-mpwr |
|
327 |
fi |
|
328 |
||
329 |
if [ "$SUB_OS_NAME" = "AIX" -a "$SUB_ARCH_NAME" = "ppc" -a "$CC" = "gcc" ]; then |
|
330 |
# Only if we are on AIX, ppc and using gcc |
|
331 |
# The assembler may default to generating Power and PowerPC compatible |
|
332 |
# code. We need to override that. |
|
333 |
SUB_PROG_CFLAGS=-Wa,-mppc |
|
334 |
fi |
|
335 |
||
336 |
if [ "$SUB_ARCH_NAME" = "x86_64" -a "$CC" = "gcc" ]; then |
|
337 |
# Only if we are on x86_64 and using gcc |
|
338 |
# For shared library generation, it needs this |
|
339 |
SUB_PROG_CFLAGS=-fPIC |
|
340 |
fi |
|
341 |
||
342 |
########################################################################### |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
343 |
# DEFAULT TARGET/DRIVERS GUESSING # |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
344 |
########################################################################### |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
345 |
# If target not specified, try to gess one |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
346 |
if [ "$SUB_TARGET" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
347 |
if [ "$SUB_OS_NAME" = "CYGWIN" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
348 |
echo "Choosing win32 target" |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
349 |
SUB_TARGET=win32 |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
350 |
else |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
351 |
echo "Choosing unix target" |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
352 |
SUB_TARGET=unix |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
353 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
354 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
355 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
356 |
# Try to gess can |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
357 |
if [ "$SUB_CAN_DRIVER" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
358 |
if [ "$SUB_TARGET" = "unix" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
359 |
if [ -e /usr/lib/libpcan.so ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
360 |
echo "Choosing installed Peak driver as CAN driver." |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
361 |
SUB_CAN_DRIVER=peak |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
362 |
else |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
363 |
echo "Choosing virtual CAN driver." |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
364 |
SUB_CAN_DRIVER=virtual |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
365 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
366 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
367 |
if [ "$SUB_TARGET" = "win32" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
368 |
echo "CAN driver for windows --Not Implemented--" |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
369 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
370 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
371 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
372 |
if [ "$SUB_TARGET" = "unix" -a "$SUB_LED_DRIVER" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
373 |
echo "Choosing stdout LED driver." |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
374 |
SUB_LED_DRIVER=stdout |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
375 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
376 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
377 |
if [ "$SUB_TARGET" = "unix" -a "$SUB_NVRAM_DRIVER" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
378 |
echo "Choosing binary file NVRAM driver. -- not implemented --" |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
379 |
# SUB_NVRAM_DRIVER=file |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
380 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
381 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
382 |
# If target is unix, default timers also |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
383 |
if [ "$SUB_TARGET" = "unix" -a "$SUB_TIMERS_DRIVER" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
384 |
echo "Choosing unix timers driver." |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
385 |
SUB_TIMERS_DRIVER=unix |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
386 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
387 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
388 |
# Warn for unstalled peak driver if choosen |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
389 |
if [ "$SUB_CAN_DRIVER" = "peak" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
390 |
if [ ! -e /usr/lib/libpcan.so ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
391 |
echo "Peak driver hasn't been installed !" |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
392 |
exit -1 |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
393 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
394 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
395 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
396 |
########################################################################### |
0 | 397 |
# TARGET/DRIVER SPECIFIC CFLAGS and OPTIONS # |
398 |
########################################################################### |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
399 |
if [ "$SUB_TARGET" = "generic" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
400 |
if [ "$US_TO_TIMEVAL_FACTOR" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
401 |
US_TO_TIMEVAL_FACTOR=1 |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
402 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
403 |
if [ "$TIMEVAL" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
404 |
TIMEVAL=UNS64 |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
405 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
406 |
if [ "$TIMEVAL_MAX" = "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
407 |
TIMEVAL_MAX=0xffffffffffffffff |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
408 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
409 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
410 |
|
0 | 411 |
if [ "$SUB_TARGET" = "hcs12" ]; then |
412 |
# Only if we want to compile for a µC HCS12 |
|
413 |
# search for gcc hcs12 compiler m6811-elf-gcc or m68hc12-gcc ? |
|
414 |
if [ "$CC" = "" ]; then |
|
415 |
which m6811-elf-gcc >/dev/null 2>&1 |
|
416 |
if (( $? )); then |
|
417 |
which m68hc12-gcc >/dev/null 2>&1 |
|
418 |
if (( $? )); then |
|
419 |
echo "Please use --cc flag to specify compiler" |
|
420 |
exit 0 |
|
421 |
else |
|
422 |
CC=m68hc12-gcc |
|
423 |
fi |
|
424 |
else |
|
425 |
CC=m6811-elf-gcc |
|
426 |
SUB_PROG_CFLAGS=-m68hc12 |
|
427 |
fi |
|
428 |
fi |
|
429 |
fi |
|
430 |
||
431 |
if [ "$SUB_TARGET" = "ecos_lpc2138_sja1000" ]; then |
|
432 |
# search for gcc arm compiler arm-elf-gcc or arm-elf-gcc ? |
|
433 |
if [ "$CC" = "" ]; then |
|
434 |
which arm-elf-gcc >/dev/null 2>&1 |
|
435 |
if (( $? )); then |
|
436 |
echo "error : Could not find arm-elf-gcc" |
|
437 |
else |
|
438 |
CC=arm-elf-gcc |
|
439 |
SUB_PROG_CFLAGS="-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Os \ |
|
440 |
-ffunction-sections -fdata-sections -fno-exceptions -finline-functions" |
|
441 |
fi |
|
442 |
fi |
|
443 |
# ecos sja1000 driver implements calls needed by LSS. |
|
444 |
SUB_LSS_ENABLE=YES |
|
445 |
SUB_LED_ENABLE=YES |
|
446 |
SUB_NVRAM_ENABLE=YES |
|
447 |
fi |
|
448 |
||
449 |
||
450 |
#### CAN_DRIVER #### |
|
451 |
||
452 |
if [ "$SUB_CAN_DRIVER" = "peak" ]; then |
|
31 | 453 |
if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then |
454 |
SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lrtdm |
|
455 |
fi |
|
0 | 456 |
SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpcan |
457 |
fi |
|
458 |
||
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
459 |
if [ "$SUB_CAN_DRIVER" = "none" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
460 |
SUB_CAN_DRIVER= |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
461 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
462 |
|
0 | 463 |
#### TIMERS_DRIVER #### |
464 |
||
465 |
if [ "$SUB_TIMERS_DRIVER" = "unix" ]; then |
|
466 |
SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpthread |
|
467 |
fi |
|
468 |
||
469 |
if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then |
|
470 |
SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lnative\ |
|
471 |
\ -L`$XENO_CONFIG --library-dir` |
|
472 |
SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ `$XENO_CONFIG --xeno-cflags` |
|
473 |
fi |
|
474 |
||
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
475 |
if [ "$SUB_TIMERS_DRIVER" = "none" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
476 |
SUB_TIMERS_DRIVER= |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
477 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
478 |
|
15
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
479 |
#### LED_DRIVER #### |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
480 |
#enable led support if a led driver have been selected. |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
481 |
if [ "$SUB_LED_DRIVER" != "" ]; then |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
482 |
SUB_LED_ENABLE=YES |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
483 |
fi |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
484 |
#if "none" driver is selected led feature is enabled but driver not compiled |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
485 |
if [ "$SUB_LED_DRIVER" = "none" ]; then |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
486 |
SUB_LED_DRIVER= |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
487 |
fi |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
488 |
#if "disable" driver is selected led feature is disabled |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
489 |
if [ "$SUB_LED_DRIVER" = "disable" ]; then |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
490 |
SUB_LED_ENABLE= |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
491 |
SUB_LED_DRIVER= |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
492 |
fi |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
493 |
|
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
494 |
#### NVRAM_DRIVER #### |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
495 |
#enable nvram support if a nvram driver have been selected. |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
496 |
if [ "$SUB_NVRAM_DRIVER" != "" ]; then |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
497 |
SUB_NVRAM_ENABLE=YES |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
498 |
fi |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
499 |
#if "none" driver is selected nvram feature is enabled but driver not compiled |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
500 |
if [ "$SUB_NVRAM_DRIVER" = "none" ]; then |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
501 |
SUB_NVRAM_DRIVER= |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
502 |
fi |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
503 |
#if "disable" driver is selected nvram feature is disabled |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
504 |
if [ "$SUB_NVRAM_DRIVER" = "disable" ]; then |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
505 |
SUB_NVRAM_ENABLE= |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
506 |
SUB_NVRAM_DRIVER= |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
507 |
fi |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
508 |
|
0 | 509 |
########################################################################### |
510 |
# GUESS COMPILER # |
|
511 |
########################################################################### |
|
512 |
# If CC is empty, the user wanted automatic detection |
|
513 |
if [ "$CC" = "" ]; then |
|
514 |
# Check for second compiler, CC2 |
|
515 |
cat > $test.c <<EOF |
|
516 |
int main() { return 0; } |
|
517 |
EOF |
|
518 |
if test "`($CC2 -c $CFLAGS $test.c) 2>&1`" = ""; then |
|
519 |
DETECTCC=$CC2 |
|
520 |
echo "Checking for ${CC2}... Yes." |
|
521 |
else |
|
522 |
echo "Checking for ${CC2}... No." |
|
523 |
fi |
|
524 |
rm -f $test.c $test.o |
|
525 |
||
526 |
# Check for first compiler, CC1 |
|
527 |
cat > $test.c <<EOF |
|
528 |
int main() { return 0; } |
|
529 |
EOF |
|
530 |
if test "`($CC1 -c $CFLAGS $test.c) 2>&1`" = ""; then |
|
531 |
DETECTCC=$CC1 |
|
532 |
echo "Checking for ${CC1}... Yes." |
|
533 |
else |
|
534 |
echo "Checking for ${CC1}... No." |
|
535 |
fi |
|
536 |
rm -f $test.c $test.o |
|
537 |
CC=$DETECTCC |
|
538 |
fi |
|
539 |
# Check if we decided on a compiler after all |
|
540 |
if [ "$CC" = "" ]; then |
|
541 |
echo "Error: Could not find a C compiler" |
|
542 |
echo "Please supply the wanted compiler" |
|
543 |
exit -1 |
|
544 |
fi |
|
545 |
||
546 |
echo "Using ${CC}" |
|
547 |
||
548 |
########################################################################### |
|
549 |
# GUESS PREFIX's # |
|
550 |
########################################################################### |
|
551 |
||
552 |
SUB_BINUTILS_PREFIX=`echo "$CC" | sed 's/gcc$//'` |
|
553 |
||
554 |
# Guess prefix as regard cross compiling target machine |
|
555 |
if [ "$SUB_PREFIX" = "" ]; then |
|
556 |
$CC -dumpspecs |grep -A 1 'cross_compile'|grep -q 1 |
|
557 |
if (( $? )); then |
|
558 |
SUB_PREFIX=/usr/local |
|
559 |
echo "Not cross-compiling. Will install in $SUB_PREFIX"; |
|
560 |
else |
|
561 |
SUB_PREFIX=/usr/`$CC -dumpmachine` |
|
562 |
echo "This is a cross-compiler. Will install in $SUB_PREFIX"; |
|
563 |
fi |
|
564 |
fi |
|
565 |
||
566 |
echo "Using prefix: ${SUB_PREFIX}" |
|
567 |
||
568 |
########################################################################### |
|
569 |
# CANFESTIVAL DEFINES --> config.h # |
|
570 |
########################################################################### |
|
571 |
# Some CONSTANTS preparation |
|
572 |
if [ "$CANOPEN_BIG_ENDIAN" = "" ]; then |
|
573 |
CANOPEN_LITTLE_ENDIAN=1 |
|
574 |
else |
|
575 |
CANOPEN_LITTLE_ENDIAN= |
|
576 |
fi |
|
577 |
||
578 |
# Create include/config.h with the relevant contents |
|
579 |
rm -f include/config.h |
|
580 |
echo "/*"\ > include/config.h |
|
581 |
echo "This file is part of CanFestival, a library implementing CanOpen Stack." >> include/config.h |
|
582 |
echo "" >> include/config.h |
|
583 |
echo "Copyright (C): Edouard TISSERANT and Francis DUPIN" >> include/config.h |
|
584 |
echo "See COPYING file for copyrights details." >> include/config.h |
|
585 |
echo "" >> include/config.h |
|
586 |
echo "This library is free software; you can redistribute it and/or" >> include/config.h |
|
587 |
echo "modify it under the terms of the GNU Lesser General Public" >> include/config.h |
|
588 |
echo "License as published by the Free Software Foundation; either" >> include/config.h |
|
589 |
echo "version 2.1 of the License, or (at your option) any later version." >> include/config.h |
|
590 |
echo "" >> include/config.h |
|
591 |
echo "This library is distributed in the hope that it will be useful," >> include/config.h |
|
592 |
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of" >> include/config.h |
|
593 |
echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU" >> include/config.h |
|
594 |
echo "Lesser General Public License for more details." >> include/config.h |
|
595 |
echo "" >> include/config.h |
|
596 |
echo "You should have received a copy of the GNU Lesser General Public" >> include/config.h |
|
597 |
echo "License along with this library; if not, write to the Free Software" >> include/config.h |
|
598 |
echo "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" >> include/config.h |
|
599 |
echo "*/" >> include/config.h |
|
600 |
echo "" >> include/config.h |
|
601 |
echo "#ifndef _CONFIG_H_" >> include/config.h |
|
602 |
echo "#define _CONFIG_H_" >> include/config.h |
|
603 |
echo "" >> include/config.h |
|
604 |
for i in \ |
|
605 |
MAX_CAN_BUS_ID\ |
|
606 |
SDO_MAX_LENGTH_TRANSFERT\ |
|
607 |
SDO_MAX_SIMULTANEOUS_TRANSFERTS\ |
|
608 |
NMT_MAX_NODE_ID\ |
|
609 |
SDO_TIMEOUT_MS\ |
|
610 |
MAX_NB_TIMER\ |
|
611 |
CANOPEN_BIG_ENDIAN\ |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
612 |
CANOPEN_LITTLE_ENDIAN\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
613 |
US_TO_TIMEVAL_FACTOR\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
614 |
TIMEVAL\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
615 |
TIMEVAL_MAX; do |
0 | 616 |
if [ "${!i}" = "" ]; then |
617 |
echo "// $i is not defined" >> include/config.h |
|
618 |
else |
|
619 |
echo "#define $i ${!i}" >> include/config.h |
|
620 |
fi |
|
621 |
done |
|
622 |
echo "" >> include/config.h |
|
623 |
echo "#endif /* _CONFIG_H_ */" >> include/config.h |
|
624 |
||
625 |
########################################################################### |
|
626 |
# DEBUG DEFINES/CFLAGS # |
|
627 |
########################################################################### |
|
628 |
if [ "$DEBUG" != "" ]; then |
|
629 |
SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DDEBUG_CAN\ -DDEBUG_WAR_CONSOLE_ON\ -DDEBUG_ERR_CONSOLE_ON\ -g |
|
630 |
fi |
|
631 |
||
632 |
if [ "$DEBUG" = "PDO" ]; then |
|
633 |
SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DPDO_ERROR |
|
634 |
fi |
|
635 |
||
636 |
if [ "$DISABLE_OPT" = "1" ]; then |
|
637 |
SUB_OPT_CFLAGS= |
|
638 |
else |
|
639 |
SUB_OPT_CFLAGS=\$\(OPT_CFLAGS\) |
|
640 |
fi |
|
641 |
||
642 |
########################################################################### |
|
643 |
# CREATE MAKEFILES # |
|
644 |
########################################################################### |
|
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
645 |
# General Makefiles |
0 | 646 |
MAKEFILES=Makefile.in\ |
647 |
\ src/Makefile.in\ |
|
648 |
\ drivers/Makefile.in\ |
|
649 |
\ objdictgen/Makefile.in\ |
|
650 |
\ examples/Makefile.in |
|
651 |
||
24
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
652 |
# Drivers dependent Makefiles |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
653 |
if [ "$SUB_TIMERS_DRIVER" != "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
654 |
MAKEFILES=$MAKEFILES\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
655 |
\ drivers/timers_$SUB_TIMERS_DRIVER/Makefile.in |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
656 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
657 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
658 |
if [ "$SUB_CAN_DRIVER" != "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
659 |
MAKEFILES=$MAKEFILES\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
660 |
\ drivers/can_$SUB_CAN_DRIVER/Makefile.in |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
661 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
662 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
663 |
if [ "$SUB_LED_DRIVER" != "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
664 |
MAKEFILES=$MAKEFILES\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
665 |
\ drivers/led_$SUB_LED_DRIVER/Makefile.in |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
666 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
667 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
668 |
if [ "$SUB_NVRAM_DRIVER" != "" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
669 |
MAKEFILES=$MAKEFILES\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
670 |
\ drivers/nvram_$SUB_NVRAM_DRIVER/Makefile.in |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
671 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
672 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
673 |
# Target dependent Makefiles |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
674 |
MAKEFILES=$MAKEFILES\ drivers/$SUB_TARGET/Makefile.in |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
675 |
|
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
676 |
if [ "$SUB_TARGET" = "unix" ]; then |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
677 |
MAKEFILES=$MAKEFILES\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
678 |
\ examples/AppliMaster_Linux/Makefile.in\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
679 |
\ examples/AppliSlave_Linux/Makefile.in\ |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
680 |
\ examples/TestMasterSlave/Makefile.in |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
681 |
fi |
a9543d2ccd56
Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
15
diff
changeset
|
682 |
|
0 | 683 |
if [ "$SUB_TARGET" = "hcs12" ]; then |
684 |
MAKEFILES=$MAKEFILES\ |
|
685 |
\ examples/AppliMaster_HCS12/Makefile.in\ |
|
686 |
\ examples/AppliSlave_HCS12/Makefile.in\ |
|
687 |
\ examples/gene_SYNC_HCS12/Makefile.in |
|
688 |
fi |
|
689 |
||
690 |
if [ "$SUB_TARGET" = "ecos_lpc2138_sja1000" ]; then |
|
691 |
MAKEFILES=$MAKEFILES\ |
|
692 |
\ examples/ecos_lpc2138_sja1000/src/Makefile.in |
|
693 |
fi |
|
694 |
||
695 |
for makefile_in in $MAKEFILES; do |
|
696 |
makefile=`echo $makefile_in | sed 's:.in$::'` |
|
697 |
echo "Creating $makefile" |
|
698 |
sed < $makefile_in " |
|
699 |
s:SUB_CC:${CC}: |
|
700 |
s:SUB_PROG_CFLAGS:${SUB_PROG_CFLAGS}: |
|
701 |
s:SUB_EXE_CFLAGS:${SUB_EXE_CFLAGS}: |
|
702 |
s:SUB_PREFIX:${SUB_PREFIX}: |
|
703 |
s:SUB_OS_NAME:${SUB_OS_NAME}: |
|
704 |
s:SUB_ARCH_NAME:${SUB_ARCH_NAME}: |
|
705 |
s:SUB_OPT_CFLAGS:${SUB_OPT_CFLAGS}: |
|
706 |
s:SUB_TARGET:${SUB_TARGET}: |
|
707 |
s:SUB_BINUTILS_PREFIX:${SUB_BINUTILS_PREFIX}: |
|
708 |
s:SUB_OPT_JAXE:${SUB_OPT_JAXE}: |
|
709 |
s:SUB_LSS_ENABLE:${SUB_LSS_ENABLE}: |
|
710 |
s:SUB_LED_ENABLE:${SUB_LED_ENABLE}: |
|
711 |
s:SUB_NVRAM_ENABLE:${SUB_NVRAM_ENABLE}: |
|
712 |
s:SUB_TIMERS_ENABLE:${SUB_TIMERS_ENABLE}: |
|
713 |
s:SUB_TIMERS_DRIVER:timers_${SUB_TIMERS_DRIVER}: |
|
714 |
s:SUB_CAN_DRIVER:can_${SUB_CAN_DRIVER}: |
|
15
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
715 |
s:SUB_LED_DRIVER:led_${SUB_LED_DRIVER}: |
e930a0e817de
Re-orginized led and nvram related code, for generic target.
etisserant
parents:
0
diff
changeset
|
716 |
s:SUB_NVRAM_DRIVER:nvram_${SUB_NVRAM_DRIVER}: |
0 | 717 |
" > $makefile |
718 |
done |
|
719 |
||
720 |
echo "All done." |