SPECS (LINUX_2_6_22): uClibc.spec - sanitize building

glen glen at pld-linux.org
Wed Apr 2 09:00:26 CEST 2008


Author: glen                         Date: Wed Apr  2 07:00:26 2008 GMT
Module: SPECS                         Tag: LINUX_2_6_22
---- Log message:
- sanitize building

---- Files affected:
SPECS:
   uClibc.spec (1.153.2.3 -> 1.153.2.4) 

---- Diffs:

================================================================
Index: SPECS/uClibc.spec
diff -u SPECS/uClibc.spec:1.153.2.3 SPECS/uClibc.spec:1.153.2.4
--- SPECS/uClibc.spec:1.153.2.3	Wed Apr  2 01:52:05 2008
+++ SPECS/uClibc.spec	Wed Apr  2 09:00:21 2008
@@ -1,9 +1,12 @@
 # $Revision$, $Date$
+# TODO
+# - fix shared in ix86 not to flip/flop functionality
+# - fix shared on amd64
 #
 # Conditional build:
 %bcond_without	shared		# don't build shared lib support
 #
-%ifarch %{x8664}
+%ifarch %{x8664} %{ix86}
 %undefine	with_shared
 %endif
 #
@@ -34,8 +37,6 @@
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		uclibc_root	/usr/%{_target_cpu}-linux-uclibc
-# note: the 2nd '\' is needed (some shell expansions?)
-%define		TARGET_ARCH	%(echo %{_target_cpu} | sed -e 's/i.86\\|athlon\\|pentium./i386/;s/ppc/powerpc/;s/amd64\\|ia32e/x86_64/')
 
 %description
 Small libc for building embedded applications.
@@ -81,70 +82,95 @@
 # check if it's needed now... ldso is broken on sparc anyway
 #%patch5 -p1
 
-sed -i -e '
-%ifarch sparc sparcv9
-	s/default TARGET_i386/default TARGET_sparc/
+# ARCH is already determined by uname -m
+%ifarch %{ix86}
+defconfig=extra/Configs/defconfigs/i386
+%ifarch i386
+echo 'CONFIG_386=y' >> $defconfig
 %endif
-%ifarch alpha
-	s/default TARGET_i386/default TARGET_alpha/
+%ifarch i486
+echo 'CONFIG_486=y' >> $defconfig
+%endif
+%ifarch i586
+echo 'CONFIG_586=y' >> $defconfig
+%endif
+%ifarch i686
+echo 'CONFIG_686=y' >> $defconfig
+%endif
+%ifarch pentium3
+echo 'CONFIG_PENTIUMIII=y' >> $defconfig
+%endif
+%ifarch pentium4
+echo 'CONFIG_PENTIUM4=y' >> $defconfig
+%endif
+%ifarch athlon
+echo 'CONFIG_K7=y' >> $defconfig
 %endif
-%ifarch ppc ppc64
-	s/default TARGET_i386/default TARGET_powerpc/
 %endif
 %ifarch %{x8664}
-	s/default TARGET_i386/default TARGET_x86_64/
+defconfig=extra/Configs/defconfigs/x86_64
+%endif
+%ifarch alpha
+defconfig=extra/Configs/defconfigs/alpha
+%endif
+%ifarch sparc sparcv9
+defconfig=extra/Configs/defconfigs/sparc
+%endif
+%ifarch ppc
+defconfig=extra/Configs/defconfigs/powerpc
+%endif
+%ifarch ia64
+defconfig=extra/Configs/defconfigs/ia64
 %endif
-	' extra/Configs/Config.in
+
+cat <<'EOF' >> $defconfig
+UCLIBC_HAS_IPV6=y
+DO_C99_MATH=y
+UCLIBC_HAS_RPC=y
+# UCLIBC_HAS_FULL_RPC is not set
+# UCLIBC_HAS_REENTRANT_RPC is not set
+UCLIBC_HAS_SYS_SIGLIST=y
+SHARED_LIB_LOADER_PREFIX="$(RUNTIME_PREFIX)/lib"
+%if %{without shared}
+HAVE_NO_SHARED=y
+# HAVE_SHARED is not set
+%endif
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_SUSV3_LEGACY=y
+UCLIBC_SUSV3_LEGACY_MACROS=y
+# DOSTRIP is not set
+%{?debug:DODEBUG=y}
+%{?debug:SUPPORT_LD_DEBUG=y}
+%{?debug:SUPPORT_LD_DEBUG_EARLY=y}
+EOF
 
 %build
