SPECS (LINUX_2_6_22): uClibc.spec - builds for ac, shared disabled...

glen glen at pld-linux.org
Wed Apr 2 01:22:03 CEST 2008


Author: glen                         Date: Tue Apr  1 23:22:03 2008 GMT
Module: SPECS                         Tag: LINUX_2_6_22
---- Log message:
- builds for ac, shared disabled on x86_64 as i can't find where -fPIC gets
  _not_ passed and as it was never enabled for AC it's not regression either

---- Files affected:
SPECS:
   uClibc.spec (1.153 -> 1.153.2.1) 

---- Diffs:

================================================================
Index: SPECS/uClibc.spec
diff -u SPECS/uClibc.spec:1.153 SPECS/uClibc.spec:1.153.2.1
--- SPECS/uClibc.spec:1.153	Sat Feb  2 13:43:55 2008
+++ SPECS/uClibc.spec	Wed Apr  2 01:21:58 2008
@@ -1,4 +1,12 @@
 # $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without	shared		# don't build shared lib support
+#
+%ifarch %{x8664}
+%undefine	with_shared
+%endif
+#
 Summary:	C library optimized for size
 Summary(pl.UTF-8):	Biblioteka C zoptymalizowana na rozmiar
 Name:		uClibc
@@ -17,6 +25,7 @@
 Patch5:		%{name}-sparc.patch
 URL:		http://uclibc.org/
 BuildRequires:	binutils-gasp
+BuildRequires:	cpp
 BuildRequires:	gcc >= 5:3.0
 BuildRequires:	linux-libc-headers >= 7:2.6.20
 BuildRequires:	sed >= 4.0
@@ -28,8 +37,6 @@
 # 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/')
 
-%define		specflags	-fgnu89-inline
-
 %description
 Small libc for building embedded applications.
 
@@ -105,6 +112,9 @@
 	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 %{with 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/;
 %{?debug:s/^.*\<DODEBUG\>.*$/DODEBUG=y/;s/^.*SUPPORT_LD_DEBUG\>.*$/SUPPORT_LD_DEBUG=y/;s/^.*SUPPORT_LD_DEBUG_EARLY.*$/SUPPORT_LD_DEBUG_EARLY=y/;s/^.*\<DOSTRIP\>.*$/# DOSTRIP is not set/;}
@@ -136,18 +146,52 @@
 	CC="%{__cc}" \
 	PREFIX=$RPM_BUILD_ROOT
 
+%if %{with shared}
 mv -f $RPM_BUILD_ROOT%{uclibc_root}/usr/lib/{libpthread-uclibc,libpthread}.so
 ln -sf libpthread-0.9.29.so $RPM_BUILD_ROOT%{uclibc_root}/lib/libpthread.so.0
+%endif
 
 # these links are *needed* (by stuff in bin/)
 for f in $RPM_BUILD_ROOT%{uclibc_root}/bin/*; do
-	mv -f $f $RPM_BUILD_ROOT%{_bindir}
-	ln -sf ../../bin/`basename $f` $f
+	if [ -L $f ]; then
+		l=$(readlink $f)
+		a=${l##*/}
+		d=${l%/*}
+		case "$d" in
+		%{_bindir})
+			ln -sf ${l#%{_bindir}/} $RPM_BUILD_ROOT%{_bindir}/${f##*/}
+			rm -f $f
+			;;
+		$a)
+			mv -f $f $RPM_BUILD_ROOT%{_bindir}
+			;;
+		*)
+			exit 1
+			;;
+		esac
+	else
+		a=${f#*/%{_target_cpu}-uclibc-}
+		ln -sf %{_bindir}/$(basename $f) $RPM_BUILD_ROOT%{uclibc_root}/usr/bin/$a
+		mv -f $f $RPM_BUILD_ROOT%{_bindir}
+	fi
 done
 
-for f in c++ cc g++ gcc ld; do
-	ln -sf /usr/bin/%{_target_cpu}-uclibc-$f \
-		$RPM_BUILD_ROOT%{uclibc_root}/usr/bin/$f
+for f in $RPM_BUILD_ROOT%{uclibc_root}/usr/bin/*; do
+	if [ -L $f ]; then
+		l=$(readlink $f)
+		case "${l%/*}" in
+		%{uclibc_root}/bin)
+			a=${l#*/%{_target_cpu}-uclibc-}
+			ln -sf %{_bindir}/$a $f
+			;;
+		%{_bindir})
+			:
+			;;
+		*)
+			exit 2
+			;;
+		esac
+	fi
 done
 
 rm -rf $RPM_BUILD_ROOT%{uclibc_root}/usr/include/{linux,asm*}
@@ -172,9 +216,11 @@
 %doc Changelog* DEDICATION.mjn3 MAINTAINERS README TODO
 %dir %{uclibc_root}
 %ifarch %{ix86} %{x8664} ppc sparc sparcv9
+%if %{with shared}
 %dir %{uclibc_root}/lib
 %attr(755,root,root) %{uclibc_root}/lib/*.so*
 %endif
+%endif
 
 %files devel
 %defattr(644,root,root,755)
@@ -185,10 +231,12 @@
 %dir %{uclibc_root}/usr/bin
 %attr(755,root,root) %{uclibc_root}/usr/bin/*
 %dir %{uclibc_root}/usr/lib
+%if %{with shared}
 %{uclibc_root}/usr/lib/uclibc_nonshared.a
 %ifarch %{ix86} %{x8664} ppc sparc sparcv9
 %attr(755,root,root) %{uclibc_root}/usr/lib/*.so
 %endif
+%endif
 %{uclibc_root}/usr/include
 
 %files static
@@ -201,6 +249,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.153.2.1  2008-04-01 23:21:58  glen
+- builds for ac, shared disabled on x86_64 as i can't find where -fPIC gets
+  _not_ passed and as it was never enabled for AC it's not regression either
+
 Revision 1.153  2008-02-02 12:43:55  pluto
 - release 10 for rebuild with gcc-4.2.3.
 
================================================================

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



More information about the pld-cvs-commit mailing list