-
Notifications
You must be signed in to change notification settings - Fork 13
/
configure.ac
760 lines (667 loc) · 23.4 KB
/
configure.ac
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
dnl -*-m4-*-
dnl Process this file with autoconf to produce a configure script.
dnl --------------------------------------------------------------
dnl configure.ac for Worldsens architecture simulator
dnl works only for automake 1.10 and above
dnl lower versions will have problem with bzero prototype replacement
dnl --------------------------------------------------------------
AC_INIT([wsim],[0.99])
AC_CONFIG_SRCDIR(src/main.c)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(foreign) dnl foreign = NEWS/TODO not required
AC_CONFIG_HEADERS([config.h])
dnl --------------------------------------------------------------
dnl Checks for programs.
dnl --------------------------------------------------------------
AC_PROG_INSTALL
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl --------------------------------------------------------------
dnl Install directories
dnl --------------------------------------------------------------
EXTRAOBJS=""
EXTRALIBS="-lm -lz"
dnl --------------------------------------------------------------
dnl Checks for compilation flags
dnl --------------------------------------------------------------
CFLAGS_save="${CFLAGS}"
AC_CACHE_CHECK([if \$CC accepts -Wall],
[ac_cv_c_Wall],
[CFLAGS="-Wall ${CFLAGS_save}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_Wall=yes],[ac_cv_c_Wall=no])])
CFLAGS="${CFLAGS_save}"
if test "${ac_cv_c_Wall}" != "no"; then
CFLAGS="-Wall ${CFLAGS}"
fi
dnl -pipe
dnl =====
CFLAGS_save="${CFLAGS}"
AC_CACHE_CHECK([if \$CC accepts -pipe],
[ac_cv_c_pipe],
[CFLAGS="-pipe ${CFLAGS_save}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_pipe=yes],[ac_cv_c_pipe=no])])
CFLAGS="${CFLAGS_save}"
if test "${ac_cv_c_pipe}" != "no"; then
CFLAGS="-pipe ${CFLAGS}"
fi
dnl -flto
dnl =====
CFLAGS_save="${CFLAGS}"
AC_CACHE_CHECK([if \$CC accepts -flto],
[ac_cv_c_flto],
[CFLAGS="-flto ${CFLAGS_save}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_c_flto=yes],[ac_cv_c_flto=no])])
CFLAGS="${CFLAGS_save}"
CFLAGSLTO=""
if test "${ac_cv_c_flto}" != "no"; then
CFLAGSLTO="-flto "
fi
dnl Indent option : enable code indentation
dnl ============
# The indent target require GNU indent
AC_PATH_PROG([INDENT], [indent])
AC_PATH_PROG([GINDENT], [gindent])
if test x"$GINDENT" != x""; then
INDENT="$GINDENT"
fi
AC_SUBST(INDENT)
AM_CONDITIONAL(HAS_INDENT, [test x"$INDENT" != x""])
dnl Debug mode : enable debug code for wsim internals
dnl ============
CFLAGS_save="${CFLAGS}"
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[wsim debug mode (default enabled)]))
if test "${enable_debug}" != "no"; then
CFLAGS="$CFLAGS -g"
AC_DEFINE([DEBUG],[1],[WSim internals debug tools])
debug_sum="yes"
else
debug_sum="no"
fi
AM_CONDITIONAL([BUILD_DEBUG], [test "${debug_sum}" = "yes"])
dnl LTO mode :
dnl ==========
CFLAGS_save="${CFLAGS}"
AC_ARG_ENABLE([lto],AS_HELP_STRING([--enable-lto],[gcc lto mode (default disabled)]))
if test "${enable_lto}" = "yes"; then
CFLAGS="$CFLAGS $CFLAGSLTO"
lto_sum="yes"
else
lto_sum="no"
fi
dnl Cross Debug mode : enable debug code for wsim target code
dnl ==================
CFLAGS_save="${CFLAGS}"
AC_ARG_ENABLE([xdebug],AS_HELP_STRING([--enable-xdebug],[target code debug (default enabled)]))
if test "${enable_xdebug}" != "no"; then
xdebug_sum="yes"
AC_DEFINE([XCODE_DEBUG], [1],[WSim target code debug tools ])
AC_DEFINE([ENABLE_RAM_CONTROL],[1],[WSim target ram access control])
else
xdebug_sum="no"
fi
AM_CONDITIONAL([BUILD_XCODE_DEBUG], [test "${xdebug_sum}" != "no"])
dnl eTrace mode
dnl ===========
CFLAGS_save="${CFLAGS}"
AC_ARG_ENABLE([etrace],AS_HELP_STRING([--enable-etrace],[etrace mode (default disabled)]))
if test "${enable_etrace}" = "yes"; then
AC_CHECK_LIB(z, compress)
AC_DEFINE([ETRACE],[1],[eSimu energy tracer])
etrace_sum="yes"
else
etrace_sum="no"
fi
AM_CONDITIONAL([BUILD_ETRACE], [test "${etrace_sum}" = "yes"])
AC_ARG_WITH([etracelib-prefix], AS_HELP_STRING([--with-etracelib-prefix=DIR],[etracelib path]),
[CFLAGS="-I$withval $CFLAGS"
LDFLAGS="-L$withval $LDFLAGS"
EXTRAOBJS="$withval/libetrace.a $EXTRAOBJS"
etracelib_prefix=$withval],
[etracelib_prefix=""])
zlib_sum="system"
AC_ARG_WITH([zlib-prefix], AS_HELP_STRING([--with-zlib-prefix=DIR],[zlib path]),
[CFLAGS="-I$withval/include $CFLAGS"
LDFLAGS="-L$withval/lib $LDFLAGS"
zlib_sum="yes"
zlib_prefix=$withval],
[zlib_prefix=""])
dnl UI mode
dnl ===========
gui_type="none"
AC_ARG_ENABLE([gui],AS_HELP_STRING([--enable-gui],[GUI (default enabled)]))
if test "${enable_gui}" != "no" ; then
gui_sum="yes"
AC_DEFINE([GUI],[1],[Defines wether a GUI is available])
else
gui_sum="no"
fi
AM_CONDITIONAL([BUILD_GUI], [test "${gui_sum}" = "yes"])
dnl dnl SDL ui mode
dnl dnl ===========
dnl AC_ARG_ENABLE([sdl],AS_HELP_STRING([--enable-sdl],[SDL GUI for devices (default disabled)]))
dnl if test "${enable_sdl}" = "yes" ; then
dnl gui_type="SDL"
dnl AC_DEFINE([GUI_SDL],[1],[Defines wether a SDL GUI is available])
dnl fi
AM_CONDITIONAL([BUILD_GUI_SDL], [test "${gui_type}" = "SDL_is_deprecated"])
dnl Gprof mode
dnl ==========
dnl profile_sum="no"
dnl AC_ARG_ENABLE([profile],AS_HELP_STRING([--enable-profile],[profile mode (default disabled)]))
dnl if test "${enable_profile}" = "yes"; then
dnl CFLAGS="$CFLAGS -g -pg -DPROFILE"
dnl LDFLAGS="$LDFLAGS -pg"
dnl profile_sum="yes"
dnl else
dnl profile_sum="no"
dnl fi
dnl Tracer enable
dnl =============
dnl AC_ARG_ENABLE([tracer],AS_HELP_STRING([--enable-tracer],[Event tracer (default enabled)]))
dnl if test "${enable_tracer}" != "no" ; then
dnl tracer_sum="yes"
dnl else
dnl tracer_sum="no"
dnl fi
dnl AM_CONDITIONAL([BUILD_TRACER], [test "${tracer_sum}" = "yes"])
dnl --------------------------------------------------------------
dnl Devices flags
dnl --------------------------------------------------------------
dnl ptty enable
dnl ===========
AC_ARG_ENABLE([ptty],AS_HELP_STRING([--enable-ptty],[Pseudo TTY IO device (default enabled)]))
if test "${enable_ptty}" != "no" ; then
ptty_sum="yes"
AC_DEFINE([PTTY],[1],[Defines wether libptty is used on the corrent configuration])
else
ptty_sum="no"
fi
AM_CONDITIONAL([BUILD_PTTY], [test "${ptty_sum}" = "yes"])
dnl --------------------------------------------------------------
dnl Platform models
dnl --------------------------------------------------------------
NPLATFORM=0
PLATFORMNAMES=""
dnl wsn430
AC_ARG_ENABLE([platform-wsn430],AS_HELP_STRING([--enable-platform-wsn430],[wsn430 platform]))
if test "${enable_platform_wsn430}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="wsn430"
fi
dnl senslab
AC_ARG_ENABLE([platform-senslab],AS_HELP_STRING([--enable-platform-senslab],[senslab platforms]))
if test "${enable_platform_senslab}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="senslab"
fi
dnl OT setre 1
AC_ARG_ENABLE([platform-ot2006],AS_HELP_STRING([--enable-platform-ot2006],[OT 2006 platform]))
if test "${enable_platform_ot2006}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="ot2006 $PLATFORMNAMES"
fi
dnl OT setre 2007
AC_ARG_ENABLE([platform-otsetre],AS_HELP_STRING([--enable-platform-otsetre],[OT 2007 platform]))
if test "${enable_platform_otsetre}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="otsetre $PLATFORMNAMES"
fi
dnl ez430
AC_ARG_ENABLE([platform-ez430],AS_HELP_STRING([--enable-platform-ez430],[TI-ez430 platform]))
if test "${enable_platform_ez430}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="ez430 $PLATFORMNAMES"
fi
dnl ez430-rf2500
AC_ARG_ENABLE([platform-ez430rf],AS_HELP_STRING([--enable-platform-ez430rf],[ez430rf2500 platforms]))
if test "${enable_platform_ez430rf}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="ez430rf"
fi
dnl mosar
AC_ARG_ENABLE([platform-mosar],AS_HELP_STRING([--enable-platform-mosar],[mosar platforms]))
if test "${enable_platform_mosar}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="mosar"
fi
dnl mcugen
AC_ARG_ENABLE([platform-mcugen],AS_HELP_STRING([--enable-platform-mcugen],[mcugen platform]))
if test "${enable_platform_mcugen}" = "yes" ; then
enable_mcu_mcugen=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="mcugen $PLATFORMNAMES"
fi
dnl Test
AC_ARG_ENABLE([platform-tests],AS_HELP_STRING([--enable-platform-tests],[test platform]))
if test "${enable_platform_tests}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="tests $PLATFORMNAMES"
fi
dnl Telosb
AC_ARG_ENABLE([platform-telosb],AS_HELP_STRING([--enable-platform-telosb],[telosb platform]))
if test "${enable_platform_telosb}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="telosb $PLATFORMNAMES"
fi
dnl WASP project
AC_ARG_ENABLE([platform-wasp],AS_HELP_STRING([--enable-platform-wasp],[wasp platforms]))
if test "${enable_platform_wasp}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="wasp $PLATFORMNAMES"
fi
dnl CSEM WiseNodes
AC_ARG_ENABLE([platform-wisenode],AS_HELP_STRING([--enable-platform-wisenode],[wisenode platform]))
if test "${enable_platform_wisenode}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="wisenode $PLATFORMNAMES"
fi
dnl ICL BSN
AC_ARG_ENABLE([platform-iclbsn],AS_HELP_STRING([--enable-platform-iclbsn],[ICL BSN platform]))
if test "${enable_platform_iclbsn}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="iclbsn $PLATFORMNAMES"
fi
dnl Mica2
AC_ARG_ENABLE([platform-mica2],AS_HELP_STRING([--enable-platform-mica2],[mica2 platform]))
if test "${enable_platform_mica2}" = "yes" ; then
enable_mcu_atmega=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="mica2 $PLATFORMNAMES"
fi
dnl MicaZ
AC_ARG_ENABLE([platform-micaz],AS_HELP_STRING([--enable-platform-micaz],[micaz platform]))
if test "${enable_platform_micaz}" = "yes" ; then
enable_mcu_atmega=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="micaz $PLATFORMNAMES"
fi
dnl Powwow
AC_ARG_ENABLE([platform-powwow],AS_HELP_STRING([--enable-platform-powwow],[Powwow platform]))
if test "${enable_platform_powwow}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="micaz $PLATFORMNAMES"
fi
dnl ez430chronos
AC_ARG_ENABLE([platform-ez430chronos],AS_HELP_STRING([--enable-platform-ez430chronos],[TI-ez430 chronos platform]))
if test "${enable_platform_ez430chronos}" = "yes" ; then
enable_mcu_msp430=yes
NPLATFORM=$(($NPLATFORM + 1))
PLATFORMNAMES="ez430chronos $PLATFORMNAMES"
fi
dnl All
ALL="no"
AC_ARG_ENABLE([platform-all],AS_HELP_STRING([--enable-platform-all],[all platforms]))
if test "${enable_platform_all}" = "yes" ; then
ALL="yes"
NPLATFORM=1
PLATFORMNAMES="all $PLATFORMNAMES"
fi
dnl Default is to build all platforms
if test $NPLATFORM -eq 0 ; then
ALL="yes"
PLATFORMNAMES="all"
NPLATFORM=1
fi
AM_CONDITIONAL([BUILD_WSN430], [test "${enable_platform_wsn430}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_SENSLAB], [test "${enable_platform_senslab}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_OT2006], [test "${enable_platform_ot2006}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_OTSETRE], [test "${enable_platform_otsetre}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_EZ430], [test "${enable_platform_ez430}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_TESTS], [test "${enable_platform_tests}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_TELOSB], [test "${enable_platform_telosb}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_WASP], [test "${enable_platform_wasp}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_WISENODE], [test "${enable_platform_wisenode}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_ICLBSN], [test "${enable_platform_iclbsn}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_EZ430RF], [test "${enable_platform_ez430rf}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_MCUGENP], [test "${enable_platform_mcugenp}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_MOSAR], [test "${enable_platform_mosar}" = "yes"])
AM_CONDITIONAL([BUILD_MICA2], [test "${enable_platform_mica2}" = "yes" -o "$ALL" = "yes"])
AM_CONDITIONAL([BUILD_MICAZ], [test "${enable_platform_micaz}" = "yes" -o "$ALL" = "yes"])
AM_CONDITIONAL([BUILD_POWWOW], [test "${enable_platform_powwow}" = "yes" -o "$ALL" = "yes"])
AM_CONDITIONAL([BUILD_EZ430CHRONOS], [test "${enable_platform_ez430chronos}" = "yes" -o "$ALL" = "yes"])
AM_CONDITIONAL([BUILD_MSP430], [test "${enable_mcu_msp430}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_ATMEGA], [test "${enable_mcu_atmega}" = "yes" -o "$ALL" = "yes" ])
AM_CONDITIONAL([BUILD_MCUGEN], [test "${enable_mcu_mcugen}" = "yes" -o "$ALL" = "yes" ])
dnl --------------------------------------------------------------
dnl Checks for header files.
dnl --------------------------------------------------------------
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h)
dnl --------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl --------------------------------------------------------------
AC_C_CONST
AC_TYPE_SIZE_T
AC_C_BIGENDIAN
AC_C_INLINE
dnl AC_CHECK_SIZEOF(char, 1)
dnl AC_CHECK_SIZEOF(short, 2)
dnl AC_CHECK_SIZEOF(int *, 4)
dnl AC_CHECK_SIZEOF(int, 4)
dnl AC_CHECK_SIZEOF(long, 4)
dnl AC_CHECK_SIZEOF(long long, 8)
dnl --------------------------------------------------------------
dnl Checks for library functions.
dnl --------------------------------------------------------------
AC_FUNC_MEMCMP
dnl sys/resources.h
AC_CHECK_FUNC(getrusage)
if test "$ac_cv_func_getrusage" = yes; then
AC_DEFINE(FUNC_GETRUSAGE_DEFINED, [1], [Check if getrusage() is available])
fi
dnl string.h
AC_CHECK_FUNC(bzero)
if test "$ac_cv_func_bzero" = yes; then
AC_DEFINE(FUNC_BZERO_DEFINED, [1], [Check if bzero(3) is available])
else
AC_DEFINE([bzero(s,n)],[memset(s,0,n)], [Macro replacement])
fi
AC_CHECK_FUNC(memset)
if test "$ac_cv_func_memset" = yes; then
AC_DEFINE(FUNC_MEMSET_DEFINED, [1], [Check if memset(3) is available])
fi
AC_CHECK_FUNC(strsignal)
if test "$ac_cv_func_strsignal" = yes; then
AC_DEFINE(FUNC_STRSIGNAL_DEFINED, [1], [Check if strsignal() is available])
fi
AC_CHECK_FUNC(strcasestr)
if test "$ac_cv_func_strcasestr" = yes; then
AC_DEFINE(FUNC_STRCASESTR_DEFINED, [1], [Check if strcasestr() is available])
fi
AC_CHECK_FUNC(strtok_r)
if test "$ac_cv_func_strtok_r" = yes; then
AC_DEFINE(FUNC_STRTOK_R_DEFINED, [1], [Check if strtok_r() is available])
fi
dnl AC_CHECK_FUNC(nothl)
dnl if test "$ac_cv_func_ntohl" = yes; then
dnl AC_DEFINE(FUNC_NTOHL_DEFINED, [1], [Check if ntohl() is available])
dnl fi
dnl --------------------------------------------------------------
dnl Checks for binutils (bfd) for msp430
dnl --------------------------------------------------------------
dnl should change to remove bfd option
bfd_sum="no"
AC_ARG_WITH([bfd],
AS_HELP_STRING([--with-bfd],[msp430 GNU binutils]),
[bfd_sum="yes"],
[])
AC_ARG_WITH([bfd-prefix],
AS_HELP_STRING([--with-bfd-prefix=DIR],[msp430 GNU binutils path]),
[CFLAGS="-I$withval/include $CFLAGS" LDFLAGS="-L$withval/lib $LDFLAGS" bfd_sum="yes" bfd_prefix=$withval],
[bfd_prefix=""])
if test "${bfd_sum}" = "yes" ; then
AC_DEFINE([WSIM_USES_GNU_BFD],[1],[GNU BFD library (GPL)])
EXTRALIBS="-lbfd -liberty $EXTRALIBS"
if test "${bfd_prefix}" = "" ; then
AC_MSG_NOTICE([== ---------------------------------------------------------------- ==])
AC_MSG_NOTICE([== System configured with default libbfd, ==])
AC_MSG_NOTICE([== please make sure that your installation supports MSP430 binaries ==])
AC_MSG_NOTICE([== ---------------------------------------------------------------- ==])
fi
fi
AM_CONDITIONAL([BUILD_GNUBFD],[test "${bfd_sum}" = "yes"])
elf_sum=""
if test "${bfd_sum}" = "yes" ; then
elf_sum="GNU BFD"
else
elf_sum="internal"
fi
dnl --------------------------------------------------------------
dnl Host specific workarounds
dnl --------------------------------------------------------------
HOSTTYPE="none"
NEEDLARGEFILES="no"
case "${host}" in
*-*-linux* )
# linux
# i686-*-linux-* )
# i686-pc-linux-gnu )
# x86_64-*-linux-* )
# x86_64-unknown-linux-gnu
# i686-suse-linux )
HOSTTYPE="Linux"
CFLAGS="$CFLAGS -DLINUX"
NEEDLARGEFILES="yes"
EXTRALIBS="$EXTRALIBS"
# backup GUI for unix machines
if test "${gui_sum}" = "yes" -a "${gui_type}" = "none" ; then
gui_type="X11"
fi
;;
*-*-solaris* )
# cimirly sparc-sun-solaris2.9
# clash sparc-sun-solaris2.10
HOSTTYPE="Solaris"
CFLAGS="$CFLAGS -DSOLARIS"
EXTRALIBS="$EXTRALIBS -lsocket -lnsl"
# backup GUI for unix machines
if test "${gui_sum}" = "yes" -a "${gui_type}" = "none" ; then
gui_type="X11"
fi
;;
*-*-cygwin )
# xp i686-pc-cygwin
HOSTTYPE="Cygwin"
NEEDLARGEFILES="yes"
if test "${gui_sum}" = "yes" -a "${gui_type}" = "none" ; then
gui_type="WIN"
# the contradictory setting of subsystems below is needed because
# we need a console application, yet we need the GUI libraries that
# -mwindows adds to the link command. (We could probably also get
# away with -mconsole -lgdi32 -lcomdlg32 for now - this is with
# Cygwin 1.7's gcc 4.3; but let's rather have the compiler sort
# that out for us.)
EXTRALIBS="$EXTRALIBS -mwindows -mconsole"
fi
;;
*-*-mingw32* )
# i586-pc-mingw32msvc
# i686-pc-mingw32
HOSTTYPE="Mingw32"
NEEDLARGEFILES="yes"
EXTRALIBS="$EXTRALIBS -lws2_32 -mwindows -lmingw32"
if test "${gui_sum}" = "yes" -a "${gui_type}" = "none" ; then
gui_type="WIN"
fi
dnl if test "${gui_sum}" = "yes" -a "${gui_type}" = "SDL" ; then
dnl # hack to avoid missing SDL_main linker complaint
dnl LDFLAGS="$LDFLAGS -u_SDL_main"
dnl fi
;;
*-apple-darwin* )
# powerpc-apple-darwin8.6.0
# i686-apple-darwin8.9.1
# i386-apple-darwin9.8.0
HOSTTYPE="MacOSX"
CFLAGS="$CFLAGS -DMACOSX"
NEEDLARGEFILES="yes"
if test "${gui_sum}" = "yes" -a "${gui_type}" = "none" ; then
# use X11 version until someone builds a Cocoa interface
gui_type="X11"
LDFLAGS="$LDFLAGS -L/usr/X11/lib"
fi
;;
esac
HOSTNAME=`hostname`
case "$HOSTNAME" in
"pistols" )
# pentium-m
# CFLAGS="$CFLAGS -march=pentium-m"
# CFLAGS="$CFLAGS -march=pentium-m -mfpmath=sse"
;;
"clash" )
# Ultra Sparc 2
CFLAGS="$CFLAGS -mcpu=v9"
;;
esac
if test "${NEEDLARGEFILES}" != "no"; then
AC_DEFINE([_LARGEFILE_SOURCE], [1],[Defines LFS])
AC_DEFINE([_FILE_OFFSET_BITS],[64],[Defines LFS])
fi
AC_DEFINE_UNQUOTED(HOSTTYPE, $HOSTTYPE, [Host type])
AC_DEFINE_UNQUOTED(HOSTTYPESTR,"$HOSTTYPE",[Host type name])
AM_CONDITIONAL([BUILD_LINUX], [test "$HOSTTYPE" = "Linux"])
AM_CONDITIONAL([BUILD_SOLARIS], [test "$HOSTTYPE" = "Solaris"])
AM_CONDITIONAL([BUILD_MACOSX], [test "$HOSTTYPE" = "MacOSX"])
AM_CONDITIONAL([BUILD_MINGW32], [test "$HOSTTYPE" = "Mingw32"])
AM_CONDITIONAL([BUILD_CYGWIN], [test "$HOSTTYPE" = "Cygwin"])
AM_CONDITIONAL([BUILD_GUI_X11], [test "${gui_type}" = "X11"])
if test "${gui_type}" = "X11" ; then
AC_DEFINE([GUI_X11], [1], [Defines wether a X11 GUI is available])
EXTRALIBS="$EXTRALIBS -lX11"
fi
AM_CONDITIONAL([BUILD_GUI_WIN], [test "${gui_type}" = "WIN"])
if test "${gui_type}" = "WIN" ; then
AC_DEFINE([GUI_WIN], [1], [Defines wether a Windows native GUI is available])
EXTRALIBS="$EXTRALIBS"
fi
AM_CONDITIONAL([BUILD_GUI_NONE], [test "${gui_type}" = "none"])
if test "${gui_type}" = "none" ; then
AC_DEFINE([GUI_NONE], [1], [Defines wether No-GUI is selected])
fi
#if test "${zlib_sum}" = "system" ; then
# EXTRALIBS="$EXTRALIBS -lz"
#fi
dnl --------------------------------------------------------------
dnl Checks for libraries.
dnl --------------------------------------------------------------
dnl if test "${enable_sdl}" = "yes" ; then
dnl SDL_VERSION=1.2.5
dnl AM_PATH_SDL($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) )
dnl
dnl if test "$HOSTTYPE" = "Cygwin" ; then
dnl AC_MSG_NOTICE([stripping MinGW cruft from SDL_CFLAGS/_LIBS for Worldsens on Cygwin])
dnl SDL_CFLAGS="$(echo "$SDL_CFLAGS" | sed -e 's,-I/usr/include/mingw,,;s,-mno-cygwin,,;s,-Dmain=SDL_main,,' )"
dnl SDL_LIBS="$(echo "$SDL_LIBS" | sed -e 's,-lmingw32,,;s,-mno-cygwin,,;s,-mwindows,,;s,-lSDLmain,,' )"
dnl fi
dnl
dnl CFLAGS="$CFLAGS $SDL_CFLAGS"
dnl EXTRALIBS="$EXTRALIBS $SDL_LIBS"
dnl fi
dnl Wextra && Werror
dnl ================
CFLAGS_save="${CFLAGS}"
AC_ARG_ENABLE([waou],AS_HELP_STRING([--enable-waou],[Wextra Werror mode (default disabled)]))
if test "${enable_waou}" = "yes"; then
if test "${HOSTTYPE}" != "Cygwin" ; then
CFLAGS="$CFLAGS -Wextra -Werror"
waou_sum="yes"
else
waou_sum="no"
fi
else
waou_sum="no"
fi
dnl --------------------------------------------------------------
dnl Output
dnl --------------------------------------------------------------
dnl
LIBS=${EXTRALIBS}
AC_MSG_NOTICE(EXTRALIBS=${EXTRALIBS})
AC_MSG_NOTICE(EXTRAOBJS=${EXTRAOBJS})
AC_SUBST(EXTRALIBS)
AC_SUBST(EXTRAOBJS)
AC_CONFIG_FILES(
dnl
arch/Makefile
arch/common/Makefile
arch/msp430/Makefile
arch/atmega/Makefile
arch/mcugen/Makefile
dnl
devices/Makefile
devices/led/Makefile
devices/7seg/Makefile
devices/m25p80/Makefile
devices/at45db/Makefile
devices/ds1722/Makefile
devices/ds2411/Makefile
devices/gdm1602a/Makefile
devices/hd44780/Makefile
devices/bargraph/Makefile
devices/ptty/Makefile
devices/cc1100_2500/Makefile
devices/cc2420/Makefile
devices/uigfx/Makefile
devices/spidev/Makefile
devices/spidev_master/Makefile
devices/spidev_dsp/Makefile
devices/cma3000_spi/Makefile
devices/scp1000_i2c/Makefile
devices/ez430_lcd/Makefile
dnl
platforms/Makefile
platforms/wsn430/Makefile
platforms/senslab/Makefile
platforms/mosar/Makefile
platforms/ez430/Makefile
platforms/ez430rf/Makefile
platforms/ot2006/Makefile
platforms/otsetre/Makefile
platforms/tests/Makefile
platforms/telosb/Makefile
platforms/mica2/Makefile
platforms/micaz/Makefile
platforms/iclbsn/Makefile
platforms/mcugen/Makefile
platforms/wasp/Makefile
platforms/wisenode/Makefile
platforms/powwow/Makefile
platforms/ez430chronos/Makefile
dnl
libelf/Makefile
libgdb/Makefile
libgui/Makefile
liblogger/Makefile
liblogpkt/Makefile
libetrace/Makefile
libtracer/Makefile
libselect/Makefile
libconsole/Makefile
libwsnet/Makefile
machine/Makefile
src/Makefile
dnl
doc/Makefile
dnl
Makefile
)
AC_OUTPUT
dnl --------------------------------------------------------------
dnl Summary
dnl --------------------------------------------------------------
if test ${NPLATFORM} -eq 0 ; then
AC_MSG_NOTICE([== --------------------------------------------------- ==])
AC_MSG_NOTICE([== You need to select one simulation platform ==])
AC_MSG_NOTICE([== Please re-configure before compiling ==])
AC_MSG_NOTICE([== --------------------------------------------------- ==])
fi
AC_MSG_NOTICE([
Configuration summary:
host : ${host}
host type : $HOSTTYPE
target(s) : $PLATFORMNAMES
lto : ${lto_sum} ${CFLAGSLTO}
wsim debug : ${debug_sum}
target debug : ${xdebug_sum}
Etrace : ${etrace_sum}
Elf loader : ${elf_sum}
GUI : ${gui_sum} ${gui_type}
zlib : ${zlib_sum}
Ptty : ${ptty_sum}
])