-%{__make} -j1 defconfig \
-	TARGET_ARCH="%{TARGET_ARCH}" \
+# NOTE: 'defconfig' and 'all' must be run in separate make process because of macros
+%{__make} defconfig \
 	TARGET_CPU="%{_target_cpu}" \
-	KERNEL_SOURCE=%{_prefix} \
 	HOSTCC="%{__cc}" \
 	HOSTCFLAGS="%{rpmcflags} %{rpmldflags}" \
-	OPTIMIZATION="%{rpmcflags} -Os" \
-	CC="%{__cc}"
+	CC="%{__cc}" \
+	OPTIMIZATION="%{rpmcflags} -Os"
 
-sed -i -e '
-	s/^.*UCLIBC_HAS_IPV6.*$/UCLIBC_HAS_IPV6=y/;
-	s/^.*DO_C99_MATH.*$/DO_C99_MATH=y/;
-	s/^.*UCLIBC_HAS_RPC.*/UCLIBC_HAS_RPC=y\n# UCLIBC_HAS_FULL_RPC is not set\n# UCLIBC_HAS_REENTRANT_RPC is not set/;
-	s/^.*UCLIBC_HAS_SYS_SIGLIST.*$/UCLIBC_HAS_SYS_SIGLIST=y/;
-	s,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX="$(RUNTIME_PREFIX)/lib",
-%if %{without shared}
-	s/^\(HAVE_SHARED\)=y/# \1 is not set/;
-%endif
-	s/^.*UCLIBC_HAS_PRINTF_M_SPEC.*$/UCLIBC_HAS_PRINTF_M_SPEC=y/;
-	s/^.*UCLIBC_SUSV3_LEGACY.*$/UCLIBC_SUSV3_LEGACY=y\nUCLIBC_SUSV3_LEGACY_MACROS=y/;
-	s/^.*\<DOSTRIP\>.*$/# DOSTRIP is not set/;
-%{?debug:s/^.*\<DODEBUG\>.*$/DODEBUG=y/;s/^.*SUPPORT_LD_DEBUG\>.*$/SUPPORT_LD_DEBUG=y/;s/^.*SUPPORT_LD_DEBUG_EARLY.*$/SUPPORT_LD_DEBUG_EARLY=y/;}
-' .config
-
-# force regeneration after .config changes
-rm -f include/bits/uClibc_config.h
-
-# note: defconfig and all must be run in separate make process because of macros
-%{__make} -j1 \
-	TARGET_ARCH="%{TARGET_ARCH}" \
+%{__make} \
 	TARGET_CPU="%{_target_cpu}" \
-	KERNEL_SOURCE=%{_prefix} \
 	HOSTCC="%{__cc}" \
 	HOSTCFLAGS="%{rpmcflags} %{rpmldflags}" \
-	OPTIMIZATION="%{rpmcflags} -Os" \
-	CC="%{__cc}"
+	CC="%{__cc}" \
+	OPTIMIZATION="%{rpmcflags} -Os"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_bindir}
 
 %{__make} -j1 install \
-	NATIVE_CC="%{__cc}" \
-	NATIVE_CFLAGS="%{rpmcflags} %{rpmldflags}" \
-	TARGET_ARCH="%{TARGET_ARCH}" \
 	TARGET_CPU="%{_target_cpu}" \
+	HOSTCC="%{__cc}" \
+	HOSTCFLAGS="%{rpmcflags} %{rpmldflags}" \
 	CC="%{__cc}" \
-	PREFIX=$RPM_BUILD_ROOT
+	OPTIMIZATION="%{rpmcflags} -Os" \
+	DESTDIR=$RPM_BUILD_ROOT
 
 %if %{with shared}
 mv -f $RPM_BUILD_ROOT%{uclibc_root}/usr/lib/{libpthread-uclibc,libpthread}.so
@@ -249,6 +275,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.153.2.4  2008-04-02 07:00:21  glen
+- sanitize building
+
 Revision 1.153.2.3  2008-04-01 23:52:05  glen
 - fix inversed bcond
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/uClibc.spec?r1=1.153.2.3&r2=1.153.2.4&f=u



More information about the pld-cvs-commit mailing list