Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 532390 | Differences between
and this patch

Collapse All | Expand All

(-)a/sys-libs/newlib/newlib-9999.ebuild (-1 / +48 lines)
Lines 29-38 HOMEPAGE="http://sourceware.org/newlib/" Link Here
29
29
30
LICENSE="NEWLIB LIBGLOSS GPL-2"
30
LICENSE="NEWLIB LIBGLOSS GPL-2"
31
SLOT="0"
31
SLOT="0"
32
IUSE="nls threads unicode crosscompile_opts_headers-only"
32
IUSE="nls threads unicode crosscompile_opts_headers-only newlib-nano"
33
RESTRICT="strip"
33
RESTRICT="strip"
34
34
35
NEWLIBBUILD="${WORKDIR}/build"
35
NEWLIBBUILD="${WORKDIR}/build"
36
NEWLIBNANOBUILD="${WORKDIR}/build.nano"
37
NEWLIBNANOTMPINSTALL="${WORKDIR}/nano_tmp_install"
36
38
37
pkg_setup() {
39
pkg_setup() {
38
	# Reject newlib-on-glibc type installs
40
	# Reject newlib-on-glibc type installs
Lines 65-81 src_configure() { Link Here
65
	econf \
67
	econf \
66
		$(use_enable unicode newlib-mb) \
68
		$(use_enable unicode newlib-mb) \
67
		$(use_enable nls) \
69
		$(use_enable nls) \
70
		--enable-newlib-io-long-long \
71
		--enable-newlib-register-fini \
68
		${myconf}
72
		${myconf}
73
74
	# Build newlib-nano beside newlib (original)
75
	# Based on https://tracker.debian.org/media/packages/n/newlib/rules-2.1.0%2Bgit20140818.1a8323b-2
76
	if use newlib-nano ; then
77
		mkdir -p "${NEWLIBNANOBUILD}"
78
		cd "${NEWLIBNANOBUILD}"
79
80
		ECONF_SOURCE=${S} \
81
		econf \
82
			$(use_enable unicode newlib-mb) \
83
			$(use_enable nls) \
84
			--enable-newlib-reent-small \
85
			--disable-newlib-fvwrite-in-streamio \
86
			--disable-newlib-fseek-optimization \
87
			--disable-newlib-wide-orient \
88
			--enable-newlib-nano-malloc \
89
			--disable-newlib-unbuf-stream-opt \
90
			--enable-lite-exit \
91
			--enable-newlib-global-atexit \
92
			--enable-newlib-nano-formatted-io \
93
			${myconf}
94
	fi
69
}
95
}
70
96
71
src_compile() {
97
src_compile() {
72
	emake -C "${NEWLIBBUILD}"
98
	emake -C "${NEWLIBBUILD}"
99
	use newlib-nano && emake -C "${NEWLIBNANOBUILD}"
73
}
100
}
74
101
75
src_install() {
102
src_install() {
76
	cd "${NEWLIBBUILD}"
103
	cd "${NEWLIBBUILD}"
77
	emake -j1 DESTDIR="${D}" install
104
	emake -j1 DESTDIR="${D}" install
78
#	env -uRESTRICT CHOST=${CTARGET} prepallstrip
105
#	env -uRESTRICT CHOST=${CTARGET} prepallstrip
106
107
	if use newlib-nano ; then
108
		cd "${NEWLIBNANOBUILD}"
109
		emake -j1 DESTDIR="${NEWLIBNANOTMPINSTALL}" install
110
		# Rename nano lib* files to lib*_nano and move to the real ${D}
111
		# Avoid dependency on perl-rename by using a for loop instead.
112
		local nanolibfiles=""
113
		nanolibfiles=$(find "${NEWLIBNANOTMPINSTALL}" -regex ".*/lib\(c\|g\|rdimon\)\.a" -print)
114
		for f in ${nanolibfiles}; do
115
			local l="${f##${NEWLIBNANOTMPINSTALL}}"
116
			echo mv "${f}" "${D}/${l%%\.a}_nano.a"
117
			mv "${f}" "${D}/${l%%\.a}_nano.a"
118
		done
119
		# Move nano's version of newlib.h to nano/newlib.h
120
		mkdir -p ${D}/usr/${CTARGET}/include/nano
121
		mv ${NEWLIBNANOTMPINSTALL}/usr/${CTARGET}/include/newlib.h \
122
			${D}/usr/${CTARGET}/include/nano/newlib.h
123
124
	fi
125
79
	# minor hack to keep things clean
126
	# minor hack to keep things clean
80
	rm -fR "${D}"/usr/share/info
127
	rm -fR "${D}"/usr/share/info
81
	rm -fR "${D}"/usr/info
128
	rm -fR "${D}"/usr/info

Return to bug 532390