[cross-gcc] Add C++ support [BZ 1078108]

David Howells dhowells at fedoraproject.org
Fri Mar 28 00:52:52 UTC 2014


commit e8f0b5e4d97056cbca47e2ff53fd10b7281d4ea1
Author: David Howells <dhowells at redhat.com>
Date:   Thu Mar 27 15:40:00 2014 +0000

    Add C++ support [BZ 1078108]

 cross-gcc.spec |   84 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 64 insertions(+), 20 deletions(-)
---
diff --git a/cross-gcc.spec b/cross-gcc.spec
index 64c8fef..b080546 100644
--- a/cross-gcc.spec
+++ b/cross-gcc.spec
@@ -176,6 +176,17 @@ Cross-build GNU C compiler. \
 Only building kernels is currently supported.  Support for cross-building \
 user space programs is not currently provided as that would massively multiply \
 the number of packages. \
+\
+%package -n %{rpmprefix}gcc-c++-%1 \
+Summary: Cross-build binary utilities for %1 \
+Group: Development/Tools \
+Requires: %{rpmprefix}gcc-%1 == %{version}-%{release} \
+%description -n %{rpmprefix}gcc-c++-%1 \
+Cross-build GNU C++ compiler. \
+\
+Only the compiler is provided; not libstdc++.  Support for cross-building \
+user space programs is not currently provided as that would massively multiply \
+the number of packages. \
 %endif
 
 %define do_symlink() \
@@ -185,11 +196,23 @@ Summary: Cross-build binary utilities for %1 \
 Group: Development/Tools \
 Requires: gcc-%3 == %{version}-%{release} \
 %description -n gcc-%1 \
-Cross-build GNU C compiler. \
+Cross-build GNU C++ compiler. \
 \
 Only building kernels is currently supported.  Support for cross-building \
 user space programs is not currently provided as that would massively multiply \
 the number of packages. \
+\
+%package -n gcc-c++-%1 \
+Summary: Cross-build binary utilities for %1 \
+Group: Development/Tools \
+Requires: gcc-%1 == %{version}-%{release} \
+Requires: gcc-c++-%3 == %{version}-%{release} \
+%description -n gcc-c++-%1 \
+Cross-build GNU C++ compiler. \
+\
+Only the compiler is provided; not libstdc++.  Support for cross-building \
+user space programs is not currently provided as that would massively multiply \
+the number of packages. \
 %endif
 
 %do_package alpha-linux-gnu	%{build_alpha}
@@ -534,7 +557,7 @@ function config_target () {
 	--enable-checking=$checking \
 	--enable-gnu-unique-object \
 	--enable-initfini-array \
-	--enable-languages=c \
+	--enable-languages=c,c++ \
 	--enable-linker-build-id \
 	--enable-nls \
 	--enable-obsolete \
@@ -688,7 +711,7 @@ rmdir %{buildroot}%{_mandir}/man7
 # All the installed manual pages and translation files for each program are the
 # same, so symlink them to the common package
 cd %{buildroot}%{_mandir}/man1
-for i in %{cross}-cpp.1.gz %{cross}-gcc.1.gz %{cross}-gcov.1.gz
+for i in %{cross}-cpp.1.gz %{cross}-gcc.1.gz %{cross}-g++.1.gz %{cross}-gcov.1.gz
 do
     j=${i#%{cross}-}
 
@@ -716,33 +739,52 @@ function install_lang () {
     arch=$1
     cpu=${arch%%%%-*}
 
+    case $cpu in
+	avr32)		target_cpu=avr;;
+	bfin)		target_cpu=bfin;;
+	h8300)		target_cpu=h8300;;
+	mn10300)	target_cpu=am33_2.0;;
+	openrisc)	target_cpu=openrisc;;
+	parisc)		target_cpu=hppa;;
+	score)		target_cpu=score;;
+	tile)		target_cpu=tilegx;;
+	v850)		target_cpu=v850e;;
+	x86)		target_cpu=x86_64;;
+	*)		target_cpu=$cpu;;
+    esac
+
     (
 	echo '%%defattr(-,root,root,-)'
-	echo '%{_bindir}/'$arch'-*'
-	echo '%{_mandir}/man1/'$arch'-*'
-
-	case $cpu in
-	    avr32)		target_cpu=avr;;
-	    bfin)		target_cpu=bfin;;
-	    h8300)		target_cpu=h8300;;
-	    mn10300)		target_cpu=am33_2.0;;
-	    openrisc)		target_cpu=openrisc;;
-	    parisc)		target_cpu=hppa;;
-	    score)		target_cpu=score;;
-	    tile)		target_cpu=tilegx;;
-	    v850)		target_cpu=v850e;;
-	    x86)		target_cpu=x86_64;;
-	    *)			target_cpu=$cpu;;
-	esac
+	echo '%{_bindir}/'$arch'*-cpp'
+	echo '%{_bindir}/'$arch'*-gcc'
+	echo '%{_bindir}/'$arch'*-gcov'
+	echo '%{_mandir}/man1/'$arch'*-cpp*'
+	echo '%{_mandir}/man1/'$arch'*-gcc*'
+	echo '%{_mandir}/man1/'$arch'*-gcov*'
 	case $cpu in
 	    ppc*|ppc64*)
 		;;
 	    *)
 		echo '/usr/lib/gcc/'$target_cpu'-*/'
-		echo '%{_libexecdir}/gcc/'$target_cpu'-*/'
+		echo '%{_libexecdir}/gcc/'$target_cpu'*/*/cc1'
+		echo '%{_libexecdir}/gcc/'$target_cpu'*/*/collect2'
+		echo '%{_libexecdir}/gcc/'$target_cpu'*/*/[abd-z]*'
 	esac
 
     ) >files.$arch
+
+    (
+	echo '%%defattr(-,root,root,-)'
+	echo '%{_bindir}/'$arch'*-c++'
+	echo '%{_bindir}/'$arch'*-g++'
+	echo '%{_mandir}/man1/'$arch'*-g++*'
+	case $cpu in
+	    ppc*|ppc64*)
+		;;
+	    *)
+		echo '%{_libexecdir}/gcc/'$target_cpu'*/*/cc1plus'
+	esac
+    ) >files-c++.$arch
 }
 
 for target in `cat target.list symlink-target.list`
@@ -786,6 +828,7 @@ rm -rf %{buildroot}
 %define do_files() \
 %if %2 \
 %files -n %{rpmprefix}gcc-%1 -f files.%1 \
+%files -n %{rpmprefix}gcc-c++-%1 -f files-c++.%1 \
 %endif
 
 %do_files alpha-linux-gnu	%{build_alpha}
@@ -830,6 +873,7 @@ rm -rf %{buildroot}
 * Thu Mar 27 2014 David Howells <dhowells at redhat.com> - 4.8.2-1
 - Rebase on gcc-4.8.2-15
 - Enable sysroot [BZ 1011415].
+- Enable C++ compiler without libstdc++ [BZ 1078108].
 
 * Tue Aug 13 2013 David Howells <dhowells at redhat.com> - 4.8.1-5.2
 - Require binutils 2.23.88 or greater for 32-bit HPPA binutils.


More information about the scm-commits mailing list