-
Notifications
You must be signed in to change notification settings - Fork 58
/
Makefile.in
5488 lines (5145 loc) · 201 KB
/
Makefile.in
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
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Enterprise Storage OS (ESOS) Makefile[.in]
# Makefile is generated from Makefile.in via the configure script.
# Please see the README/INSTALL documents for help.
SRC_DIR := @src_dir@
BUILD_DIR := @build_dir@
WORK_DIR := @work_dir@
DIST_FILES_DIR := @dist_files_dir@
SOURCES_DIR := @sources_dir@
CHROOT_DIR := @chroot_dir@
TOOLS_DIR := @tools_dir@
INITRAMFS_DIR := @initramfs_dir@
MOUNT_DIR := @mount_dir@
STAGING_DIR := @staging_dir@
QUIET := @
SHELL := @bash@
WGET := @wget@ -t 5
MKDIR := @mkdir@ -p
RM := @rm@ -rf
TAR := @tar@
CP := @cp@
FIND := @find@
CPIO := @cpio@
GZIP := @gzip@ -9f
ECHO := @echo@
SFDISK := @sfdisk@
CAT := @cat@
GREP := @grep@
DD := @dd@
MKFS_VFAT := @mkfs_vfat@
MKFS_EXT4 := @mkfs_ext4@
LN := @ln@ -sf
MOUNT := @mount@
UMOUNT := @umount@
SED := @sed@
MKNOD := @mknod@
TOUCH := @touch@
INSTALL := @install@ -c
PATCH := @patch@
CHOWN := @chown@
CHMOD := @chmod@
MD5SUM := @md5sum@
SHA256SUM := @sha256sum@
SLEEP := @sleep@
LOSETUP := @losetup@
KPARTX := @kpartx@
XARGS := @xargs@
ZIP := @zip@
XZ := @xz@
READLINK := @readlink@
STRIP := @strip@
GIT := @git@
FLOCK := @flock@
ZIC := @zic@
MV := @mv@
RSYNC := @rsync@
MKSQUASHFS := @mksquashfs@
RMDIR := @rmdir@
CUT := @cut@
TR := @tr@
MOUNTPOINT := @mountpoint@
enable_debug := @enable_debug@
enable_gdb := @enable_gdb@
enable_crash := @enable_crash@
enable_valgrind := @enable_valgrind@
enable_strace := @enable_strace@
enable_nginx := @enable_nginx@
enable_python_sql := @enable_python_sql@
enable_zfs := @enable_zfs@
enable_lessfs := @enable_lessfs@
enable_qemu := @enable_qemu@
enable_mhvtl := @enable_mhvtl@
enable_eio := @enable_eio@
enable_btier := @enable_btier@
enable_memcached := @enable_memcached@
enable_simple_tui := @enable_simple_tui@
enable_auto_dhcp := @enable_auto_dhcp@
enable_tui_eula := @enable_tui_eula@
enable_login_tui := @enable_login_tui@
enable_debug_kernel := @enable_debug_kernel@
enable_qla32 := @enable_qla32@
with_celerity_16_32 := @with_celerity_16_32@
celerity_16_32_dir := $(subst $(CHROOT_DIR),,@celerity_16_32_dir@)
with_atto_scst := @with_atto_scst@
atto_scst_dir := $(subst $(CHROOT_DIR),,@atto_scst_dir@)
with_ocs_sdk := @with_ocs_sdk@
ocs_sdk_dir := $(subst $(CHROOT_DIR),,@ocs_sdk_dir@)
with_rapiddisk := @with_rapiddisk@
rapiddisk_dir := $(subst $(CHROOT_DIR),,@rapiddisk_dir@)
with_uwire := @with_uwire@
uwire_dir := $(subst $(CHROOT_DIR),,@uwire_dir@)
with_mlnx_ofed := @with_mlnx_ofed@
mlnx_ofed_dir := $(subst $(CHROOT_DIR),,@mlnx_ofed_dir@)
with_qla2xxx_scst := @with_qla2xxx_scst@
qla2xxx_scst_dir := $(subst $(CHROOT_DIR),,@qla2xxx_scst_dir@)
with_bnxt_en := @with_bnxt_en@
bnxt_en_dir := $(subst $(CHROOT_DIR),,@bnxt_en_dir@)
with_r8152 := @with_r8152@
r8152_dir := $(subst $(CHROOT_DIR),,@r8152_dir@)
with_customize_dir := @with_customize_dir@
customize_dir := @customize_dir@
build_opts := @build_opts@
opt_suffix := @opt_suffix@
git_branch := $(shell if branch="$$($(GIT) --git-dir=$(SRC_DIR)/.git \
rev-parse --symbolic-full-name --abbrev-ref HEAD 2>&1)"; \
then echo -n "$$branch"; else echo -n "UNKNOWN"; fi)
git_hash := $(shell if hash="$$($(GIT) --git-dir=$(SRC_DIR)/.git \
rev-parse --short HEAD 2>&1)"; \
then echo -n "$$hash"; else echo -n "UNKNOWN"; fi)
git_tag := $(shell if tag="$$($(GIT) --git-dir=$(SRC_DIR)/.git \
describe --exact-match --abbrev=0 2>&1)"; \
then echo -n "$$tag"; else echo -n ""; fi)
rel_name := $(git_tag)$(opt_suffix)
dev_name := $(git_branch)_$(git_hash)$(opt_suffix)
esos_ver := $(if $(git_tag),$(rel_name),$(dev_name))
product := Enterprise Storage OS
short_prod := ESOS
pkg_name := esos
prod_suffix := -esos.prod
ifeq ($(enable_debug_kernel),yes)
debug_suffix := -esos.debug
endif
dist_files = $(addprefix $(DIST_FILES_DIR)/, \
binutils-2.32.tar.xz \
gcc-9.1.0.tar.xz \
gmp-6.1.2.tar.xz \
mpfr-4.0.2.tar.xz \
mpc-1.1.0.tar.gz \
linux-5.4.229.tar.xz \
glibc-2.29.tar.xz \
tcl-8.6.9.tar.xz \
expect-5.45.4.tar.xz \
dejagnu-1.6.2.tar.gz \
check-0.12.0.tar.gz \
ncurses-6.1.tar.gz \
bash-5.1.8.tar.gz \
bison-3.3.2.tar.xz \
bzip2-1.0.6.tar.gz \
coreutils-8.31.tar.xz \
diffutils-3.7.tar.xz \
file-5.36.tar.gz \
findutils-4.6.0.tar.gz \
gawk-5.0.0.tar.xz \
gettext-0.19.8.1.tar.xz \
grep-3.3.tar.xz \
gzip-1.10.tar.xz \
m4-1.4.18.tar.xz \
make-4.3.tar.gz \
patch-2.7.6.tar.xz \
perl-5.28.2.tar.xz \
sed-4.7.tar.xz \
tar-1.32.tar.xz \
texinfo-6.6.tar.xz \
util-linux-2.36.1.tar.xz \
xz-5.2.4.tar.xz \
pkg-config-0.29.2.tar.gz \
which-2.21.tar.gz \
autoconf-2.69.tar.xz \
automake-1.16.1.tar.xz \
libtool-2.4.6.tar.xz \
flex-2.6.4.tar.gz \
Python-3.9.5.tar.xz \
cmake-3.14.4.tar.gz \
ninja-1.9.0.tar.gz \
meson-0.56.0.tar.gz \
setuptools-28.6.0.tar.gz \
ocaml-4.12.0.tar.gz \
findlib-1.9.1.tar.gz \
Linux-PAM-1.3.1.tar.xz \
busybox-1.30.1.tar.bz2 \
grub-2.02.tar.xz \
sysvinit-2.94.tar.xz \
vixie-cron-4.1.tar.bz2 \
rdma-core-52.0.tar.gz \
openssh-9.8p1.tar.gz \
ssmtp-2.64.tar.bz2 \
openssl-1.1.1w.tar.gz \
e2fsprogs-1.45.1.tar.xz \
zlib-1.2.11.tar.xz \
lsscsi-030r154.tar.gz \
sg3_utils-1.48.tar.xz \
groff-1.22.4.tar.gz \
qlogic_fw-20240820.tar.xz \
iniparser-4.1.tar.gz \
cdk-5.0-20161210.tar.gz \
scst-3.7.x_20230120.tar.xz \
kexec-tools-2.0.19.tar.xz \
drbd-utils-9.16.0.tar.gz \
lvm2-2.03.14.tar.xz \
xfsprogs-4.20.0.tar.xz \
mdadm-4.1.tar.xz \
parted-3.2.tar.xz \
libqb-2.0.6.tar.gz \
pacemaker-1.1.20.tar.xz \
corosync-2.4.6.tar.gz \
nss-3.43.tar.gz \
glib-2.61.0.tar.xz \
libxml2-2.9.9.tar.gz \
libxslt-1.1.33.tar.gz \
crmsh-master_20180520.tar.xz \
libaio-0.3.111.tar.xz \
glue-1.0.12.tar.bz2 \
readline-8.0.tar.gz \
resource-agents-4.2.0.tar.gz \
lzo-2.10.tar.gz \
fuse-2.9.7.tar.gz \
db-5.3.28.tar.gz \
fence-agents-4.3.3.tar.gz \
opensm-3.3.20.tar.gz \
curl-7.64.1.tar.xz \
open-fcoe-3.19.tar.gz \
openlldp-1.1.1.tar.gz \
libconfig-1.7.2.tar.gz \
libnl-3.2.25.tar.gz \
libpciaccess-0.14.tar.bz2 \
linux_firmware-20190416.tar.xz \
dlm-4.0.8.tar.xz \
sysklogd-new_remote_opt_20190715.tar.xz \
ipmitool-1.8.18.tar.bz2 \
less-530.tar.gz \
irqbalance-1.8.0.tar.gz \
ethtool-5.0.tar.xz \
perftest-4.4-0.5.tar.xz \
bcache-tools-1.0.8.tar.gz \
nrpe-3.2.1.tar.gz \
thin-provisioning-tools-0.9.0.tar.gz \
expat-2.2.6.tar.bz2 \
boost-1.70.0.tar.xz \
sysstat-12.1.4.tar.xz \
pciutils-3.6.2.tar.xz \
net-snmp-5.8.tar.xz \
nut-2.7.4.tar.gz \
libusb-1.0.22.tar.bz2 \
libusb_compat-0.1.7.tar.xz \
freeipmi-1.6.3.tar.gz \
libgcrypt-1.8.4.tar.bz2 \
libgpg-error-1.36.tar.bz2 \
smartmontools-7.4.tar.gz \
cryptsetup-1.7.5.tar.xz \
popt-1.16.tar.gz \
makedumpfile-1.6.7.tar.gz \
elfutils-0.176.tar.bz2 \
fio-3.13.tar.xz \
mtx-1.3.12.tar.gz \
mt-st-1.3.tar.gz \
nagios-plugins-2.2.1.tar.gz \
libedit-20190324-3.1.tar.gz \
libmcrypt-2.5.8.tar.bz2 \
nsca-2.9.2.tar.gz \
btrfs-progs-4.20.2.tar.xz \
attr-2.4.48.tar.gz \
acl-2.2.53.tar.gz \
htop-2.2.0.tar.gz \
dmidecode-3.4.tar.xz \
xmlrpc-c-1.39.13.tar.gz \
stunnel-5.53.tar.gz \
sudo-1.8.27.tar.gz \
rsync-3.1.3.tar.gz \
eudev-3.2.7.tar.gz \
gperf-3.1.tar.gz \
multipath-tools-0.8.7.tar.gz \
json-c-0.13.1-20180305.tar.xz \
archivemount-0.8.12.tar.gz \
libarchive-3.3.3.tar.gz \
rasdaemon-0.6.5.tar.bz2 \
edac-utils-0.18.tar.gz \
sysfsutils-2.1.0.tar.gz \
sqlite-autoconf-3280000.tar.gz \
iperf2-2.0.13.tar.xz \
iperf3-3.6.tar.xz \
libpcap-1.9.0.tar.gz \
iftop-1.0pre4.tar.gz \
nmon-16j.tar.xz \
munin-c-0.0.13.tar.xz \
open-iscsi-2.1.1.tar.gz \
open-isns-0.99.tar.gz \
open-vm-tools-10.3.10-12406962.tar.gz \
libdnet-1.11.tar.gz \
libffi-3.2.1.tar.gz \
openwsman-2.7.0.tar.gz \
swig-4.0.0.tar.gz \
userspace-rcu-0.11.0.tar.bz2 \
tzdata-2019a.tar.xz \
nvme-cli-1.15.tar.gz \
freetype-2.10.0.tar.bz2 \
ledmon-0.92.tar.gz \
nvmetcli-master_20230519.tar.xz \
bc-1.07.1.tar.gz \
etckeeper-1.18.10.tar.gz \
git-2.21.0.tar.xz \
nfs-utils-2.3.4.tar.xz \
rpcbind-1.2.5.tar.bz2 \
libtirpc-1.1.4.tar.bz2 \
libevent-2.1.8-stable.tar.gz \
keyutils-1.6.tar.bz2 \
libnfsidmap-0.26.tar.bz2 \
hdparm-9.58.tar.gz \
kbd-2.0.4.tar.xz \
dosfstools-4.1.tar.xz \
lsof-4.91.tar.xz \
blktrace-master_20181015.tar.xz \
hwloc-2.0.3.tar.bz2 \
mstflint-4.11.0-3.tar.xz \
cls_switchtec-4.1.0_5.4_20220211.tar.xz \
lshw-B.02.18.tar.gz \
iozone3-487.tar.xz \
telegraf-1.14.3_linux_amd64.tar.xz \
sbd-1.4.1.tar.gz \
screen-4.6.2.tar.gz \
lftp-4.8.4.tar.xz \
ndctl-65.tar.gz \
kmod-26.tar.xz \
docbook-xsl-nons-1.79.2.tar.bz2 \
acpid-2.0.31.tar.xz \
ibutils-1.5.7.tar.gz \
numactl-2.0.13.tar.gz \
iowatcher-master_20200318.tar.xz \
iotop-master_20200318.tar.xz \
node_exporter-1.3.1.linux-amd64.tar.xz \
libcap-2.36.tar.gz \
sedutil-master_20201026.tar.xz \
squashfs-tools-4.4-git.1.tar.gz \
prometheus-2.32.1.linux-amd64.tar.xz \
jq-1.6.tar.gz \
oniguruma-6.9.6.tar.gz \
procps-v3.3.16.tar.gz \
haveged-1.9.14.tar.gz \
msmtp-1.8.14.tar.xz \
gnutls-3.6.15.tar.xz \
nettle-3.6.tar.gz \
tcpdump-4.99.0.tar.gz \
vim-8.2.2562.tar.gz \
sdparm-1.11.tar.xz \
iproute2-5.9.0.tar.xz \
libmnl-1.0.4.tar.bz2 \
jansson-2.12.tar.bz2 \
pcre-8.43.tar.gz \
pv-1.6.6.tar.bz2 \
gptfdisk-1.0.8.tar.gz \
usbutils-014.tar.xz \
libvirtd_exporter-master_20210907.tar.xz \
wget-1.21.2.tar.gz \
cacerts-20210930.tar.xz \
mlnx-tools-5.2.0.tar.gz \
zip-3.0.tar.xz \
cpuset-1.6.tar.gz \
switchtec-user-3.0.tar.gz \
bwm-ng-0.6.3.tar.gz \
lz4-1.9.4.tar.gz \
minicom-2.8.tar.gz \
smp_utils-0.99.tar.xz \
sasutils-0.3.13.tar.gz \
win_binaries-20180813.tar.xz)
dist_files_repo = http://download.esos-project.com/dist_files
# Check if we're chroot'd or not
ifeq ($(shell if [ "`awk '$$5=="/" {print $$1}' </proc/1/mountinfo`" != \
"`awk '$$5=="/" {print $$1}' </proc/$$PPID/mountinfo`" ]; then \
echo chroot; fi),chroot)
in_chroot = yes
else
in_chroot = no
endif
# Handle variable overrides via customization directory
ifeq ($(in_chroot),no)
ifeq ($(with_customize_dir),yes)
include $(customize_dir)/overwrites.mk
endif
else
ifeq ($(with_customize_dir),yes)
include overwrites.mk
endif
endif
# These targets are required before entering the chroot environment
bootstrap_tgts := binutils.pass1 gcc.pass1 gmp mpfr mpc kernel_headers \
glibc gcc.libstdc++ binutils.pass2 gcc.pass2 tcl expect \
dejagnu check ncurses bash bison bzip2 coreutils diffutils \
file findutils gawk gettext grep gzip m4 make patch perl \
sed tar texinfo util-linux xz pkg-config which autoconf \
automake libtool flex zlib libffi Python cmake ninja meson \
setuptools rsync ocaml findlib
# All targets which are built/installed in the chroot environment
chroot_tgts := kernel_headers.chroot glibc.chroot gcc.chroot \
esos_kernels.chroot esos_tui.chroot scst.chroot \
Linux-PAM.chroot busybox.chroot makedumpfile.chroot \
elfutils.chroot sysvinit.chroot grub.chroot perl.chroot \
Python.chroot qlogic_fw.chroot scstadmin.chroot \
openssh.chroot vixie-cron.chroot openssl.chroot zlib.chroot \
ncurses.chroot e2fsprogs.chroot ssmtp.chroot rdma-core.chroot \
lsscsi.chroot sg3_utils.chroot groff.chroot kexec-tools.chroot \
iniparser.chroot cdk.chroot lvm2.chroot xfsprogs.chroot \
drbd-utils.chroot mdadm.chroot parted.chroot opensm.chroot \
libqb.chroot pacemaker.chroot corosync.chroot nss.chroot \
glib.chroot libxml2.chroot libxslt.chroot bzip2.chroot \
crmsh.chroot libaio.chroot glue.chroot readline.chroot \
resource-agents.chroot lzo.chroot fuse.chroot db.chroot \
fence-agents.chroot curl.chroot fio.chroot \
open-fcoe.chroot openlldp.chroot libconfig.chroot \
libnl.chroot libpciaccess.chroot linux_firmware.chroot \
dlm.chroot ipmitool.chroot sysklogd.chroot less.chroot \
irqbalance.chroot ethtool.chroot perftest.chroot nrpe.chroot \
bcache-tools.chroot util-linux.chroot \
thin-provisioning-tools.chroot expat.chroot \
boost.chroot sysstat.chroot pciutils.chroot \
net-snmp.chroot nut.chroot libusb.chroot libusb_compat.chroot \
freeipmi.chroot libgcrypt.chroot libgpg-error.chroot \
smartmontools.chroot cryptsetup.chroot popt.chroot mtx.chroot \
mt-st.chroot nagios-plugins.chroot libedit.chroot \
libmcrypt.chroot nsca.chroot btrfs-progs.chroot attr.chroot \
acl.chroot htop.chroot dmidecode.chroot xmlrpc-c.chroot \
stunnel.chroot sudo.chroot rsync.chroot eudev.chroot \
gperf.chroot multipath-tools.chroot json-c.chroot \
archivemount.chroot libarchive.chroot rasdaemon.chroot \
edac-utils.chroot sysfsutils.chroot sqlite-autoconf.chroot \
iperf2.chroot iperf3.chroot libpcap.chroot iftop.chroot \
nmon.chroot munin-c.chroot open-iscsi.chroot open-isns.chroot \
coreutils.chroot open-vm-tools.chroot libdnet.chroot \
libffi.chroot openwsman.chroot swig.chroot \
userspace-rcu.chroot tzdata.chroot nvme-cli.chroot \
freetype.chroot ledmon.chroot nvmetcli.chroot bc.chroot \
libtool.chroot etckeeper.chroot git.chroot nfs-utils.chroot \
rpcbind.chroot libtirpc.chroot libevent.chroot \
keyutils.chroot libnfsidmap.chroot hdparm.chroot kbd.chroot \
dosfstools.chroot lsof.chroot blktrace.chroot hwloc.chroot \
mstflint.chroot lshw.chroot iozone3.chroot telegraf.chroot \
sbd.chroot screen.chroot lftp.chroot ndctl.chroot \
kmod.chroot docbook-xsl-nons.chroot acpid.chroot \
ibutils.chroot tcl.chroot numactl.chroot iowatcher.chroot \
iotop.chroot node_exporter.chroot libcap.chroot \
sedutil.chroot squashfs-tools.chroot prometheus.chroot \
jq.chroot oniguruma.chroot procps.chroot haveged.chroot \
msmtp.chroot gnutls.chroot nettle.chroot tcpdump.chroot \
vim.chroot sdparm.chroot iproute2.chroot libmnl.chroot \
file.chroot jansson.chroot pcre.chroot pv.chroot \
gptfdisk.chroot usbutils.chroot libvirtd_exporter.chroot \
xz.chroot wget.chroot cacerts.chroot mlnx-tools.chroot \
zip.chroot cpuset.chroot switchtec-user.chroot bwm-ng.chroot \
lz4.chroot minicom.chroot smp_utils.chroot sasutils.chroot
# And finally these targets should be built without parallel execution
system_tgts := bash.chroot findutils.chroot sed.chroot tar.chroot
# Check if we should enable additional build options
ifeq ($(enable_gdb),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,gdb-10.2.tar.xz)
chroot_tgts += gdb.chroot
endif
ifeq ($(enable_crash),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,crash-8.0.5.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,pykdump-master_20241031.tar.xz)
chroot_tgts += crash.chroot
chroot_tgts += pykdump.chroot
endif
ifeq ($(enable_valgrind),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,valgrind-3.15.0.tar.bz2)
chroot_tgts += valgrind.chroot
endif
ifeq ($(enable_strace),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,strace-5.1.tar.xz)
chroot_tgts += strace.chroot
endif
ifeq ($(enable_nginx),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,nginx-1.16.0.tar.gz)
chroot_tgts += nginx.chroot
endif
ifeq ($(enable_python_sql),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,postgresql-9.6.13.tar.bz2)
dist_files += $(addprefix $(DIST_FILES_DIR)/,mysql-5.0.96.tar.gz)
chroot_tgts += postgresql.chroot
chroot_tgts += mysql.chroot
endif
ifeq ($(enable_zfs),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,zfs-0.8.3.tar.gz)
chroot_tgts += zfs.chroot
endif
ifeq ($(enable_lessfs),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,lessfs-1.7.0.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,tokyocabinet-1.4.48.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,snappy-1.1.7.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,mhash-0.9.9.9.tar.bz2)
chroot_tgts += lessfs.chroot
chroot_tgts += tokyocabinet.chroot
chroot_tgts += snappy.chroot
chroot_tgts += mhash.chroot
endif
ifeq ($(enable_qemu),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,qemu-5.2.0.tar.xz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,pixman-0.40.0.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,libvirt-6.10.0.tar.xz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,yajl-2.1.0.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,iptables-1.8.7.tar.bz2)
dist_files += $(addprefix $(DIST_FILES_DIR)/,libnftnl-1.1.9.tar.bz2)
dist_files += $(addprefix $(DIST_FILES_DIR)/,dnsmasq-2.84.tar.xz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,libguestfs-1.44.1.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,xorriso-1.5.4.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,augeas-1.12.0.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,hivex-1.3.21.tar.gz)
dist_files += $(addprefix $(DIST_FILES_DIR)/,guestfs_app-1.40.1.tar.xz)
chroot_tgts += qemu.chroot
chroot_tgts += pixman.chroot
chroot_tgts += libvirt.chroot
chroot_tgts += yajl.chroot
chroot_tgts += iptables.chroot
chroot_tgts += libnftnl.chroot
chroot_tgts += dnsmasq.chroot
chroot_tgts += libguestfs.chroot
chroot_tgts += xorriso.chroot
chroot_tgts += augeas.chroot
chroot_tgts += hivex.chroot
chroot_tgts += guestfs_app.chroot
endif
ifeq ($(enable_mhvtl),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,\
mhvtl-1.5-3_release.tar.gz)
chroot_tgts += mhvtl.chroot
endif
ifeq ($(enable_eio),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,\
EnhanceIO-master_20151029.tar.gz)
chroot_tgts += EnhanceIO.chroot
endif
ifeq ($(enable_btier),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,\
btier-1.3.11.tar.gz)
chroot_tgts += btier.chroot
endif
ifeq ($(enable_memcached),yes)
dist_files += $(addprefix $(DIST_FILES_DIR)/,\
memcached-1.6.17.tar.gz)
chroot_tgts += memcached.chroot
endif
ifeq ($(enable_simple_tui),yes)
tui_cpp_flags += -DSIMPLE_TUI
endif
ifeq ($(enable_tui_eula),yes)
tui_cpp_flags += -DEULA_PROMPT
endif
ifeq ($(enable_qla32),yes)
qla_ini_dir=qla2x00t-32gbit
qla_dir=qla2x00t-32gbit/qla2x00-target
else
qla_ini_dir=qla2x00t
qla_dir=qla2x00t/qla2x00-target
endif
ifeq ($(with_qla2xxx_scst),yes)
chroot_tgts += qla2xxx_scst.chroot
endif
ifeq ($(with_celerity_16_32),yes)
chroot_tgts += celerity_16_32.chroot
endif
ifeq ($(with_atto_scst),yes)
chroot_tgts += atto_scst.chroot
endif
ifeq ($(with_ocs_sdk),yes)
chroot_tgts += ocs_sdk.chroot
endif
ifeq ($(with_uwire),yes)
chroot_tgts += uwire.chroot
endif
ifeq ($(with_mlnx_ofed),yes)
chroot_tgts += mlnx_ofed.chroot
endif
ifeq ($(with_rapiddisk),yes)
chroot_tgts += rapiddisk.chroot
endif
# Handle additional targets via customization directory
ifeq ($(in_chroot),no)
ifeq ($(with_customize_dir),yes)
include $(customize_dir)/addtl_targets.mk
endif
else
ifeq ($(with_customize_dir),yes)
include addtl_targets.mk
endif
endif
# Common variables used throughout
ifeq ($(in_chroot),yes)
tgt_src_dir = $(wildcard /sources/$(basename $(@))-*)
linux_src = $(wildcard /sources/linux-*)
scst_src = $(wildcard /sources/scst-*)
gcc_src = $(wildcard /sources/gcc-*)
chroot_build = /build
else
tgt_src_dir = $(wildcard $(SOURCES_DIR)/$(basename $(@))-*)
linux_src = $(wildcard $(SOURCES_DIR)/linux-*)
scst_src = $(wildcard $(SOURCES_DIR)/scst-*)
gcc_src = $(wildcard $(SOURCES_DIR)/gcc-*)
chroot_build = $(CHROOT_DIR)/build
endif
clean_bootstrap_tgts := $(addprefix clean-,$(bootstrap_tgts))
clean_chroot_tgts := $(addprefix clean-,$(chroot_tgts))
clean_system_tgts := $(addprefix clean-,$(system_tgts))
gcc_ver = $(subst gcc-,,$(notdir $(gcc_src)))
tarball_src_dirs = $(addprefix $(SOURCES_DIR)/,$(subst .tar.xz,,\
$(subst .tar.bz2,,$(subst .tar.gz,,\
$(notdir $(dist_files))))))
img_file := $(BUILD_DIR)/$(pkg_name)-$(esos_ver).img
tar_bz2_img_file := $(img_file).tar.bz2
esos_target = x86_64-esos-linux-gnu
temp_path = /tools/bin:/bin:/usr/bin
dist_file_names = $(subst $(DIST_FILES_DIR)/,,$(dist_files))
find_bs_dist_files = $(filter $(basename $(bs_tgt))-%,$(dist_file_names))
bootstrap_dist_files = $(foreach bs_tgt,$(bootstrap_tgts),\
$(find_bs_dist_files))
bootstrap_info_file := $(BUILD_DIR)/bootstrap_info
bootstrap_md5 = $(shell $(MD5SUM) $(bootstrap_info_file) \
| awk '{ print $$1 }')
bootstrap_repo = http://download.esos-project.com/bootstrap
bootstrap_base = bootstrap-$(bootstrap_md5)
bootstrap_tarball = $(bootstrap_base).tar.xz
bootstrap_checksum = $(bootstrap_base).checksum
# This is used in the chroot environment
export PKG_CONFIG_PATH = /usr/lib/pkgconfig:/usr/share/pkgconfig
# A few common canned command sequences
define check_if_root
$(QUIET) if [ `whoami` != "root" ]; then \
$(ECHO) "### Snap! Ya gotta be root for this part..."; \
exit 1; \
fi
endef
define chroot_only
$(QUIET) if [ "$(in_chroot)" != "yes" ]; then \
$(ECHO) "### Target '$(@)' can only be made in a chroot'd shell!"; \
exit 1; \
fi
endef
define no_chroot
$(QUIET) if [ "$(in_chroot)" = "yes" ]; then \
$(ECHO) "### Target '$(@)' cannot be made in a chroot'd shell!"; \
exit 1; \
fi
endef
define apply_pkg_patch
$(QUIET) if [ ! -d $(tgt_src_dir)/$(notdir $(tgt_src_dir)).patch ]; \
then \
$(PATCH) -d $(tgt_src_dir) -b \
-B $(tgt_src_dir)/$(notdir $(tgt_src_dir)).patch/ -p1 < \
$(chroot_build)/misc/$(notdir $(tgt_src_dir)).patch; \
fi
endef
# Set the PATH variable for default goal or specific targets
ifeq ($(MAKECMDGOALS),)
export PATH = $(temp_path)
else ifneq ($(filter $(MAKECMDGOALS),bootstrap $(bootstrap_tgts)),)
export PATH = $(temp_path)
endif
# all - The default goal; complete everything up to bootstrap'ing.
all:
$(MAKE) -C $(BUILD_DIR) fetch
$(MAKE) -C $(BUILD_DIR) extract
$(MAKE) -C $(BUILD_DIR) pre_bootstrap
$(MAKE) -C $(BUILD_DIR) bootstrap
# clean - Remove chroot directory files and any image/package files.
.PHONY: clean
clean: $(clean_chroot_tgts) $(clean_system_tgts)
$(QUIET) if $(MOUNT) | $(GREP) $(CHROOT_DIR) > /dev/null 2>&1; then \
$(ECHO) "### One or more mounts still exist for chroot!"; \
exit 1; \
fi
cd $(CHROOT_DIR) && $(FIND) . -maxdepth 1 ! -path "." \
! -path "./sources" ! -path "./build" ! -path "./tools" \
-exec $(RM) {} \;
$(RM) $(TOOLS_DIR)/lib/gcc/x86_64-pc-linux-gnu/$(gcc_ver)/specs
$(RM) $(chroot_build)/*
$(RM) $(INITRAMFS_DIR)/*
$(RM) $(SOURCES_DIR)/*
$(RM) $(BUILD_DIR)/VERSION
$(RM) $(BUILD_DIR)/dist_*.txt
$(RM) $(BUILD_DIR)/$(pkg_name)-*.zip
$(RM) $(BUILD_DIR)/$(pkg_name)-*.img
$(RM) $(BUILD_DIR)/$(pkg_name)-*.img.tar.bz2
$(RM) $(BUILD_DIR)/$(pkg_name)-*.iso
$(RM) $(BUILD_DIR)/ChangeLog-*.txt
$(QUIET) $(ECHO) && $(ECHO)
$(QUIET) $(ECHO) "### Successfully cleaned the chroot structure!"
$(QUIET) $(ECHO) && $(ECHO)
$(QUIET) $(ECHO) "### Run './configure' and 'make all' before" \
"building again..."
$(clean_chroot_tgts):: target = $(subst clean-,,$(@))
$(clean_chroot_tgts)::
$(RM) $(chroot_build)/$(target)
$(clean_system_tgts):: target = $(subst clean-,,$(@))
$(clean_system_tgts)::
$(RM) $(chroot_build)/$(target)
clean-esos_tui.chroot::
$(QUIET) if [ -f "$(chroot_build)/tui/Makefile" ]; then \
$(MAKE) --directory=$(chroot_build)/tui clean; \
fi
# clean_bootstrap - Remove bootstrap target files and extracted sources.
.PHONY: clean_bootstrap
clean_bootstrap: $(clean_bootstrap_tgts)
$(RM) $(BUILD_DIR)/chroot_build.sh
$(RM) $(WORK_DIR)/kernel_headers
$(RM) $(WORK_DIR)/binutils-build
$(RM) $(WORK_DIR)/gcc-build
$(RM) $(WORK_DIR)/glibc-build
$(RM) $(WORK_DIR)/libstdc++-build
$(clean_bootstrap_tgts):: target = $(subst clean-,,$(@))
$(clean_bootstrap_tgts)::
$(RM) $(BUILD_DIR)/$(target)
# distclean - Remove everything including build configuration settings.
.PHONY: distclean
distclean: clean clean_bootstrap
$(RM) $(bootstrap_info_file)
$(RM) $(BUILD_DIR)/$(bootstrap_tarball)
$(RM) $(BUILD_DIR)/$(bootstrap_checksum)
$(RM) $(WORK_DIR)
$(RM) $(SRC_DIR)/autom4te.cache
$(RM) $(BUILD_DIR)/config.status
$(RM) $(BUILD_DIR)/configure
$(RM) $(BUILD_DIR)/config.log
$(RM) $(BUILD_DIR)/Makefile
# fetch - Grab all required packages from distribution file repositories.
fetch: $(dist_files) ;
$(dist_files):
$(QUIET) $(ECHO) "### Fetching $(@)"
$(WGET) -P $(DIST_FILES_DIR) $(dist_files_repo)/$(notdir $(@))
$(QUIET) cd $(DIST_FILES_DIR) && \
if ! $(GREP) $(notdir $(@)) $(SRC_DIR)/CHECKSUM.MD5 | \
$(MD5SUM) -c -; then \
$(RM) $(@); \
exit 1; \
fi
$(QUIET) cd $(DIST_FILES_DIR) && \
if ! $(GREP) $(notdir $(@)) $(SRC_DIR)/CHECKSUM.SHA256 | \
$(SHA256SUM) -c -; then \
$(RM) $(@); \
exit 1; \
fi
$(QUIET) $(ECHO)
# extract - Extract all of the previously downloaded packages/archives.
extract: fetch $(tarball_src_dirs) ;
$(tarball_src_dirs): src_file = $(wildcard $(DIST_FILES_DIR)/$(notdir $(@)).*)
$(tarball_src_dirs):
$(QUIET) $(ECHO) "### Extracting $(notdir $(src_file))"
$(QUIET) $(MKDIR) $(SOURCES_DIR)
$(QUIET) if [ "$(suffix $(src_file))" = ".gz" ]; then \
$(TAR) xfz $(src_file) -C $(SOURCES_DIR); \
elif [ "$(suffix $(src_file))" = ".bz2" ]; then \
$(TAR) xfj $(src_file) -C $(SOURCES_DIR); \
elif [ "$(suffix $(src_file))" = ".xz" ]; then \
$(TAR) xfJ $(src_file) -C $(SOURCES_DIR); \
else \
$(ECHO) "### Unhandled file extension: $(suffix $(src_file))"; \
exit 1; \
fi
# symlink - Creates the symbolic link in "/" for the tools directory.
.PHONY: symlink
symlink:
$(call no_chroot)
$(QUIET) if [ -e "/tools" ] && [ ! -L "/tools" ]; then \
$(ECHO) "### The path /tools exists but isn't a symbolic link!"; \
exit 1; \
elif [ -L "/tools" ] && \
[ "$$($(READLINK) -f /tools)" = "$(TOOLS_DIR)" ]; then \
:; \
else \
if [ `whoami` != "root" ]; then \
$(ECHO) "### Snap! Ya gotta be root for this part..."; \
exit 1; \
fi; \
$(RM) /tools; \
$(LN) -v $(TOOLS_DIR) /tools; \
fi
# pre_bootstrap - Fetch/extract a canned bootstrap archive if any exists.
.PHONY: pre_bootstrap
pre_bootstrap: $(bootstrap_info_file)
$(QUIET) if [ ! -e "$(WORK_DIR)/$(bootstrap_tarball)" ]; then \
$(ECHO) "### Attempting to fetch a pre-built bootstrap..."; \
if $(WGET) -P $(WORK_DIR) \
$(bootstrap_repo)/$(bootstrap_tarball); then \
if $(WGET) -P $(WORK_DIR) \
$(bootstrap_repo)/$(bootstrap_checksum); then \
cd $(WORK_DIR); \
if $(SHA256SUM) -c $(bootstrap_checksum); then \
$(ECHO) "### Extracting the pre-built bootstrap archive..."; \
$(TAR) xfJ $(bootstrap_tarball) \
--strip-components=1 -C $(BUILD_DIR); \
else \
$(RM) $(bootstrap_tarball); \
$(RM) $(bootstrap_checksum); \
exit 1; \
fi; \
else \
$(RM) $(WORK_DIR)/$(bootstrap_checksum); \
fi; \
else \
$(RM) $(WORK_DIR)/$(bootstrap_tarball); \
fi; \
fi
$(bootstrap_info_file):
$(QUIET) $(SED) --quiet \
'/^# bootstrap_tgts_start/,/^# bootstrap_tgts_end/p' \
$(BUILD_DIR)/Makefile > $(bootstrap_info_file)
$(QUIET) $(ECHO) "$(bootstrap_dist_files)" >> $(bootstrap_info_file)
# bootstrap - Configure/compile/build the packages for chroot'ing.
.PHONY: bootstrap
bootstrap: symlink $(bootstrap_tgts)
$(QUIET) if [ ! -e "$(WORK_DIR)/$(bootstrap_tarball)" ] && \
[ ! -e "$(BUILD_DIR)/$(bootstrap_tarball)" ]; then \
$(ECHO) "### Generating a bootstrap archive..."; \
cd $(BUILD_DIR) && \
$(TAR) cfJ $(BUILD_DIR)/$(bootstrap_tarball) --hard-dereference \
--transform 'flags=r;s,^,$(bootstrap_base)/,' $(bootstrap_tgts) \
work/chroot/tools; \
cd $(BUILD_DIR) && $(SHA256SUM) $(bootstrap_tarball) > \
$(bootstrap_checksum); \
fi
$(CP) $(BUILD_DIR)/Makefile $(chroot_build)/
$(CP) -Rp $(SRC_DIR)/misc $(SRC_DIR)/tui $(chroot_build)/
$(ECHO) -n "$(if $(build_opts),$(build_opts),N/A)" > \
$(chroot_build)/build_opts
$(ECHO) -n "$(esos_ver)" > $(chroot_build)/esos_ver
$(ECHO) -n "$(git_branch)" > $(chroot_build)/git_branch
$(CP) /etc/passwd /etc/group /etc/resolv.conf $(CHROOT_DIR)/etc/
$(QUIET) for i in bash cat dd echo ln pwd rm stty; do \
if [ ! -e "$(CHROOT_DIR)/bin/$$i" ]; then \
$(LN) -v /tools/bin/$$i $(CHROOT_DIR)/bin; \
fi; \
done
$(QUIET) for i in install perl env; do \
if [ ! -e "$(CHROOT_DIR)/usr/bin/$$i" ]; then \
$(LN) -v /tools/bin/$$i $(CHROOT_DIR)/usr/bin; \
fi; \
done
$(QUIET) for i in libgcc_s.so libgcc_s.so.1 libstdc++.a \
libstdc++.so libstdc++.so.6; do \
if [ ! -e "$(CHROOT_DIR)/usr/lib/$$i" ]; then \
$(LN) -v /tools/lib/$$i $(CHROOT_DIR)/usr/lib; \
fi; \
done
$(QUIET) if [ ! -e "$(CHROOT_DIR)/usr/lib/libstdc++.la" ]; then \
$(SED) 's/tools/usr/' /tools/lib/libstdc++.la > \
$(CHROOT_DIR)/usr/lib/libstdc++.la; \
fi
$(QUIET) if [ ! -e "$(CHROOT_DIR)/bin/sh" ]; then \
$(LN) -v bash $(CHROOT_DIR)/bin/sh; \
fi
$(ECHO) -e "#!/bin/sh\ncleanup() {\n make post_chroot\n}\n\
trap cleanup EXIT\nmake pre_chroot\nchroot \
--userspec=$(shell id -u):$(shell id -g) \
\"$(CHROOT_DIR)\" /build/build_all.sh \
\$$@\nexit \$$?" > \
$(BUILD_DIR)/chroot_build.sh
$(CHMOD) +x $(BUILD_DIR)/chroot_build.sh
$(ECHO) -e "#!/bin/sh\n/tools/bin/env -i\nexport HOME=/\n\
export TERM=$$TERM\nexport PS1='\u:\w\$$ '\n\
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin\n\
export LC_ALL=C\n\
export CFLAGS=\"-Os\"\n\
export CXXFLAGS=\"-Os\"\n\
/tools/bin/make \$$@ -C /build build" > \
$(chroot_build)/build_all.sh
$(CHMOD) +x $(chroot_build)/build_all.sh
# bootstrap_tgts_start - DO NOT DELETE THIS LINE (used by pre_bootstrap)
binutils.pass1:
$(QUIET) $(ECHO) "### Building $(@)"
$(call no_chroot)
$(RM) $(WORK_DIR)/binutils-build
$(MKDIR) $(WORK_DIR)/binutils-build
cd $(WORK_DIR)/binutils-build && \
$(tgt_src_dir)/configure --prefix=/tools --with-sysroot=$(CHROOT_DIR) \
--with-lib-path=/tools/lib --target=$(esos_target) --disable-nls \
--disable-werror
$(MAKE) --directory=$(WORK_DIR)/binutils-build
$(MAKE) --directory=$(WORK_DIR)/binutils-build install
$(LN) -v lib /tools/lib64
$(TOUCH) $(@)
$(QUIET) $(ECHO) "### Done $(@)"
gcc.pass1: binutils.pass1 gmp mpfr mpc
$(QUIET) $(ECHO) "### Building $(@)"
$(call no_chroot)
for file in $(tgt_src_dir)/gcc/config/{linux,i386/linux{,64}}.h; do \
$(CP) -uv $$file{,.orig}; \
$(SED) -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $$file.orig > $$file; \
$(ECHO) -e "#undef STANDARD_STARTFILE_PREFIX_1\n"\
"#undef STANDARD_STARTFILE_PREFIX_2\n"\
"#define STANDARD_STARTFILE_PREFIX_1 \"/tools/lib/\"\n"\
"#define STANDARD_STARTFILE_PREFIX_2 \"\"" >> $$file; \
$(TOUCH) $$file.orig; \
done
$(SED) -e '/m64=/s/lib64/lib/' -i.orig \
$(tgt_src_dir)/gcc/config/i386/t-linux64
$(RM) $(WORK_DIR)/gcc-build
$(MKDIR) $(WORK_DIR)/gcc-build
cd $(WORK_DIR)/gcc-build && $(tgt_src_dir)/configure \
--target=$(esos_target) --prefix=/tools --with-glibc-version=2.11 \
--with-sysroot=$(CHROOT_DIR) --with-newlib --without-headers \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include --disable-nls \
--disable-shared --disable-multilib --disable-decimal-float \
--disable-threads --disable-libatomic --disable-libgomp \
--disable-libmpx --disable-libquadmath --disable-libssp \
--disable-libvtv --disable-libstdcxx --enable-languages=c,c++
$(MAKE) --directory=$(WORK_DIR)/gcc-build
$(MAKE) --directory=$(WORK_DIR)/gcc-build install
$(TOUCH) $(@)
$(QUIET) $(ECHO) "### Done $(@)"
gmp:
$(QUIET) $(ECHO) "### Building $(@)"
$(QUIET) if [ ! -h $(gcc_src)/gmp ]; then \
$(LN) -v ../$(notdir $(tgt_src_dir)) $(gcc_src)/gmp; \
fi
$(TOUCH) $(@)
$(QUIET) $(ECHO) "### Done $(@)"
mpfr:
$(QUIET) $(ECHO) "### Building $(@)"
$(QUIET) if [ ! -h $(gcc_src)/mpfr ]; then \
$(LN) -v ../$(notdir $(tgt_src_dir)) $(gcc_src)/mpfr; \
fi
$(TOUCH) $(@)
$(QUIET) $(ECHO) "### Done $(@)"
mpc:
$(QUIET) $(ECHO) "### Building $(@)"
$(QUIET) if [ ! -h $(gcc_src)/mpc ]; then \
$(LN) -v ../$(notdir $(tgt_src_dir)) $(gcc_src)/mpc; \
fi
$(TOUCH) $(@)
$(QUIET) $(ECHO) "### Done $(@)"
kernel_headers: gcc.pass1
$(QUIET) $(ECHO) "### Building $(@)"
$(call no_chroot)
$(MKDIR) $(WORK_DIR)/kernel_headers
$(MAKE) --directory=$(linux_src) mrproper
$(MAKE) --directory=$(linux_src) \
INSTALL_HDR_PATH="$(WORK_DIR)/kernel_headers" headers_install
$(CP) -rv $(WORK_DIR)/kernel_headers/include/* $(TOOLS_DIR)/include/
$(TOUCH) $(@)
$(QUIET) $(ECHO) "### Done $(@)"
glibc: binutils.pass1 gcc.pass1 kernel_headers
$(QUIET) $(ECHO) "### Building $(@)"
$(call no_chroot)
$(RM) $(WORK_DIR)/glibc-build
$(MKDIR) $(WORK_DIR)/glibc-build
cd $(WORK_DIR)/glibc-build && \
$(tgt_src_dir)/configure --prefix=/tools --host=$(esos_target) \
--build=$$($(tgt_src_dir)/scripts/config.guess) \
--enable-kernel=3.2 --with-headers=/tools/include
$(MAKE) --directory=$(WORK_DIR)/glibc-build
$(MAKE) --directory=$(WORK_DIR)/glibc-build install
$(TOUCH) $(@)
$(QUIET) $(ECHO) "### Done $(@)"
gcc.libstdc++: glibc
$(QUIET) $(ECHO) "### Building $(@)"
$(call no_chroot)
$(RM) $(WORK_DIR)/libstdc++-build
$(MKDIR) $(WORK_DIR)/libstdc++-build
cd $(WORK_DIR)/libstdc++-build && \
$(tgt_src_dir)/libstdc++-v3/configure --host=$(esos_target) \
--prefix=/tools --disable-multilib --disable-nls \
--disable-libstdcxx-threads --disable-libstdcxx-pch \
--with-gxx-include-dir=/tools/$(esos_target)/include/c++/$(gcc_ver)
$(MAKE) --directory=$(WORK_DIR)/libstdc++-build