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

Collapse All | Expand All

(-)uclibc-0.9.28.3-r2.ebuild (-65 / +74 lines)
Lines 1-6 Link Here
1
# Copyright 1999-2008 Gentoo Foundation
1
# Copyright 1999-2008 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.28.3-r2.ebuild,v 1.2 2008/01/08 07:32:43 vapier Exp $
3
# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.29.ebuild,v 1.2 2008/01/08 07:32:43 vapier Exp $
4
4
5
#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc"
5
#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc"
6
#inherit subversion
6
#inherit subversion
Lines 21-27 Link Here
21
21
22
MY_P=uClibc-${PV}
22
MY_P=uClibc-${PV}
23
SVN_VER=""
23
SVN_VER=""
24
PATCH_VER="1.2"
24
#PATCH_VER="1.2"
25
DESCRIPTION="C library for developing embedded Linux systems"
25
DESCRIPTION="C library for developing embedded Linux systems"
26
HOMEPAGE="http://www.uclibc.org/"
26
HOMEPAGE="http://www.uclibc.org/"
27
SRC_URI="mirror://kernel/linux/libs/uclibc/${MY_P}.tar.bz2
27
SRC_URI="mirror://kernel/linux/libs/uclibc/${MY_P}.tar.bz2
Lines 56-64 Link Here
56
	if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \
56
	if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \
57
	   || [[ -n ${UCLIBC_AND_GLIBC} ]]
57
	   || [[ -n ${UCLIBC_AND_GLIBC} ]]
58
	then
58
	then
59
		echo /usr
59
		echo /usr/include
60
	else
60
	else
61
		echo /usr/${CTARGET}/usr
61
		echo /usr/${CTARGET}/usr/include
62
	fi
62
	fi
63
}
63
}
64
just_headers() {
64
just_headers() {
Lines 69-75 Link Here
69
	# XXX: this wont work for a toolchain which is bi-endian, but we
69
	# XXX: this wont work for a toolchain which is bi-endian, but we
70
	#      dont have any such thing at the moment, so not a big deal
70
	#      dont have any such thing at the moment, so not a big deal
71
	touch "${T}"/endian.s
71
	touch "${T}"/endian.s
72
	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
72
	$(tc-getAS) "${T}"/endian.s -o "${T}"/endian.o
73
	case $(file "${T}"/endian.o) in
73
	case $(file "${T}"/endian.o) in
74
		*" MSB "*) echo "big";;
74
		*" MSB "*) echo "big";;
75
		*" LSB "*) echo "little";;
75
		*" LSB "*) echo "little";;
Lines 102-114 Link Here
102
102
103
CPU_ALPHA=""
103
CPU_ALPHA=""
104
CPU_AMD64=""
104
CPU_AMD64=""
105
CPU_ARM="GENERIC_ARM ARM{610,710,720T,920T,922T,926T,_{SA110,SA1100,XSCALE}}"
105
CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT}}"
106
CPU_IA64=""
106
CPU_IA64=""
107
CPU_M68K=""
107
CPU_M68K=""
108
CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}}"
108
CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}} MIPS_{N64,O32,N32}_ABI"
109
CPU_PPC=""
109
CPU_PPC=""
110
CPU_SH="SH{2,3,4,5}"
110
CPU_SH="SH{2,3,4,5}"
111
CPU_SPARC=""
111
CPU_SPARC="SPARC_V{7,8,9,9B}"
112
CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH"
112
CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH"
113
IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}"
113
IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}"
114
114
Lines 142-147 Link Here
142
	fi
142
	fi
143
}
143
}
144
144
145
set_opt() {
146
	sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config
147
	echo "$1=$2" >> .config
148
}
149
145
src_unpack() {
150
src_unpack() {
146
	[[ -n ${ESVN_REPO_URI} ]] \
151
	[[ -n ${ESVN_REPO_URI} ]] \
147
		&& subversion_src_unpack \
152
		&& subversion_src_unpack \
Lines 175-180 Link Here
175
		epatch "${WORKDIR}"/patch/math
180
		epatch "${WORKDIR}"/patch/math
176
	fi
181
	fi
177
182
183
	epatch "${FILESDIR}/${P}-inet_network.patch"
184
	epatch "${FILESDIR}/${P}-net-tools_compile.patch"
185
178
	########## CPU SELECTION ##########
186
	########## CPU SELECTION ##########
179
187
180
	local target config_target
188
	local target config_target
Lines 191-239 Link Here
191
		x86)   target="i386";    config_target="GENERIC_386";;
199
		x86)   target="i386";    config_target="GENERIC_386";;
