-
Notifications
You must be signed in to change notification settings - Fork 50
/
configure
executable file
·820 lines (774 loc) · 20.9 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
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
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
#!/usr/bin/env bash
CC=gcc
CXX=g++
COMPILER_PREFIX=
DEBUG=
CFLAGS="-Wall"
FLAGS=""
LDFLAGS=""
LDFLAGS_UTIL=""
DFLAGS=""
CONFIG_EXT=""
INSTALL_PREFIX="/usr/local"
INSTALL_BIN=
INSTALL_INCLUDES=
INCLUDE_PATH=
ASM_OBJS_ALL=""
DISASM_OBJS_ALL=""
TABLE_OBJS_ALL=""
SIM_OBJS_ALL=""
CPUS=" \
1802
4004
6502
6800
6809
65816
68HC08
68000
8008
8048
8051
86000
AGC
ARC
ARM
ARM64
AVR8
CELL
COPPER
CP1610
DOTNET
DSPIC
EBPF
EMOTION_ENGINE
EPIPHANY
F100_L
JAVA
F8
LC3
M8C
MIPS
MSP430
PADAUK
PDP8
PIC14
PIC18
POWERPC
PROPELLER
PROPELLER2
RISCV
SH4
SPARC
STM8
SUPER_FX
SWEET16
THUMB
TMS340
TMS1000
TMS9900
UNSP
WEBASM
XTENSA
Z80"
ASM_OBJS="common.o"
DISASM_OBJS=""
TABLE_OBJS=""
UTIL_OBJS="UtilContext.o util_disasm.o util_sim.o"
SIM_OBJS="null.o"
NO_MSP430="-DNO_MSP430"
DFLAGS_ALL=""
COMMON_OBJS="
add_bin.o
assembler.o
cpu_list.o
directives.o
directives_data.o
directives_if.o
directives_include.o
eval_expression.o
ifdef_expression.o
imports_ar.o
imports_get_int.o
imports_obj.o
Linker.o
print_error.o
macros.o
Memory.o
MemoryPool.o
Operator.o
Symbols.o
tokens.o
Var.o"
FILEIO_OBJS="
FileIo.o
file.o
read_amiga.o
read_bin.o
read_elf.o
read_hex.o
read_macho.o
read_srec.o
read_ti_txt.o
read_wdc.o
write_amiga.o
write_bin.o
write_elf.o
write_hex.o
write_macho.o
write_srec.o
write_wdc.o"
for cpu in ${CPUS}
do
DFLAGS_ALL="${DFLAGS_ALL} -DENABLE_${cpu}"
done
DFLAGS_ALL=`echo ${DFLAGS_ALL} | sed 's/^ *//'`
for file in asm/*.cpp
do
if [[ ! $(basename ${file}) == "template.cpp" ]]
then
file=${file##*/}
ASM_OBJS_ALL="${ASM_OBJS_ALL} ${file%.cpp}.o"
fi
done
for file in disasm/*.cpp
do
if [[ ! $(basename ${file}) == "template.cpp" ]]
then
file=${file##*/}
DISASM_OBJS_ALL="${DISASM_OBJS_ALL} ${file%.cpp}.o"
fi
done
for file in table/*.cpp
do
if [[ ! $(basename ${file}) == "template.cpp" ]]
then
file=${file##*/}
TABLE_OBJS_ALL="${TABLE_OBJS_ALL} ${file%.cpp}.o"
fi
done
for file in simulate/*.cpp
do
if [[ ! $(basename ${file}) == "template.c" ]]
then
file=${file##*/}
SIM_OBJS_ALL="${SIM_OBJS_ALL} ${file%.cpp}.o"
fi
done
targetos=`uname -s`
case $targetos in
MINGW*)
#CFLAGS="${CFLAGS} -DWINDOWS -mwindows"
CONFIG_EXT=".exe"
INSTALL_PREFIX="/c/Program Files/naken_asm"
;;
esac
show_help()
{
echo
echo "Usage: ./configure [options]"
echo
echo " --help list options"
echo " --cflags=CFLAGS extra compiler flags"
echo " --ldflags=LDFLAGS extra linker flags"
echo " --prefix=PATH base path to install to (${INSTALL_PREFIX})"
echo " --include-path=PATH default: (${INSTALL_PREFIX}/share/naken_asm/includes)"
echo " --compiler-prefix=PREFIX for cross-compilers"
echo " --enable-debug compile in debug code"
echo
exit
}
test_c_compiler()
{
cat >config.c <<EOF
main() { }
EOF
${1} -o config config.c >>config.log 2>&1
}
test_cpp_compiler()
{
cat >config.cpp <<EOF
main() { }
EOF
${1} -o config config.cpp >>config.log 2>&1
}
test_lib()
{
cat >config.c <<EOF
main() { }
EOF
${COMPILER_PREFIX}${CC} -o config config.c $1 ${LDFLAGS} >>config.log 2>&1
}
test_include()
{
cat >config.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include <${1}>
int main() { return 0; }
EOF
${COMPILER_PREFIX}${CC} -c config.c ${CFLAGS} >>config.log 2>&1
}
test_strip()
{
cat >config.c <<EOF
int main() { return 0; }
EOF
a=`${COMPILER_PREFIX}${CC} -o config config.c -s 2>&1 >>config.log | grep 'option -s is obsolete'`
if [ "${a}" == "" ]
then
LDFLAGS="${LDFLAGS} -s"
fi
}
instr()
{
for s in $2; do
case "${s}" in
*${1}*) return 0
;;
esac
done
return 1
}
cleanup()
{
rm -f config.c config.cpp
rm -f config.o
rm -f config.exe
rm -f config
rm -f config.log
}
output_objs()
{
echo -n "${1}=" >> config.mak
for file in ${3}
do
printf " \\\\\n ${2}/${file}" >> config.mak
done
echo >> config.mak
}
for option in $@; do
optval="${option#*=}"
case "$option" in
--help) show_help
;;
--enable-debug) DEBUG="-DDEBUG -g"
;;
--disable-elf) CFLAGS="${CFLAGS} -DDISABLE_ELF"
;;
--cflags=*) CFLAGS="${CFLAGS} $optval"
;;
--ldflags=*) LDFLAGS="${LDFLAGS} $optval"
;;
--include-path=*) INCLUDE_PATH="$optval"
;;
--compiler-prefix=*) COMPILER_PREFIX="$optval"
;;
--install-prefix=*) INSTALL_PREFIX="$optval"
;;
--prefix=*) INSTALL_PREFIX="$optval"
;;
--enable-1802)
ASM_OBJS="${ASM_OBJS} 1802.o"
DISASM_OBJS="${DISASM_OBJS} 1802.o"
SIM_OBJS="${SIM_OBJS} 1802.o"
TABLE_OBJS="${TABLE_OBJS} 1802.o"
DFLAGS="${DFLAGS} -DENABLE_1802"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-4004)
ASM_OBJS="${ASM_OBJS} 4004.o"
DISASM_OBJS="${DISASM_OBJS} 4004.o"
#SIM_OBJS="${SIM_OBJS} 4004.o"
TABLE_OBJS="${TABLE_OBJS} 4004.o"
DFLAGS="${DFLAGS} -DENABLE_4004"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-6502)
ASM_OBJS="${ASM_OBJS} 6502.o"
DISASM_OBJS="${DISASM_OBJS} 6502.o"
SIM_OBJS="${SIM_OBJS} 6502.o"
TABLE_OBJS="${TABLE_OBJS} 6502.o"
DFLAGS="${DFLAGS} -DENABLE_6502"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-65816)
ASM_OBJS="${ASM_OBJS} 65816.o"
DISASM_OBJS="${DISASM_OBJS} 65816.o"
TABLE_OBJS="${TABLE_OBJS} 65816.o"
DFLAGS="${DFLAGS} -DENABLE_65816"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-6800)
ASM_OBJS="${ASM_OBJS} 6800.o"
DISASM_OBJS="${DISASM_OBJS} 6800.o"
TABLE_OBJS="${TABLE_OBJS} 6800.o"
DFLAGS="${DFLAGS} -DENABLE_6800"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-6809)
ASM_OBJS="${ASM_OBJS} 6809.o"
DISASM_OBJS="${DISASM_OBJS} 6809.o"
TABLE_OBJS="${TABLE_OBJS} 6809.o"
DFLAGS="${DFLAGS} -DENABLE_6809"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-68hc08)
ASM_OBJS="${ASM_OBJS} 68hc08.o"
DISASM_OBJS="${DISASM_OBJS} 68hc08.o"
TABLE_OBJS="${TABLE_OBJS} 68hc08.o"
DFLAGS="${DFLAGS} -DENABLE_68HC08"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-68000)
ASM_OBJS="${ASM_OBJS} 68000.o"
DISASM_OBJS="${DISASM_OBJS} 68000.o"
TABLE_OBJS="${TABLE_OBJS} 68000.o"
DFLAGS="${DFLAGS} -DENABLE_68000"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-8008)
ASM_OBJS="${ASM_OBJS} 8008.o"
DISASM_OBJS="${DISASM_OBJS} 8008.o"
SIM_OBJS="${SIM_OBJS} 8008.o"
TABLE_OBJS="${TABLE_OBJS} 8008.o"
DFLAGS="${DFLAGS} -DENABLE_8008"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-8048)
ASM_OBJS="${ASM_OBJS} 8048.o"
DISASM_OBJS="${DISASM_OBJS} 8048.o"
TABLE_OBJS="${TABLE_OBJS} 8048.o"
DFLAGS="${DFLAGS} -DENABLE_8048"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-8051)
ASM_OBJS="${ASM_OBJS} 8051.o"
DISASM_OBJS="${DISASM_OBJS} 8051.o"
TABLE_OBJS="${TABLE_OBJS} 8051.o"
DFLAGS="${DFLAGS} -DENABLE_8051"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-86000)
ASM_OBJS="${ASM_OBJS} 86000.o"
DISASM_OBJS="${DISASM_OBJS} 86000.o"
TABLE_OBJS="${TABLE_OBJS} 86000.o"
DFLAGS="${DFLAGS} -DENABLE_86000"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-agc)
ASM_OBJS="${ASM_OBJS} agc.o"
DISASM_OBJS="${DISASM_OBJS} agc.o"
DFLAGS="${DFLAGS} -DENABLE_AGC"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-arc)
ASM_OBJS="${ASM_OBJS} arc.o"
DISASM_OBJS="${DISASM_OBJS} arc.o"
DFLAGS="${DFLAGS} -DENABLE_ARC"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-arm)
ASM_OBJS="${ASM_OBJS} arm.o"
DISASM_OBJS="${DISASM_OBJS} arm.o"
TABLE_OBJS="${TABLE_OBJS} arm.o"
DFLAGS="${DFLAGS} -DENABLE_ARM"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-arm64)
ASM_OBJS="${ASM_OBJS} arm64.o"
DISASM_OBJS="${DISASM_OBJS} arm64.o"
TABLE_OBJS="${TABLE_OBJS} arm64.o"
DFLAGS="${DFLAGS} -DENABLE_ARM64"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-avr8)
ASM_OBJS="${ASM_OBJS} avr8.o"
DISASM_OBJS="${DISASM_OBJS} avr8.o"
SIM_OBJS="${SIM_OBJS} avr8.o"
TABLE_OBJS="${TABLE_OBJS} avr8.o"
DFLAGS="${DFLAGS} -DENABLE_AVR8"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-cell)
ASM_OBJS="${ASM_OBJS} cell.o"
DISASM_OBJS="${DISASM_OBJS} cell.o"
TABLE_OBJS="${TABLE_OBJS} cell.o"
DFLAGS="${DFLAGS} -DENABLE_CELL"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-copper)
ASM_OBJS="${ASM_OBJS} copper.o"
DISASM_OBJS="${DISASM_OBJS} copper.o"
#TABLE_OBJS="${TABLE_OBJS} copper.o"
DFLAGS="${DFLAGS} -DENABLE_COPPER"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-cp1610)
ASM_OBJS="${ASM_OBJS} cp1610.o"
DISASM_OBJS="${DISASM_OBJS} cp1610.o"
TABLE_OBJS="${TABLE_OBJS} cp1610.o"
DFLAGS="${DFLAGS} -DENABLE_CP1610"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-dotnet)
ASM_OBJS="${ASM_OBJS} dotnet.o"
DISASM_OBJS="${DISASM_OBJS} dotnet.o"
TABLE_OBJS="${TABLE_OBJS} dotnet.o"
DFLAGS="${DFLAGS} -DENABLE_DOTNET"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-dspic)
ASM_OBJS="${ASM_OBJS} dspic.o"
DISASM_OBJS="${DISASM_OBJS} dspic.o"
TABLE_OBJS="${TABLE_OBJS} dspic.o"
DFLAGS="${DFLAGS} -DENABLE_DSPIC"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-ebpf)
ASM_OBJS="${ASM_OBJS} ebpf.o"
DISASM_OBJS="${DISASM_OBJS} ebpf.o"
TABLE_OBJS="${TABLE_OBJS} ebpf.o"
DFLAGS="${DFLAGS} -DENABLE_EBPF"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-epiphany)
ASM_OBJS="${ASM_OBJS} epiphany.o"
DISASM_OBJS="${DISASM_OBJS} epiphany.o"
TABLE_OBJS="${TABLE_OBJS} epiphany.o"
DFLAGS="${DFLAGS} -DENABLE_EPIPHANY"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-f100_l)
ASM_OBJS="${ASM_OBJS} f100_l.o"
DISASM_OBJS="${DISASM_OBJS} f100_l.o"
SIM_OBJS="${SIM_OBJS} f100_l.o"
TABLE_OBJS="${TABLE_OBJS} f100_l.o"
DFLAGS="${DFLAGS} -DENABLE_F100_L"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-f8)
ASM_OBJS="${ASM_OBJS} f8.o"
DISASM_OBJS="${DISASM_OBJS} f8.o"
TABLE_OBJS="${TABLE_OBJS} f8.o"
DFLAGS="${DFLAGS} -DENABLE_F8"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-java)
ASM_OBJS="${ASM_OBJS} java.o"
DISASM_OBJS="${DISASM_OBJS} java.o"
TABLE_OBJS="${TABLE_OBJS} java.o"
DFLAGS="${DFLAGS} -DENABLE_JAVA"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-lc3)
ASM_OBJS="${ASM_OBJS} lc3.o"
DISASM_OBJS="${DISASM_OBJS} lc3.o"
TABLE_OBJS="${TABLE_OBJS} lc3.o"
DFLAGS="${DFLAGS} -DENABLE_LC3"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-m8c)
ASM_OBJS="${ASM_OBJS} m8c.o"
DISASM_OBJS="${DISASM_OBJS} m8c.o"
TABLE_OBJS="${TABLE_OBJS} m8c.o"
DFLAGS="${DFLAGS} -DENABLE_M8C"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-mips)
ASM_OBJS="${ASM_OBJS} mips.o"
DISASM_OBJS="${DISASM_OBJS} mips.o"
SIM_OBJS="${SIM_OBJS} mips.o"
TABLE_OBJS="${TABLE_OBJS} mips.o"
DFLAGS="${DFLAGS} -DENABLE_MIPS"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-msp430)
ASM_OBJS="${ASM_OBJS} msp430.o"
DISASM_OBJS="${DISASM_OBJS} msp430.o"
SIM_OBJS="${SIM_OBJS} msp430.o"
TABLE_OBJS="${TABLE_OBJS} msp430.o"
DFLAGS="${DFLAGS} -DENABLE_MSP430"
NO_MSP430=""
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-padauk)
ASM_OBJS="${ASM_OBJS} pdk13.o pdk14.o pdk15.o pdk16.o pdk_parse.o"
DISASM_OBJS="${DISASM_OBJS} pdk13.o pdk14.o pdk15.o pdk16.o"
TABLE_OBJS="${TABLE_OBJS} pdk13.o pdk14.o pdk15.o pdk16.o"
DFLAGS="${DFLAGS} -DENABLE_PADAUK"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-pdp8)
ASM_OBJS="${ASM_OBJS} pdp8.o"
DISASM_OBJS="${DISASM_OBJS} pdp8.o"
TABLE_OBJS="${TABLE_OBJS} pdp8.o"
DFLAGS="${DFLAGS} -DENABLE_PDP8"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-pic14)
ASM_OBJS="${ASM_OBJS} pic14.o"
DISASM_OBJS="${DISASM_OBJS} pic14.o"
TABLE_OBJS="${TABLE_OBJS} pic14.o"
DFLAGS="${DFLAGS} -DENABLE_PIC14"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-pic18)
ASM_OBJS="${ASM_OBJS} pic18.o"
DISASM_OBJS="${DISASM_OBJS} pic18.o"
TABLE_OBJS="${TABLE_OBJS} pic18.o"
DFLAGS="${DFLAGS} -DENABLE_PIC18"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-powerpc)
ASM_OBJS="${ASM_OBJS} powerpc.o"
DISASM_OBJS="${DISASM_OBJS} powerpc.o"
TABLE_OBJS="${TABLE_OBJS} powerpc.o"
DFLAGS="${DFLAGS} -DENABLE_POWERPC"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-propeller)
ASM_OBJS="${ASM_OBJS} propeller.o"
DISASM_OBJS="${DISASM_OBJS} propeller.o"
TABLE_OBJS="${TABLE_OBJS} propeller.o"
DFLAGS="${DFLAGS} -DENABLE_PROPELLER"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-propeller2)
ASM_OBJS="${ASM_OBJS} propeller2.o"
DISASM_OBJS="${DISASM_OBJS} propeller2.o"
TABLE_OBJS="${TABLE_OBJS} propeller2.o"
DFLAGS="${DFLAGS} -DENABLE_PROPELLER2"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-emotion-engine)
ASM_OBJS="${ASM_OBJS} ps2_ee_vu.o"
DISASM_OBJS="${DISASM_OBJS} ps2_ee_vu.o"
TABLE_OBJS="${TABLE_OBJS} ps2_ee_vu.o"
DFLAGS="${DFLAGS} -DENABLE_EMOTION_ENGINE"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-riscv)
ASM_OBJS="${ASM_OBJS} riscv.o"
DISASM_OBJS="${DISASM_OBJS} riscv.o"
TABLE_OBJS="${TABLE_OBJS} riscv.o"
DFLAGS="${DFLAGS} -DENABLE_RISCV"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-sh4)
ASM_OBJS="${ASM_OBJS} sh4.o"
DISASM_OBJS="${DISASM_OBJS} sh4.o"
TABLE_OBJS="${TABLE_OBJS} sh4.o"
DFLAGS="${DFLAGS} -DENABLE_SH4"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-sparc)
ASM_OBJS="${ASM_OBJS} sparc.o"
DISASM_OBJS="${DISASM_OBJS} sparc.o"
TABLE_OBJS="${TABLE_OBJS} sparc.o"
DFLAGS="${DFLAGS} -DENABLE_SPARC"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-stm8)
ASM_OBJS="${ASM_OBJS} stm8.o"
DISASM_OBJS="${DISASM_OBJS} stm8.o"
SIM_OBJS="${SIM_OBJS} stm8.o"
TABLE_OBJS="${TABLE_OBJS} stm8.o"
DFLAGS="${DFLAGS} -DENABLE_STM8"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-super-fx)
ASM_OBJS="${ASM_OBJS} super_fx.o"
DISASM_OBJS="${DISASM_OBJS} super_fx.o"
TABLE_OBJS="${TABLE_OBJS} super_fx.o"
DFLAGS="${DFLAGS} -DENABLE_SUPER_FX"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-sweet16)
ASM_OBJS="${ASM_OBJS} sweet16.o"
DISASM_OBJS="${DISASM_OBJS} sweet16.o"
TABLE_OBJS="${TABLE_OBJS} sweet16.o"
DFLAGS="${DFLAGS} -DENABLE_SWEET16"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-thumb)
ASM_OBJS="${ASM_OBJS} thumb.o"
DISASM_OBJS="${DISASM_OBJS} thumb.o"
TABLE_OBJS="${TABLE_OBJS} thumb.o"
DFLAGS="${DFLAGS} -DENABLE_THUMB"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-tms340)
ASM_OBJS="${ASM_OBJS} tms340.o"
DISASM_OBJS="${DISASM_OBJS} tms340.o"
TABLE_OBJS="${TABLE_OBJS} tms340.o"
DFLAGS="${DFLAGS} -DENABLE_TMS340"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-tms1000)
ASM_OBJS="${ASM_OBJS} tms1000.o"
DISASM_OBJS="${DISASM_OBJS} tms1000.o"
TABLE_OBJS="${TABLE_OBJS} tms1000.o"
SIM_OBJS="${SIM_OBJS} tms1000.o"
DFLAGS="${DFLAGS} -DENABLE_TMS1000"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-tms9900)
ASM_OBJS="${ASM_OBJS} tms9900.o"
DISASM_OBJS="${DISASM_OBJS} tms9900.o"
SIM_OBJS="${SIM_OBJS} tms9900.o"
TABLE_OBJS="${TABLE_OBJS} tms9900.o"
DFLAGS="${DFLAGS} -DENABLE_TMS9900"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-unsp)
ASM_OBJS="${ASM_OBJS} unsp.o"
DISASM_OBJS="${DISASM_OBJS} unsp.o"
TABLE_OBJS="${TABLE_OBJS} unsp.o"
DFLAGS="${DFLAGS} -DENABLE_UNSP"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-webasm)
ASM_OBJS="${ASM_OBJS} webasm.o"
DISASM_OBJS="${DISASM_OBJS} webasm.o"
TABLE_OBJS="${TABLE_OBJS} webasm.o"
DFLAGS="${DFLAGS} -DENABLE_WEBASM"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-xtensa)
ASM_OBJS="${ASM_OBJS} xtensa.o"
DISASM_OBJS="${DISASM_OBJS} xtensa.o"
TABLE_OBJS="${TABLE_OBJS} xtensa.o"
DFLAGS="${DFLAGS} -DENABLE_XTENSA"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
--enable-z80)
ASM_OBJS="${ASM_OBJS} z80.o"
DISASM_OBJS="${DISASM_OBJS} z80.o"
SIM_OBJS="${SIM_OBJS} z80.o"
TABLE_OBJS="${TABLE_OBJS} z80.o"
DFLAGS="${DFLAGS} -DENABLE_Z80"
echo "Enabling individual CPUs is deprecated and will be removed."
;;
esac
done
if [ -e /usr/local/include/readline ]
then
CFLAGS="${CFLAGS} -I/usr/local/include/readline"
fi
if [ "${ASM_OBJS}" == "common.o" ]
then
ASM_OBJS="${ASM_OBJS_ALL}"
DISASM_OBJS="${DISASM_OBJS_ALL}"
SIM_OBJS="${SIM_OBJS_ALL}"
TABLE_OBJS="${TABLE_OBJS_ALL}"
DFLAGS="${DFLAGS_ALL}"
NO_MSP430=""
else
# FIXME: Remove when --enable-cpu is no longer available.
SIM_OBJS="${SIM_OBJS} Simulate.o"
fi
if test_c_compiler "gcc"
then
CC="gcc"
elif test_c_compiler "cc"
then
CC="cc"
fi
if test_cpp_compiler "g++"
then
CXX="g++"
elif test_cpp_compiler "cc"
then
CXX="c++"
fi
#if test_lib "-lws2_32"; then LDFLAGS="${LDFLAGS} -lws2_32"; fi
#if test_lib "-lwinmm"; then LDFLAGS="${LDFLAGS} -lwinmm"; fi
#if test_lib "-luser32"; then LDFLAGS="${LDFLAGS} -luser32"; fi
if test_lib "-lreadline"
then
if test_include "readline/readline.h"
then
LDFLAGS_UTIL="${LDFLAGS_UTIL} -lreadline"
CFLAGS="${CFLAGS} -DREADLINE"
fi
fi
if [ "${DEBUG}" = "" ]
then
CFLAGS="${CFLAGS} -O3"
else
CFLAGS="${CFLAGS} ${DEBUG}"
fi
if [ "${NO_MSP430}" != "" ]
then
CFLAGS="${CFLAGS} ${NO_MSP430}"
fi
#if ! instr "WINDOWS" "${FLAGS}"
#then
# a=`${COMPILER_PREFIX}${CC} --version`
#
# if instr "mingw" "${a}"
# then
# FLAGS="${FLAGS} -DWINDOWS -mwindows"
# CONFIG_EXT=".exe"
# fi
#fi
if instr "mingw" "${COMPILER_PREFIX}"
then
CONFIG_EXT=".exe"
fi
if ! instr "WINDOWS" "${CFLAGS}"
then
if [ "${INSTALL_PREFIX}" = "" ]
then
INSTALL_PREFIX="."
fi
INSTALL_BIN=${INSTALL_PREFIX}/bin
INSTALL_INCLUDES=${INSTALL_PREFIX}/share/naken_asm
else
INSTALL_BIN=${INSTALL_PREFIX}
INSTALL_INCLUDES=${INSTALL_PREFIX}
fi
if [ "${INCLUDE_PATH}" = "" ]
then
INCLUDE_PATH="${INSTALL_INCLUDES}/include"
fi
test_strip
cleanup
echo "# Generated include file" > config.mak
echo "# $0 $*" >> config.mak
echo >> config.mak
echo "CC=${COMPILER_PREFIX}${CC}" >> config.mak
echo "CXX=${COMPILER_PREFIX}${CXX}" >> config.mak
echo "COMPILER_PREFIX=${COMPILER_PREFIX}" >> config.mak
echo "LDFLAGS=${LDFLAGS}" >> config.mak
echo "LDFLAGS_UTIL=${LDFLAGS_UTIL}" >> config.mak
echo "CFLAGS=${CFLAGS}" >> config.mak
echo "DFLAGS=${DFLAGS}" >> config.mak
echo "INSTALL_BIN=${INSTALL_BIN}" >> config.mak
echo "INSTALL_INCLUDES=${INSTALL_INCLUDES}" >> config.mak
echo "INSTALL_PREFIX=${INSTALL_PREFIX}" >> config.mak
echo "INCLUDE_PATH=${INCLUDE_PATH}" >> config.mak
echo "CONFIG_EXT=${CONFIG_EXT}" >> config.mak
output_objs ASM_OBJS asm "${ASM_OBJS}"
output_objs DISASM_OBJS disasm "${DISASM_OBJS}"
output_objs TABLE_OBJS table "${TABLE_OBJS}"
output_objs UTIL_OBJS common "${UTIL_OBJS}"
output_objs COMMON_OBJS common "${COMMON_OBJS}"
output_objs SIM_OBJS simulate "${SIM_OBJS}"
output_objs FILEIO_OBJS fileio "${FILEIO_OBJS}"
echo >> config.mak
echo
echo "Configuration:"
echo " Install to: ${INSTALL_PREFIX}"
echo " : ${INSTALL_BIN}, ${INSTALL_INCLUDES}/include"
echo " Compiler: ${COMPILER_PREFIX}${CC}, ${COMPILER_PREFIX}${CXX}"
echo " LDFLAGS: ${LDFLAGS}"
echo "UTIL LDFLAGS: ${LDFLAGS_UTIL}"
echo " CFLAGS: ${CFLAGS}"
echo " DEFINES: ${DFLAGS}"
echo "INCLUDE_PATH: ${INCLUDE_PATH}"
echo " BINS: naken_asm${CONFIG_EXT}, naken_util${CONFIG_EXT}"
echo
echo "Now type: make"
echo