summaryrefslogtreecommitdiffstats
path: root/build
blob: f861cd6eed71ed1cab7c16ac49e7e3262d9f666c (plain)
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
#! /usr/bin/make -f

PKGS = libc.6 libc.6-dev \
       libc-bin libc-dev-bin nscd \
       locales zoneinfo \
       eglibc-doc \

prefix = /usr
bindir = $(prefix)/bin
sbindir = $(prefix)/sbin
libexecdir = $(prefix)/lib
sysconfdir = /etc
libdir = /usr/lib
includedir = $(prefix)/include
datarootdir = $(prefix)/share
datadir = $(prefix)/share
infodir = $(prefix)/share/info
localedir = $(prefix)/lib/locale
mandir = $(prefix)/share/man
docdir = $(prefix)/share/doc
rootsbindir = /sbin
rtlddir = /lib
slibdir = /lib

$(PKGS): eglibc.stamp

.SILENT: eglibc.setup.stamp
eglibc.setup.stamp:
	cd src/libc && \
		ln -s ../ports ports
	mkdir libcbuild
	touch eglibc.setup.stamp

.SILENT: eglibc.configure.stamp
eglibc.configure.stamp: eglibc.setup.stamp
	cd libcbuild && \
		rm -f config.cache && \
		echo 'libc_cv_forced_unwind=yes' >> config.cache && \
		echo 'libc_cv_c_cleanup=yes' >> config.cache && \
		echo 'libc_cv_gnu89_inline=yes' >> config.cache && \
		echo 'libc_cv_ssp=no' >> config.cache && \
		rm -f configparams && \
		echo 'bindir = $(bindir)' >> configparams && \
		echo 'sbindir = $(sbindir)' >> configparams && \
		echo 'libexecdir = $(libexecdir)' >> configparams && \
		echo 'sysconfdir = $(sysconfdir)' >> configparams && \
		echo 'libdir = $(libdir)' >> configparams && \
		echo 'includedir = $(includedir)' >> configparams && \
		echo 'datarootdir = $(datarootdir)' >> configparams && \
		echo 'datadir = $(datadir)' >> configparams && \
		echo 'infodir = $(infodir)' >> configparams && \
		echo 'localedir = $(localedir)' >> configparams && \
		echo 'mandir = $(mandir)' >> configparams && \
		echo 'docdir = $(docdir)' >> configparams && \
		echo 'rootsbindir = $(rootsbindir)' >> configparams && \
		echo 'rtlddir = $(rtlddir)' >> configparams && \
		echo 'slibdir = $(slibdir)' >> configparams && \
		echo "install_root = $$(pwd)/../dest" >> configparams && \
		if [ -n "$${TOOLS_PREFIX}" ]; then \
			BINUTILS=--with-binutils=$${TOOLS_PREFIX}/bin; \
		else \
			BINUTILS=; \
		fi && \
		BUILD_CC=gcc BUILD_CXX=g++ ../src/libc/configure \
			--prefix=/usr \
			--bindir=$(bindir) --sbindir=$(sbindir) \
			--libexecdir=$(libexecdir) --sysconfdir=$(sysconfdir) \
			--libdir=$(libdir) --includedir=$(includedir) \
			--datarootdir=$(datarootdir) --datadir=$(datadir) \
			--infodir=$(infodir) --localedir=$(localedir) \
			--mandir=$(mandir) --docdir=$(docdir) \
			--build=$${OH_BUILD_ARCH_GNU} --host=$${OH_HOST_ARCH_GNU} \
			--disable-profile --enable-add-ons \
			--enable-kernel=3.2.0 \
			--with-tls --with-__thread --without-cvs \
			--without-selinux --without-gd \
			$${BINUTILS} \
			--with-headers=$${HEADERS_PREFIX}/usr/include \
			--cache-file=config.cache
	touch eglibc.configure.stamp

.SILENT: eglibc.build.stamp
eglibc.build.stamp: eglibc.configure.stamp
	cd libcbuild && \
		make -j $${JOBS:-1}
	touch eglibc.build.stamp

.SILENT: eglibc.install.stamp
eglibc.install.stamp: eglibc.build.stamp
	cd libcbuild && \
		make install_root=$$(pwd)/../dest install
	rm dest/var/db/Makefile \
		dest/sbin/sln \
		dest/usr/bin/makedb \
		dest/usr/bin/pcprofiledump \
		dest/usr/bin/xtrace
	rm -Rf dest/usr/lib/*_pic*
	mkdir -p dest/usr/share/doc/eglibc-doc && \
		cp -Rp src/libc/ChangeLog* \
			dest/usr/share/doc/eglibc-doc
	mkdir -p dest/usr/share/doc/eglibc-doc/libidn && \
		cp -Rp src/libc/libidn/ChangeLog* \
			dest/usr/share/doc/eglibc-doc/libidn
	mkdir -p dest/usr/share/doc/eglibc-doc/localedata && \
		cp -Rp src/libc/localedata/ChangeLog* \
			dest/usr/share/doc/eglibc-doc/localedata
	mkdir -p dest/usr/share/doc/eglibc-doc/nptl && \
		cp -Rp src/libc/nptl/ChangeLog* \
			dest/usr/share/doc/eglibc-doc/nptl
	mkdir -p dest/usr/share/doc/eglibc-doc/nptl_db && \
		cp -Rp src/libc/nptl_db/ChangeLog* \
			dest/usr/share/doc/eglibc-doc/nptl_db
	touch eglibc.install.stamp
	bash

	#mkdir localesbuild
	#cd localesbuild && \
	#	CPPFLAGS=-DNOT_IN_libc ../src/localedef/configure \
	#		--prefix=$$(pwd)/../dest/usr \
	#		--with-glibc=../src/libc && \
	#	make && \
	#	make SUPPORTED-LOCALES='\
	#		de_DE.UTF-8/UTF-8 de_DE/ISO-8859-1 de_DE@euro/ISO-8859-15 \
	#		en_HK.UTF-8/UTF-8 en_HK/ISO-8859-1 \
	#		en_PH.UTF-8/UTF-8 en_PH/ISO-8859-1 \
	#		en_US.UTF-8/UTF-8 en_US/ISO-8859-1 \
	#		es_MX.UTF-8/UTF-8 es_MX/ISO-8859-1 \
	#		fa_IR/UTF-8 \
	#		fr_FR.UTF-8/UTF-8 fr_FR/ISO-8859-1 fr_FR@euro/ISO-8859-15 \
	#		it_IT.UTF-8/UTF-8 it_IT/ISO-8859-1 \
	#		ja_JP.EUC-JP/EUC-JP ja_JP.UTF-8/UTF-8' install-locales

	#oh-strip -gl /usr/bin /usr/lib/*

.SILENT: eglibc.stamp
eglibc.stamp: eglibc.install.stamp
	oh-installfiles $(PKGS)
	oh-installdocs libc.6
	oh-gencontrol $(PKGS)
	oh-buildopk $(PKGS)
	touch eglibc.stamp