192
		*)     die "$(tc-arch) lists no defaults :/";;
200
		*)     die "$(tc-arch) lists no defaults :/";;
193
	esac
201
	esac
194
	sed -i -e "s:default TARGET_i386:default TARGET_${target}:" \
195
		extra/Configs/Config.in
196
	sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
202
	sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
197
		extra/Configs/Config.${target}
203
		extra/Configs/Config.${target}
204
	sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
198
205
199
	########## CONFIG SETUP ##########
206
	########## CONFIG SETUP ##########
200
207
201
	make defconfig >/dev/null || die "could not config"
208
	make ARCH=${target} defconfig >/dev/null || die "could not config"
202
209
203
	for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} ; do
210
	for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} ; do
204
		sed -i -e "s:${def}=y:# ${def} is not set:" .config
211
		sed -i -e "s:${def}=y:# ${def} is not set:" .config
205
	done
212
	done
206
	if use debug ; then
213
	if use debug ; then
207
		#echo "SUPPORT_LD_DEBUG_EARLY=y" >> .config
214
		set_opt SUPPORT_LD_DEBUG y
208
		echo "SUPPORT_LD_DEBUG=y" >> .config
215
		set_opt DODEBUG y
209
		echo "DODEBUG=y" >> .config
210
		#echo "DODEBUG_PT=y" >> .config
211
	fi
216
	fi
212
217
213
	sed -i -e '/ARCH_.*_ENDIAN/d' .config
218
	sed -i -e '/ARCH_.*_ENDIAN/d' .config
214
	echo "ARCH_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN=y" >> .config
219
	set_opt "ARCH_WANTS_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN" y
215
220
216
	if [[ $(tc-is-softfloat) != "no" ]] ; then
221
	if [[ $(tc-is-softfloat) != "no" ]] ; then
217
		sed -i -e '/^HAS_FPU=y$/d' .config
222
		set_opt UCLIBC_HAS_FPU n
218
		echo 'HAS_FPU=n' >> .config
219
	fi
223
	fi
220
224
221
	local moredefs="DL_FINI_CRT_COMPAT"
225
	local moredefs="COMPAT_ATEXIT"
222
	# We need todo this for a few months. .28 is a major upgrade.
226
	local compat_sym=atexit
227
228
	# We need todo this for a few months. .29 is a major upgrade.
223
	# Don't do it from cross-compiling case though
229
	# Don't do it from cross-compiling case though
224
	if ! use uclibc-compat ; then
230
	if ! use uclibc-compat ; then
225
		if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \
231
		if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \
226
		   ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then
232
		   ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then
227
			local fnames=""
233
			local fnames=""
228
			einfo "Doing a scanelf in paths for bins containing the __uClibc_start_main symbol"
234
			einfo "Doing a scanelf in paths for bins containing the ${compat_sym} symbol"
229
			fnames=$(scanelf -pyqs__uClibc_start_main -F%F#s)
235
			fnames=$(scanelf -pyqs${compat_sym} -F%F#s)
230
			if [[ -z ${fnames} ]] ; then
236
			if [[ -z ${fnames} ]] ; then
231
				einfo "This system is clean."
237
				einfo "This system is clean."
232
				einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1"
238
				einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1"
233
				moredefs=""
239
				moredefs=""
234
			else
240
			else
235
				ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled."
241
				ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled."
236
				ewarn "qfile ${fnames}"
242
				ewarn "qfile -Cq $(echo ${fnames}) | sort | uniq"
237
				echo
243
				echo
238
				ewarn "Leaving on ${moredefs}"
244
				ewarn "Leaving on ${moredefs}"
239
			fi
245
			fi
Lines 241-268 Link Here
241
			moredefs=""
247
			moredefs=""
242
		fi
248
		fi
243
	fi
249
	fi
244
	for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} ; do
250
	if [[ "x${UCLIBC_CONFIGURATION}" != "x" ]] ; then
245
		sed -i -e "s:# ${def} is not set:${def}=y:" .config
251
		read -r -a UCLIB_CONF <<< "${UCLIBC_CONFIGURATION}"
252
		for conf in ${UCLIB_CONF[@]} ; do
253
			set_opt ${conf%%=*} ${conf#*=}
254
		done
255
	fi
256
	for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} ; do
257
		set_opt "${def}" y
246
	done
258
	done
247
	echo "UCLIBC_HAS_FULL_RPC=y" >> .config
259
	set_opt UCLIBC_HAS_CTYPE_UNSAFE n
248
	echo "PTHREADS_DEBUG_SUPPORT=y" >> .config
260
	set_opt UCLIBC_HAS_REENTRANT_RPC n
249
	echo "UCLIBC_HAS_TZ_FILE_READ_MANY=n" >> .config
261
	set_opt PTHREADS_DEBUG_SUPPORT y
262
	set_opt UCLIBC_HAS_TZ_FILE_READ_MANY n
263
	set_opt UCLIBC_SUSV3_LEGACY y
264
	set_opt UCLIBC_SUSV3_LEGACY_MACROS y
250
265
251
	if use iconv ; then
266
	if use iconv ; then
252
		sed -i -e "s:# UCLIBC_HAS_LOCALE is not set:UCLIBC_HAS_LOCALE=y:" .config
267
		set_opt UCLIBC_HAS_LOCALE y
253
		echo "UCLIBC_HAS_XLOCALE=n" >> .config
268
		set_opt UCLIBC_HAS_XLOCALE n
254
		echo "UCLIBC_HAS_GLIBC_DIGIT_GROUPING=y" >> .config
269
		set_opt UCLIBC_HAS_GLIBC_DIGIT_GROUPING y
255
		echo "UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING=y" >> .config
270
		set_opt UCLIBC_HAS_SCANF_LENIENT_DIGIT_GROUPING y
256
271
257
		if use nls ; then
272
		if use nls ; then
258
			echo "UCLIBC_HAS_GETTEXT_AWARENESS=y" >> .config
273
			set_opt UCLIBC_HAS_GETTEXT_AWARENESS y
259
		else
274
		else
260
			echo "UCLIBC_HAS_GETTEXT_AWARENESS=n" >> .config
275
			set_opt UCLIBC_HAS_GETTEXT_AWARENESS n
261
		fi
276
		fi
262
277
263
		if use pregen ; then
278
		if use pregen ; then
264
			echo "UCLIBC_PREGENERATED_LOCALE_DATA=y" >> .config
279
			set_opt UCLIBC_PREGENERATED_LOCALE_DATA y
265
			echo "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=y" >> .config
280
			set_opt UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA y
266
			if use userlocales ; then
281
			if use userlocales ; then
267
				cp "${DISTDIR}"/${MY_P}-user-locale.tar.gz \
282
				cp "${DISTDIR}"/${MY_P}-user-locale.tar.gz \
268
					extra/locale/uClibc-locale-030818.tgz \
283
					extra/locale/uClibc-locale-030818.tgz \
Lines 273-326 Link Here
273
					|| die "could not copy locale"
288
					|| die "could not copy locale"
274
			fi
289
			fi
275
		else
290
		else
276
			echo "UCLIBC_PREGENERATED_LOCALE_DATA=n" >> .config
291
			set_opt UCLIBC_PREGENERATED_LOCALE_DATA n
277
		fi
292
		fi
278
	else
293
	else
279
		echo "UCLIBC_HAS_LOCALE=n" >> .config
294
		set_opt UCLIBC_HAS_LOCALE n
280
	fi
295
	fi
281
296
282
	use ipv6 && sed -i -e "s:# UCLIBC_HAS_IPV6 is not set:UCLIBC_HAS_IPV6=y:" .config
297
	use ipv6 && set_opt UCLIBC_HAS_IPV6 y
283
298
284
	# uncomment if you miss wordexp (alsa-lib)
299
	use wordexp && set_opt UCLIBC_HAS_WORDEXP y
285
	use wordexp && sed -i -e "s:# UCLIBC_HAS_WORDEXP is not set:UCLIBC_HAS_WORDEXP=y:" .config
286
300
287
	# we need to do it independently of hardened to get ssp.c built into libc
301
	# we need to do it independently of hardened to get ssp.c built into libc
288
	sed -i -e "s:# UCLIBC_SECURITY.*:UCLIBC_SECURITY=y:" .config
302
	set_opt UCLIBC_HAS_SSP y
289
	echo "UCLIBC_HAS_SSP=y" >> .config
303
	set_opt UCLIBC_HAS_SSP_COMPAT y
290
	echo "SSP_USE_ERANDOM=n" >> .config
304
	set_opt UCLIBC_HAS_ARC4RANDOM y
291
	echo "PROPOLICE_BLOCK_ABRT=n" >> .config
305
	set_opt PROPOLICE_BLOCK_ABRT n
292
	if use debug ; then
306
	set_opt PROPOLICE_BLOCK_SEGV y
293
		echo "PROPOLICE_BLOCK_SEGV=y" >> .config
294
		echo "PROPOLICE_BLOCK_KILL=n" >> .config
295
	else
296
		echo "PROPOLICE_BLOCK_SEGV=n" >> .config
297
		echo "PROPOLICE_BLOCK_KILL=y" >> .config
298
	fi
299
307
300
	# arm/mips do not emit PT_GNU_STACK, but if we enable this here
308
	# arm/mips do not emit PT_GNU_STACK, but if we enable this here
301
	# it will be emitted as RWE, ppc has to be checked, x86 needs it
309
	# it will be emitted as RWE, ppc has to be checked, x86 needs it
302
	# this option should be used independently of hardened
310
	# this option should be used independently of hardened
303
	# relro could be also moved out of hardened
311
	# relro could be also moved out of hardened
304
	if has $(tc-arch) x86 ; then
312
	if has $(tc-arch) x86 ; then
305
		echo "UCLIBC_BUILD_NOEXECSTACK=y" >> .config
313
		set_opt UCLIBC_BUILD_NOEXECSTACK y
306
	else
314
	else
307
		echo "UCLIBC_BUILD_NOEXECSTACK=n" >> .config
315
		set_opt UCLIBC_BUILD_NOEXECSTACK n
308
	fi
316
	fi
309
	echo "UCLIBC_BUILD_RELRO=y" >> .config
317
	set_opt UCLIBC_BUILD_RELRO y
310
	if use hardened ; then
318
	if use hardened ; then
311
		if has $(tc-arch) ${PIE_STABLE} ; then
319
		if has $(tc-arch) ${PIE_STABLE} ; then
312
			echo "UCLIBC_BUILD_PIE=y" >> .config
320
			set_opt UCLIBC_BUILD_PIE y
313
		else
321
		else
314
			echo "UCLIBC_BUILD_PIE=n" >> .config
322
			set_opt UCLIBC_BUILD_PIE n
315
		fi
323
		fi
316
		echo "SSP_QUICK_CANARY=n" >> .config
324
		set_opt SSP_QUICK_CANARY n
317
		echo "UCLIBC_BUILD_SSP=y" >> .config
325
		set_opt UCLIBC_BUILD_SSP y
318
		echo "UCLIBC_BUILD_NOW=y" >> .config
326
		set_opt UCLIBC_BUILD_NOW y
319
	else
327
	else
320
		echo "UCLIBC_BUILD_PIE=n" >> .config
328
		set_opt UCLIBC_BUILD_PIE n
321
		echo "SSP_QUICK_CANARY=y" >> .config
329
		set_opt SSP_QUICK_CANARY y
322
		echo "UCLIBC_BUILD_SSP=n" >> .config
330
		set_opt UCLIBC_BUILD_SSP n
323
		echo "UCLIBC_BUILD_NOW=n" >> .config
331
		set_opt UCLIBC_BUILD_NOW n
324
	fi
332
	fi
325
333
326
	# Allow users some custom control over the config
334
	# Allow users some custom control over the config
Lines 343-352 Link Here
343
	type -p ${cross}ar > /dev/null || cross=""
351
	type -p ${cross}ar > /dev/null || cross=""
344
	sed -i \
352
	sed -i \
345
		-e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \
353
		-e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \
346
		-e "/^KERNEL_SOURCE/s:=.*:=\"$(alt_build_kprefix)\":" \
354
		-e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
347
		-e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
355
		-e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
348
		-e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
356
		-e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
349
		-e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
357
		-e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
358
		-e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
350
		.config || die
359
		.config || die
351
360
352
	yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig"
361
	yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig"

Return to bug 182094