File gcc3.spec of Package gcc3
%define gcc_branch 3.4
%define bname gcc
Name: %{bname}3
Version: 3.4.6
Release: 13
Summary: GNU Compiler Collection
License: GPL-2.0+
Group: Development/Languages/C and C++
Url: http://%bname.gnu.org/
%define priority 340
%define psuffix -%gcc_branch
%define _libexecdir %_libdir
%define gcc_target_libdir %_libdir/gcc/%_target_platform/%version
%define gcc_target_libexecdir %_libexecdir/gcc/%_target_platform/%version
%define doc_dir %_docdir/%name
# Build parameters.
%def_enable compat
%def_enable multilib
%def_without cxx
%def_without fortran
%def_without objc
%def_enable objc_gc
%def_without treelang
%def_without java
%def_without ada
%def_with pascal
%def_without pdf
Source0: %bname-%version.tar.xz
Source8: baselibs.conf
Source9: %name-rpmlintrc
Source11: gpc-20070904.tar.bz2
Source12: gpc-extra.tar
Source13: gpc-20070904.pdf
# Upstream patches
Patch001: 0001-PR-target-26775.patch
Patch002: 0002-PR-target-36276.patch
Patch003: 0003-config-m32r-m32r.c-gen_compare-Fix-reg-smallconst-eq.patch
Patch004: 0004-c-parse.in-structsp_attr-Fix-for-bison-2.4.1-pedantr.patch
# RH patches.
Patch100: gcc-3.4.6-rh-20060404.patch
Patch101: gcc34-multi32-hack.patch
Patch102: gcc34-ice-hack.patch
Patch103: gcc34-ppc64-m32-m64-multilib-only.patch
Patch104: gcc34-ia64-lib64.patch
Patch105: gcc34-java-nomulti.patch
Patch106: gcc34-gnuc-rh-release.patch
Patch107: gcc34-pr16104.patch
Patch108: gcc34-var-tracking-fix.patch
Patch109: gcc34-i386-movsi-insv.patch
Patch110: gcc34-pr18925.patch
Patch111: gcc34-pr14084.patch
Patch112: gcc34-hashtab-recursion.patch
Patch113: gcc34-java-jnilink.patch
Patch114: gcc34-pr21955.patch
Patch115: gcc34-vsb-stack.patch
Patch116: gcc34-pr18300.patch
Patch117: gcc34-rh156291.patch
Patch118: gcc34-weakref.patch
Patch119: gcc34-dwarf2-usefbreg.patch
Patch120: gcc34-dwarf2-prefer-1elt-vartracking.patch
Patch121: gcc34-dwarf2-pr20268.patch
Patch122: gcc34-dwarf2-inline-details.patch
Patch123: gcc34-dwarf2-frame_base.patch
Patch124: gcc34-dwarf2-i386-multreg1.patch
Patch125: gcc34-dwarf2-i386-multreg2.patch
Patch126: gcc34-rh176182.patch
Patch127: gcc34-pr11953.patch
Patch128: gcc34-pr23591.patch
Patch129: gcc34-pr26208.patch
Patch130: gcc34-pr8788.patch
Patch131: gcc34-rh137200.patch
Patch132: gcc34-rh172117.patch
Patch133: gcc34-rh172876.patch
Patch134: gcc34-rh178062.patch
Patch135: gcc34-pr21412.patch
Patch137: gcc34-pr26208-workaround.patch
Patch136: gcc34-sw2438.patch
Patch138: gcc34-libgcc_eh-hidden.patch
Patch139: gcc34-frame-base-loclist.patch
Patch200: gcc34-ldbl-hack.patch
Patch201: gcc34-pr26090.patch
# Debian patches.
Patch301: gcc34-deb-gcc-textdomain.patch
Patch302: gcc34-deb-libstdc++-doclink.patch
Patch303: gcc34-deb-protoize.patch
Patch304: gcc34-deb-amd64-specs.patch
Patch305: gcc34-deb-fastjar-update.patch
Patch306: gcc34-deb-gcj-without-rpath.patch
Patch307: gcc34-deb-libffi-soversion.patch
Patch308: gcc34-deb-libobjc.patch
Patch309: gcc34-deb-ada-gcc-name.patch
Patch310: gcc34-deb-cpu-default-i586.patch
Patch311: gcc34-deb-link-libs.patch
# SUSE patches.
# Led's patches.
Patch501: gcc-3.4.6-libjava-isspace.patch
Patch502: gcc-3.4.6-gcc-config-siginfo.patch
# MDK patches.
Patch601: gcc32-mdk-mklibgcc-serialize-crtfiles.patch
Patch602: gcc32-mdk-multi-do-libdir.patch
# ALT patches.
Patch701: gcc34-alt-install.patch
Patch702: gcc34-alt-nowrap.patch
Patch703: gcc34-alt-makeinfo.patch
# GPC patches.
Patch801: gpc-fix1.patch
Patch802: gpc-fix2.patch
Patch803: gpc-regex.patch
Patch804: gpc-crt.patch
Patch805: gpc-fix3.patch
Patch806: gpc-fix_fsf.patch
Patch807: gpc-fix_docpath.patch
Patch808: gpc-fix6.patch
Patch809: gpc-20070904-shared.patch
Patch810: gpc-fix4.patch
Provides: %_bindir/%name
Requires: cpp3 = %version-%release
Requires: binutils >= 2.16.91.0.3
Requires: glibc-devel >= 2.2.6
%ifnarch %ix86 x86_64
%set_without ada
%endif
%ifnarch x86_64
%set_disable multilib
%endif
%{!?_with_objc:%set_disable objc_gc}
%define __autoconf autoconf-2.13
%define __automake automake-1.4
BuildRequires: autoconf213 automake14
BuildRequires: binutils >= 2.16.91.0.3
BuildRequires: coreutils bison flex zlib-devel glibc-devel-static
# due to manpages
BuildRequires: perl(Pod::Parser)
%ifarch x86_64
%{?_enable_multilib:BuildRequires: glibc-devel-32bit glibc-32bit libgcc_s.so.1}
%endif
%{?_enable_objc_gc:BuildRequires: gc-devel}
%{?_with_ada:BuildRequires: gcc-ada}
%if_with java
BuildRequires: imake libXt-devel libart_lgpl-devel gtk2-devel xorg-cf-files
#BuildRequires: libltdl3-devel
%endif
%{?_with_pascal:BuildRequires: makeinfo}
%{?_with_pdf:BuildRequires: texinfo}
%description
This package contains the GNU Compiler Collection version %version.
You'll need this package in order to compile C code.
It is also required for all other GCC compilers, namely C++, Fortran 77,
Objective C and Java.
%if_enabled multilib
%package 32bit
Summary: GNU Compiler Collection
Group: Development/Languages/C and C++
Requires: %name = %version
Requires: libgcc_s.so.1
%description 32bit
This package contains the GNU Compiler Collection version %version.
You'll need this package in order to compile C code.
It is also required for all other GCC compilers, namely C++, Fortran 77,
Objective C and Java.
%endif
%package -n libgcc%gcc_branch
Summary: GNU GCC library
Group: System/Libraries
Provides: libgcc = %version-%release
Conflicts: libgcc > %version
%description -n libgcc%gcc_branch
This package contains GCC shared support library which is needed e.g. for
exception handling support.
%package -n cpp3
Summary: The GNU C-Compatible Compiler Preprocessor
Group: Development/C
Provides: %_bindir/cpp3
%description -n cpp3
Cpp is the GNU C-Compatible Compiler Preprocessor.
The C preprocessor is a 'macro processor' which is used automatically by the C
compiler to transform your program before actual compilation. It is called a
macro processor because it allows you to define 'macros,' which are
abbreviations for longer constructs.
The C preprocessor provides four separate facilities that you can use as you see
fit:
- Inclusion of header files. These are files of declarations that can be
substituted into your program.
- Macro expansion. You can define 'macros,' which are abbreviations for
arbitrary fragments of C code, and then the C preprocessor will replace the
macros with their definitions throughout the program.
- Conditional compilation. Using special preprocessing directives, you can
include or exclude parts of the program according to various conditions.
- Line control. If you use a program to combine or rearrange source files into
an intermediate file which is then compiled, you can use line control to
inform the compiler about where each source line originated.
You should install this package if you are a programmer who is searching for such
a macro processor.
%package -n libstdc++%gcc_branch
Summary: GNU C++ library
Group: System/Libraries
Provides: libstdc++ = %version-%release
Conflicts: libstdc++ > %version
Requires: libgcc%gcc_branch >= %version-%release
%description -n libstdc++%gcc_branch
The libstdc++ package contains a snapshot of the GCC Standard C++ Library v3, an
ongoing project to implement the ISO/IEC 14882:1998 Standard C++ library.
%package -n libstdc++%gcc_branch-devel
Summary: Header files and libraries for C++ development
Group: Development/C++
Provides: libstdc++-devel = %version-%release
Requires: libstdc++%gcc_branch >= %version-%release
Requires: glibc-devel
%description -n libstdc++%gcc_branch-devel
This is the GNU implementation of the standard C++ libraries.
This package includes the header files and libraries needed for C++ development.
%package -n libstdc++%gcc_branch-devel-static
Summary: Static libraries for C++ development
Group: Development/C++
Provides: libstdc++-devel-static = %version-%release
Requires: libstdc++%gcc_branch-devel = %version-%release
%description -n libstdc++%gcc_branch-devel-static
This is the GNU implementation of the standard C++ libraries.
This package includes the static libraries needed for C++ development.
%package -n libstdc++%gcc_branch-32bit
Summary: GNU C++ library
Group: System/Libraries
Provides: libstdc++-32bit = %version-%release
Conflicts: libstdc++-32bit > %version
Requires: libgcc%gcc_branch-32bit >= %version-%release
%description -n libstdc++%gcc_branch-32bit
The libstdc++ package contains a snapshot of the GCC Standard C++ Library v3, an
ongoing project to implement the ISO/IEC 14882:1998 Standard C++ library.
%package -n libstdc++%gcc_branch-devel-32bit
Summary: Header files and libraries for C++ development
Group: Development/C++
Provides: libstdc++-devel-32bit = %version-%release
Requires: libstdc++%gcc_branch-32bit >= %version-%release
Requires: glibc-devel-32bit glibc-32bit
%description -n libstdc++%gcc_branch-devel-32bit
This is the GNU implementation of the standard C++ libraries.
This package includes the header files and libraries needed for C++ development.
%package -n libstdc++%gcc_branch-devel-static-32bit
Summary: Static libraries for C++ development
Group: Development/C++
Provides: libstdc++-devel-static-32bit = %version-%release
Requires: libstdc++%gcc_branch-devel = %version-%release
%description -n libstdc++%gcc_branch-devel-static-32bit
This is the GNU implementation of the standard C++ libraries.
This package includes the static libraries needed for C++ development.
%package -n libstdc++%gcc_branch-devel-precompiled
Summary: Precompiled header files for C++ development
Group: Development/C++
Requires: libstdc++%gcc_branch-devel = %version-%release
%description -n libstdc++%gcc_branch-devel-precompiled
This is the GNU implementation of the standard C++ libraries.
This package includes the precompiled header files needed for C++ development.
%package c++
Summary: C++ support for gcc
Group: Development/C++
Provides: gcc-c++ = %version-%release
Provides: %_bindir/g++
Requires: %name = %version-%release
Requires: libstdc++%gcc_branch-devel = %version-%release
%description c++
This package adds C++ support to the GNU Compiler Collection.
It includes support for most of the current C++ specification, including
templates and exception handling.
%package -n libobjc1
Summary: Objective C runtime libraries
Group: System/Libraries
Provides: libobjc = %version-%release
%description -n libobjc1
This package contains Objective C shared library which is needed to run
Objective-C dynamically linked programs.
%package -n libobjc1-32bit
Summary: Objective C runtime libraries
Group: System/Libraries
Provides: libobjc-32bit = %version-%release
%description -n libobjc1-32bit
This package contains Objective C shared library which is needed to run
Objective-C dynamically linked programs.
%package objc
Summary: Objective C support for gcc
Group: Development/Other
Provides: gcc-objc = %version-%release
Requires: %name = %version-%release
Requires: libobjc1
Requires: glibc-devel
%description objc
This package provides Objective-C support for the GCC.
Mainly used on systems running NeXTSTEP, Objective-C is an object-oriented
derivative of the C language.
%package objc-32bit
Summary: Objective C support for gcc
Group: Development/Other
Provides: gcc-objc-32bit = %version-%release
Requires: gcc-objc = %version-%release
Requires: libobjc1-32bit = %version-%release
Requires: glibc-devel-32bit glibc-32bit
%description objc-32bit
This package provides Objective-C support for the GCC.
Mainly used on systems running NeXTSTEP, Objective-C is an object-oriented
derivative of the C language.
%package treelang
Summary: Treelang support for gcc
Group: Development/Other
Provides: gcc-treelang = %version-%release
Requires: %name = %version-%release
%description treelang
This package provides the GNU Treelang compiler.
%package -n libg2c0
Summary: Fortran 77 runtime libraries
Group: System/Libraries
Provides: libg2c = %version-%release
Provides: libf2c = %version-%release
%description -n libg2c0
This package contains Fortran 77 shared library which is needed to run Fortran 77
dynamically linked programs.
%package -n libg2c0-32bit
Summary: Fortran 77 runtime libraries
Group: System/Libraries
Provides: libg2c-32bit = %version-%release
Provides: libf2c-32bit = %version-%release
%description -n libg2c0-32bit
This package contains Fortran 77 shared library which is needed to run Fortran 77
dynamically linked programs.
%package gfortran
Summary: Fortran 77 support for gcc
Group: Development/Other
Provides: gcc-gfortran = %version-%release
Provides: %_bindir/gfortran
Requires: %name = %version-%release
Requires: libg2c0 = %version-%release
Requires: glibc-devel
%description gfortran
This package provides support for compiling Fortran 77 programs with the
GNU Compiler Collection.
%package gfortran-32bit
Summary: Fortran 77 support for gcc
Group: Development/Other
Provides: gcc-gfortran-32bit = %version-%release
Requires: gcc-gfortran = %version-%release
Requires: libg2c0-32bit = %version-%release
Requires: glibc-devel-32bit glibc-32bit
%description gfortran-32bit
This package provides support for compiling Fortran 77 programs with the
GNU Compiler Collection.
%package -n libffi%gcc_branch
Summary: Foreign Function Interface library
Group: System/Libraries
Provides: libffi = %version-%release
%description -n libffi%gcc_branch
The libffi library provides a portable, high level programming interface to
various calling conventions. This allows a programmer to call any function
specified by a call interface description at run time.
This package contains Foreign Function Interface shared library which is needed
to run Foreign Function Interface dynamically linked programs.
%package -n libffi%gcc_branch-devel
Summary: Header files and library for Foreign Function Interface development
Group: Development/Other
Provides: libffi-devel = %version-%release
Requires: libffi%gcc_branch = %version-%release
Requires: glibc-devel
%description -n libffi%gcc_branch-devel
The libffi library provides a portable, high level programming interface to
various calling conventions. This allows a programmer to call any function
specified by a call interface description at run time.
This package includes the header files and library needed for Foreign Function
Interface development.
%package -n libffi%gcc_branch-devel-static
Summary: Static library for Foreign Function Interface development
Group: Development/Other
Provides: libffi-devel-static = %version-%release
Requires: libffi%gcc_branch-devel = %version-%release
%description -n libffi%gcc_branch-devel-static
The libffi library provides a portable, high level programming interface to
various calling conventions. This allows a programmer to call any function
specified by a call interface description at run time.
This package includes the static library needed for Foreign Function Interface
development.
%package -n libgcj%gcc_branch
Summary: GNU Java runtime libraries
Group: System/Libraries
Provides: libgcj = %version-%release
Requires: zip >= 2.1
%description -n libgcj%gcc_branch
The Java(tm) runtime library. You will need this package to run your Java
programs compiled using the Java compiler from GNU Compiler Collection (gcj).
%package -n libgcj%gcc_branch-awt
Summary: GNU Java AWT peer library
Group: System/Libraries
Provides: libgcj-awt = %version-%release
Requires: libgcj%gcc_branch = %version-%release
%description -n libgcj%gcc_branch-awt
The GNU Java AWT peer library.
%package -n libgcj%gcc_branch-devel
Summary: Header files and libraries for Java development
Group: Development/Java
Provides: libgcj-devel = %version-%release
Requires: libgcj%gcc_branch = %version-%release
Requires: libgcj%gcc_branch-awt = %version-%release
Requires: zlib-devel
%description -n libgcj%gcc_branch-devel
The Java(tm) development libraries and include files. You will need this package
to compile your Java programs using the GCC Java compiler (gcj).
%package -n libgcj%gcc_branch-devel-static
Summary: Static libraries for Java development
Group: Development/Java
Provides: libgcj-devel-static = %version-%release
Requires: libgcj%gcc_branch-devel = %version-%release
%description -n libgcj%gcc_branch-devel-static
The Java(tm) static libraries. You may need this package to compile your Java
programs using the GCC Java compiler (gcj).
%package java
Summary: Java support for gcc
Group: Development/Java
Provides: gcc-java = %version-%release
Provides: %_bindir/gcj
Requires: %name = %version-%release
Requires: libgcj%gcc_branch-devel = %version-%release
Conflicts: kaffe < 1.0.7
%description java
This package adds support for compiling Java(tm) programs and bytecode into
native code.
%package -n libgnat%gcc_branch
Summary: Ada 95 runtime libraries
Group: System/Libraries
Provides: libgnat = %version-%release
%description -n libgnat%gcc_branch
This package contains the shared libraries required to run programs compiled with
the GNU Ada compiler (GNAT) if they are compiled to use shared libraries.
It also contains the shared libraries for the Implementation of the Ada Semantic
Interface Specification (ASIS), the implementation of Distributed Systems
Programming (GLADE) and the Posix 1003.5 Binding (Florist).
%package -n libgnat%gcc_branch-devel
Summary: Header files and libraries for Ada 95 development
Group: Development/Other
Provides: libgnat-devel = %version-%release
Requires: libgnat%gcc_branch = %version-%release
%description -n libgnat%gcc_branch-devel
This is the GNU implementation of the standard Ada 95 libraries.
This package includes the include files and libraries needed for Ada 95
development.
%package -n libgnat%gcc_branch-devel-static
Summary: Static libraries for Ada 95 development
Group: Development/Other
Provides: libgnat-devel-static = %version-%release
Requires: libgnat%gcc_branch-devel = %version-%release
%description -n libgnat%gcc_branch-devel-static
This is the GNU implementation of the standard Ada 95 libraries.
This package includes the static libraries needed for Ada 95 development.
%package gnat
Summary: Ada 95 support for gcc
Group: Development/Other
Provides: gcc-gnat = %version-%release, %_bindir/gnat
Requires: %name = %version-%release
Requires: libgnat%gcc_branch-devel = %version-%release
%description gnat
This package provides support for compiling Ada 95 programs with the GNU Compiler
Collection.
%if_with pascal
%package -n libgpc2
Summary: GNU GPC library
Group: System/Libraries
Provides: libgpc = %version-%release
%description -n libgpc2
This package contains GPC shared library.
%package -n gpc
Summary: Pascal support for gcc
Group: Development/Other
Requires: libgpc = %version-%release
%description -n gpc
This package provides support for compiling Pascal programs with the GNU Compiler
Collection.
%package -n gpc-doc
Summary: GPC documentation
Group: Development/Documentation
BuildArch: noarch
%description -n gpc-doc
This package contains documentation for the GNU Pascal Compiler
%endif
%package doc
Summary: GCC documentation
Group: Development/Documentation
Provides: %bname-doc = %version-%release
BuildArch: noarch
%description doc
This package contains documentation for the GNU Compiler Collection version
%version.
%prep
%setup -q -n %bname-%version
# Upstream patches
%patch001 -p1
%patch002 -p1
%patch003 -p1
%patch004 -p1
# RH patches
%patch100 -p1
%ifarch sparc ppc
%patch101 -p0
%endif
%patch102 -p0
%patch103 -p0 -F2
%ifarch ia64
%if "%_lib" == "lib64"
%patch104 -p0
%endif
%endif
%patch105 -p0
%patch106 -p0
%patch107 -p0
%patch108 -p0
%patch109 -p0
%patch110 -p0
%patch111 -p0
%patch112 -p0
%patch113 -p0
%patch114 -p0
%patch115 -p0
%patch116 -p0
%patch117 -p0
%patch118 -p0
%patch119 -p0
%patch120 -p0
%patch121 -p0
%patch122 -p0
%patch123 -p0 -F2
%patch124 -p0
%patch125 -p0 -F1
%patch126 -p0 -F2
%patch127 -p0 -F2
%patch128 -p0
%patch129 -p0
%patch130 -p0 -F1
%patch131 -p0
%patch132 -p0
%patch133 -p0
%patch134 -p0
%patch135 -p0
%patch136 -p0
%patch137 -p0
%patch138 -p0
%patch139 -p0
%patch200 -p0
%patch201 -p0
# Debian patches
%patch301 -p0
%patch302 -p0
%patch303 -p0
%patch304 -p1 -F2
%patch305 -p0
%patch306 -p1 -F2
%patch307 -p0
%patch308 -p0 -F2
%patch309 -p0
%patch310 -p0
%patch311 -p0 -F2
# SUSE patches
# Led's patches.
%patch501 -p1
%patch502 -p1
# MDK patches
%patch601 -p1
%patch602 -p1
# ALT patches
%patch701 -p1
%patch702 -p1
%patch703 -p1
cd gcc
tar -xf %{S:11} --strip-components=1
tar -xf %{S:12}
# GPC patches.
%patch801 -p0
%patch802 -p0
%patch803 -p0
%patch804 -p0
%patch805 -p0
%patch806 -p0
%patch807 -p0
%patch808 -p0
%patch809 -p0
chmod +x p/rts/make-*-pas
sed -i -r 's/auto(conf|header)/&-2.13/g' p/rts/Makefile.in
sed -i '/^p_inst_docdir/s|^.*$|p_inst_docdir=%_docdir/gpc|' p/Make-lang.in
cd -
%patch810 -p1
ls libstdc++-v3/scripts/* | grep -v '\.in$' | xargs chmod +x
find -type f -name \*.orig -delete
sed -i -e '/^CC[[:blank:]]*=[[:blank:]]*@CC@/d' \
-e '/^glibcpp_toolexeclibdir[[:blank:]]*=/iCC = @CC@\nMULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory`' \
-e '/^glibcpp_toolexeclibdir[[:blank:]]*=/s|\(=[[:blank:]]*.*\)[[:blank:]]*$|\1/$(MULTIOSDIR)|' \
lib{f2,obj}c/Makefile.in
%if 0
# Link lib-gnu-java-awt-peer-gtk with libgcj.
grep -l '^lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES[[:blank:]]*=' libjava/Makefile.* |
xargs sed -i '/^lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES[[:blank:]]*=/d'
grep -l '^lib_gnu_java_awt_peer_gtk_la_LIBADD[[:blank:]]*=' libjava/Makefile.* |
xargs sed -i 's|^lib_gnu_java_awt_peer_gtk_la_LIBADD[[:blank:]]*=[[:blank:]]*.*|& -L$(here)/.libs libgcj.la\nlib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = libgcj.la libgcj.spec|'
%endif
sed -i 's/\(AC_LIBLTDL_\)CONVENIENCE/\1INSTALLABLE/' libjava/configure.in
%if 0%{?suse_version}
grep -l '(GCC)' gcc/{,*/}*.c | xargs sed -i 's/(GCC)/(SUSE Linux)/'
%endif
sed -i -e 's/59 Temple Place - Suite 330/51 Franklin Street - Suite 500/' \
-e 's/02111-1307, USA/02110-1335, USA/' \
gcc/{unwind,{ginclude,config/*}/*}.h
sed -i '/^[^#]/s/--print-multi-lib/& | grep -v "^x32;"/' config-ml.in
%build
#remove_optflags %optflags_nocpp %optflags_notraceback -mtune=generic -fstack-protector
%define optflags -Wall -pipe -O2
Autogen()
{
local f d
for f in */$1; do
d="${f%%/*}"
[ "$d/$1" -nt "$d/$2" ] || continue
cd "$d"
$3
cd -
done
}
Autogen configure{.in,} "%__autoconf"
Autogen Makefile.{am,in} "%__automake"
%define buildtarget obj-%_target_platform
rm -rf %buildtarget
install -d -m 0755 %buildtarget
cd %buildtarget
CC="%__cc" \
CFLAGS="%optflags" \
CXXFLAGS="%optflags" \
GCJFLAGS="%optflags" \
XCFLAGS="%optflags" \
TCFLAGS="%optflags" \
../configure \
--prefix=%_prefix \
--libdir=%_libdir \
--with-slibdir=/%_lib \
--mandir=%_mandir \
--infodir=%_infodir \
--libexecdir=%_libexecdir \
--enable-shared \
%{?_with_java:--enable-ltdl-install} \
--enable-__cxa_atexit \
--enable-languages="c%{?_with_cxx:,c++}%{?_with_fortran:,f77}%{?_with_objc:,objc}%{?_with_treelang:,treelang}%{?_with_java:,java}%{?_with_ada:,ada}%{?_with_pascal:,pascal}" \
--program-suffix=%psuffix \
%{?_with_objc:%{?_enable_objc_gc:--enable-objc-gc}} \
%{?_with_java:--enable-java-gc=boehm --enable-java-awt=gtk} \
--with-system-zlib \
--without-included-gettext \
%{subst_enable multilib} \
--host=%_target_platform --build=%_target_platform --target=%_target_platform
%make_build %{?_with_pascal:-j1} bootstrap
cd -
# build printable documentation
%if_with pdf
MakePDF()
{
cd $1
shift
local f
for f in $*; do
texi2dvi -p -t @afourpaper -t @finalout -I ../doc/include $f.texi
done
cd -
}
MakePDF gcc/doc gcc cpp cppinternals
%{?_with_fortran:MakePDF gcc/f g77}
%{?_with_java:MakePDF gcc/java gcj}
#%%if_with ada
%if 0%{?_with_ada:1}
MakePDF gcc/ada gnat_rm gnat_ug_unx
mv gnat_ug{_unx,}.pdf
%endif
%endif
%install
# Copy various doc files here and there
CopyDocs()
{
install -d -m 0755 "%buildroot%doc_dir/$1"
local f
for f in "$2"/*{README,NEWS,ChangeLog,LICENSE,THREADS}*; do
[ -f "$f" ] || continue
install -p -m 0644 "$f" "%buildroot%doc_dir/$1/"
done
}
CopyDocs gcc gcc
%if_with cxx
CopyDocs g++ gcc/cp
CopyDocs libstdc++ libstdc++-v3
cp -av libstdc++-v3/docs/html %buildroot%doc_dir/libstdc++/
ln -s documentation.html %buildroot%doc_dir/libstdc++/html/index.html
%endif
%if_with fortran
CopyDocs g77 gcc/f
CopyDocs libg2c libf2c
%endif
%if_with objc
CopyDocs objc gcc/objc
CopyDocs libobjc libobjc
%endif
%{?_with_treelang:CopyDocs treelang gcc/treelang}
%if_with java
CopyDocs boehm-gc boehm-gc
install -p -m 0644 boehm-gc/doc/* %buildroot%doc_dir/boehm-gc/
CopyDocs java gcc/java
CopyDocs fastjar fastjar
CopyDocs libffi libffi
CopyDocs libjava libjava
%endif
%{?_with_ada:CopyDocs ada gcc/ada}
# Compress changelogs.
gzip -9 $(find %buildroot%doc_dir -type f -name '*ChangeLog*')
cd %buildtarget
%make_install
cd -
# Remove install-tools.
rm -rf %buildroot{%gcc_target_libdir,%gcc_target_libexecdir}/install-tools
rm -f %buildroot%_prefix/lib*/*.la
rm -f %buildroot%_libdir/{,*/}libiberty.a
# Rename binaries which will be packaged under alternatives control.
cd %buildroot%_bindir
rm gccbug%psuffix %_target_platform-gcc-%version %{?_with_cxx:{%_target_platform-,}c++%psuffix}
%{?_with_fortran:mv {g77,gfortran}%psuffix}
%{?_with_treelang:mv {tree1,gtreelang}%psuffix}
%if_with java
rm addr2name.awk%psuffix
mv {,fast}jar%psuffix
mv {,g}rmic%psuffix
mv {,g}rmiregistry%psuffix
%endif
for n in cpp gcc gcov protoize unprotoize \
%{?_with_cxx:g++} \
%{?_with_fortran:gfortran} \
%{?_with_treelang:gtreelang} \
%{?_with_java:fastjar gcj gcjh gij jcf-dump jv-convert jv-scan grepjar grmic grmiregistry}
do
[ -f "%_target_platform-$n%psuffix" ] || mv -v "$n%psuffix" "%_target_platform-$n%psuffix"
ln -snf "%_target_platform-$n%psuffix" "$n%psuffix"
ln -snf "%_target_platform-$n%psuffix" "${n}3"
done
%{?_with_pascal:ln -s gpc%psuffix gpc}
%{?_with_ada:ln -s gcc%psuffix gnatgcc3}
cd -
%if_with pascal
%{?_with_pdf:install -p -m 0644 %{S:13} %buildroot%_docdir/gpc/gpc.pdf}
rm -f %buildroot%_docdir/gpc/INSTALL
%endif
cd %buildroot%_mandir/man1
for n in g{cc,cov}%psuffix.1; do
ln -snf $n $(basename $n %psuffix.1)3.1
done
ln -snf gpc%psuffix.1 gpc.1
cd -
cd %buildroot%_infodir
for n in {cpp,gcc}.info; do
mv $n $(basename $n .info)3.info
done
cd -
%if_with pascal
install -p -m 0755 %buildtarget/gcc/libgpc.so.* %buildroot%_libdir/
ln -s $(basename "%buildroot%_libdir"/libgpc.so.*) %buildroot%_libdir/libgpc.so
%endif
# Relocate libraries to the right directories.
MakeLibLink()
{
cd %buildroot$1 || return 0
local f v
for f in *.so; do
[ -f "$f" ] || break
v="$(objdump -p "$f" | sed -nr '/^[[:blank:]]*SONAME[[:blank:]]/s/^[[:blank:]]*SONAME[[:blank:]]+(.*)[[:blank:]]*$/\1/p')"
[ -f "$v" ] || ln -s $(readlink $f) $v
ln -s "$1/$v" "%buildroot%gcc_target_libdir/$2$f"
rm -f "$f"
done
cd -
}
mv %buildroot{%_libdir/*.a,%gcc_target_libdir/} ||:
mv %buildroot{%_prefix/lib/*.a,%gcc_target_libdir/32/} ||:
MakeLibLink %_libdir
MakeLibLink /%_lib
%if_enabled multilib
MakeLibLink %_prefix/lib 32/
ln -s /lib/libgcc_s.so.1 %buildroot%gcc_target_libdir/libgcc_s_32.so
%endif
%if_with ada
# Dispatch Ada 95 libraries.
cd %buildroot%gcc_target_libdir
for n in gnat gnarl; do
mv adalib/lib$n-*.so.* %buildroot%_libdir/
rm -f adalib/lib$n.so.*
for f in $n{,%psuffix}; do
ln -s ../../../lib$n-*.so.* lib$f.so
done
done
mv adalib/*.a ./
cd -
%endif
%if_with java
# Relocate Java headers to version-specific compiler directory.
mv %buildroot%_includedir/{{ffi,j}*.h,java,javax,gnu} %buildroot%gcc_target_libdir/include/
mv %buildroot%_includedir/gcj/* %buildroot%gcc_target_libdir/include/gcj/
rmdir %buildroot%_includedir/gcj
# Fix libgcj.spec and move it to compiler-specific directory.
sed 's/-lgcjgc//g;s/-lzgcj//g;s/-lpthread//g' %buildroot%_libdir/libgcj.spec > %buildroot%gcc_target_libdir/libgcj.spec
rm -f %buildroot%_libdir/libgcj.spec
# Rename libgcj.pc to avoid conflict with libgcj4.1-devel.
mv %buildroot%_pkgconfigdir/libgcj{,%psuffix}.pc
# Relocate ffitarget.h
mv %buildroot%gcc_target_libdir/include/{libffi/*.h,}
rmdir %buildroot%gcc_target_libdir/include/libffi
%endif
%if_with cxx
# no valid g++ manpage exists in 3.4 series.
rm -f %buildroot%_man1dir/g++%psuffix.1
ln -s {gcc,%buildroot%_man1dir/g++}%psuffix.1.gz
ln -s {g++%psuffix,%buildroot%_man1dir/g++3}.1.gz
%endif
rm -f %buildroot%gcc_target_libdir/include/zutil.h
rm -rf %buildroot%_mandir/man7 %{?_enable_compat:%buildroot/lib*}
rm -f gcc%psuffix.lang
%find_lang gcc%psuffix
%post
%info_add %name.info
%postun
%info_del %name.info ||:
%post -n cpp3
%info_add cpp3.info
%postun -n cpp3
%info_del cpp3.info
exit 0
%post treelang
%info_add treelang.info
%postun treelang
%info_del treelang.info
exit 0
%post gfortran
%info_add g77.info
%postun gfortran
%info_del g77.info
exit 0
%post java
%info_add gcj.info
%info_add fastjar.info
%postun java
%info_del gcj.info
%info_del fastjar.info
exit 0
%post gnat
%info_add gnat.info
%postun gnat
%info_del gnat.info
exit 0
%post -n gpc
%info_add gpc.info
%postun -n gpc
%info_del gpc.info
exit 0
%post -n libstdc++%gcc_branch -p /sbin/ldconfig
%postun -n libstdc++%gcc_branch -p /sbin/ldconfig
%post -n libg2c0 -p /sbin/ldconfig
%postun -n libg2c0 -p /sbin/ldconfig
%post -n libgpc2 -p /sbin/ldconfig
%postun -n libgpc2 -p /sbin/ldconfig
%post -n libobjc1 -p /sbin/ldconfig
%postun -n libobjc1 -p /sbin/ldconfig
%post -n libobjc1-32bit -p /sbin/ldconfig
%postun -n libobjc1-32bit -p /sbin/ldconfig
%files -f gcc%psuffix.lang
%dir %doc_dir
%doc_dir/gcc
%_bindir/gcc*
%_bindir/gcov*
%_bindir/protoize*
%_bindir/unprotoize*
%_bindir/%_target_platform-gcc%psuffix
%_bindir/%_target_platform-gcov%psuffix
%_bindir/%_target_platform-protoize%psuffix
%_bindir/%_target_platform-unprotoize%psuffix
%_mandir/man1/gcc*
%_mandir/man1/gcov*
%dir %gcc_target_libdir
%gcc_target_libdir/libgcc_s.so
%gcc_target_libdir/crt*.o
%gcc_target_libdir/libgcc*.a
%gcc_target_libdir/libgcov.a
%dir %gcc_target_libdir/include
%gcc_target_libdir/include/float.h
%gcc_target_libdir/include/*mmintrin.h
%gcc_target_libdir/include/iso646.h
%gcc_target_libdir/include/limits.h
%gcc_target_libdir/include/stdarg.h
%gcc_target_libdir/include/stdbool.h
%gcc_target_libdir/include/stddef.h
%gcc_target_libdir/include/syslimits.h
%gcc_target_libdir/include/unwind.h
%gcc_target_libdir/include/varargs.h
%gcc_target_libdir/include/README
%gcc_target_libdir/SYSCALLS.c.X
%gcc_target_libdir/specs
%if "%gcc_target_libdir" != "%gcc_target_libexecdir"
%dir %gcc_target_libexecdir
%endif
%gcc_target_libexecdir/collect2
%_infodir/gcc*.info*
%if_enabled multilib
%files 32bit
%dir %gcc_target_libdir/32
%gcc_target_libdir/32/*.o
%gcc_target_libdir/libgcc_s_32.so
%gcc_target_libdir/32/libgc*
%endif
%if_disabled compat
%files -n libgcc%gcc_branch
/%_lib/libgcc_s.so.*
%files -n libstdc++%gcc_branch
%_libdir/libstdc++.so.*
#%%if_enabled multilib
%if 0%{?_enable_multilib}
%files -n libstdc++%gcc_branch-32bit
%_prefix/lib/libstdc++.so.*
%endif
%endif
%files -n cpp3
%_bindir/cpp*
%_bindir/%_target_platform-cpp%psuffix
%_mandir/man1/cpp*
%dir %gcc_target_libexecdir
%gcc_target_libexecdir/cc1
%_infodir/cpp*.info*
%if_with cxx
%files -n libstdc++%gcc_branch-devel
%dir %doc_dir
%doc_dir/libstdc++
%_includedir/c++/*
%exclude %_includedir/c++/*/*/*/*.gch
%dir %gcc_target_libdir
%gcc_target_libdir/libstdc++.so
%gcc_target_libdir/libsupc++.a
%files -n libstdc++%gcc_branch-devel-static
%dir %gcc_target_libdir
%gcc_target_libdir/libstdc++*.a
%files -n libstdc++%gcc_branch-devel-precompiled
%_includedir/c++/*/*/*/*.gch
%files c++
%dir %doc_dir
%doc_dir/g++*
%_bindir/g++%psuffix
%_bindir/%_target_platform-g++%psuffix
%_mandir/man1/g++*
%dir %gcc_target_libexecdir
%gcc_target_libexecdir/cc1plus
#%%if_enabled multilib
%if 0%{?_enable_multilib}
%files -n libstdc++%gcc_branch-devel-32bit
%gcc_target_libdir/32/libstdc++.so
%gcc_target_libdir/32/libsupc++.a
%files -n libstdc++%gcc_branch-devel-static-32bit
%gcc_target_libdir/32/libstdc++*.a
%endif
%endif
%if_with objc
%files -n libobjc1
%_libdir/libobjc*.so.*
%files objc
%doc %dir %doc_dir
%doc_dir/objc
%doc %doc_dir/libobjc
%dir %gcc_target_libdir
%if "%gcc_target_libdir" != "%gcc_target_libexecdir"
%dir %gcc_target_libexecdir
%endif
%gcc_target_libexecdir/cc1obj
%gcc_target_libdir/libobjc*.so
%dir %gcc_target_libdir/include
%gcc_target_libdir/include/objc
%gcc_target_libdir/libobjc*.a
#%%if_enabled multilib
%if 0%{?_enable_multilib}
%files -n libobjc1-32bit
%_prefix/lib/libobjc*.so.*
%files objc
%dir %gcc_target_libexecdir/32
%gcc_target_libexecdir/32/libobjc*
%endif
%endif
%if_with treelang
%files treelang
%_bindir/gtreelang*
%_bindir/%_target_platform-gtreelang%psuffix
%dir %doc_dir
%doc_dir/treelang
%dir %gcc_target_libexecdir
%gcc_target_libexecdir/tree1
%_infodir/treelang.info*
%endif
%if_with fortran
%files -n libg2c0
%_libdir/libg2c.so.*
%files gfortran
%doc %dir %doc_dir
%doc %doc_dir/g77
%doc_dir/libg2c
%_bindir/gfortran*
%_bindir/%_target_platform-gfortran%psuffix
%_mandir/man1/g77*
%dir %gcc_target_libdir
%if "%gcc_target_libdir" != "%gcc_target_libexecdir"
%dir %gcc_target_libexecdir
%endif
%gcc_target_libdir/libfrtbegin.a
%gcc_target_libdir/libg2c.*
%dir %gcc_target_libdir/include
%gcc_target_libdir/include/g2c.h
%gcc_target_libexecdir/f771
%_infodir/g77.info*
#%%if_enabled multilib
%if 0%{?_enable_multilib}
%files -n libg2c0-32bit
%_prefix/lib/libg2c.so.*
%files -n libg2c0-devel-32bit
%dir %gcc_target_libexecdir/32
%gcc_target_libexecdir/32/libg2c.*
%gcc_target_libexecdir/32/libfrtbegin.a
%endif
%endif
%if_with java
%files -n libffi%gcc_branch
%_libdir/libffi.so.*
%files -n libffi%gcc_branch-devel
%dir %gcc_target_libdir
%gcc_target_libdir/libffi.so
%dir %gcc_target_libdir/include
%gcc_target_libdir/include/*ffi*
%doc_dir/libffi
%files -n libffi%gcc_branch-devel-static
%dir %gcc_target_libdir
%gcc_target_libdir/libffi.a
%files -n libgcj%gcc_branch
%_libdir/libgcj.so.*
%_libdir/lib-org-*.so.*
%_datadir/java/*
%files -n libgcj%gcc_branch-awt
%_libdir/lib-gnu-java-*.so.*
%files -n libgcj%gcc_branch-devel
%dir %doc_dir
%doc_dir/boehm-gc
%doc_dir/libjava
%_pkgconfigdir/libgcj%psuffix.pc
%dir %gcc_target_libdir
%gcc_target_libdir/libgcj.spec
%gcc_target_libdir/libgcj.so
%gcc_target_libdir/lib-org-*.so
%gcc_target_libdir/lib-gnu-java-*.so
%dir %gcc_target_libdir/include
%gcc_target_libdir/include/j*.h
%gcc_target_libdir/include/java
%gcc_target_libdir/include/javax
%gcc_target_libdir/include/gnu
%gcc_target_libdir/include/gcj
%files -n libgcj%gcc_branch-devel-static
%dir %gcc_target_libdir
%gcc_target_libdir/libgcj.a
%gcc_target_libdir/lib-org-*.a
%gcc_target_libdir/lib-gnu-java-*.a
%files java
%dir %doc_dir
%doc_dir/fastjar
%doc_dir/java
%_bindir/*gcj*%psuffix
%_bindir/*gij%psuffix
%_bindir/*jcf-dump%psuffix
%_bindir/*jv-convert%psuffix
%_bindir/*jv-scan%psuffix
%_bindir/*jar%psuffix
%_bindir/*rmi*%psuffix
%_mandir/man1/gij*
%_mandir/man1/gcj*
%_mandir/man1/jv-convert*
%_mandir/man1/jv-scan*
%_mandir/man1/jcf-dump*
%_mandir/man1/*rmi*
%_mandir/man1/*jar*
%dir %gcc_target_libexecdir
%gcc_target_libexecdir/jc1
%gcc_target_libexecdir/jvgenmain
%_infodir/gcj.info*
%_infodir/fastjar.info*
%endif
%if_with ada
%files gnat
%_bindir/gnat*
%_bindir/gpr*
%dir %gcc_target_libdir
%gcc_target_libdir/ada*
%dir %gcc_target_libexecdir
%gcc_target_libexecdir/gnat1
%_datadir/gnat
%_infodir/gnat*.info*
%files -n libgnat%gcc_branch
%_libdir/libgnat-*.so.*
%_libdir/libgnarl-*.so.*
%files -n libgnat%gcc_branch-devel
%gcc_target_libdir/libgna*.so
%ifarch %ix86
%gcc_target_libdir/libgmem.a
%endif
%dir %doc_dir
%doc_dir/ada
%files -n libgnat%gcc_branch-devel-static
%gcc_target_libdir/libgna*.a
%endif
%if_with pascal
%files -n libgpc2
%_libdir/libgpc.so*
%files -n gpc
%_bindir/binobj
%_bindir/gp*
%gcc_target_libdir/gpc*
%gcc_target_libdir/libgpc*
%dir %gcc_target_libdir/include
%gcc_target_libdir/include/gpc*
%gcc_target_libdir/units
%_mandir/man1/gpc*
%_infodir/gpc*
%files -n gpc-doc
%doc %_docdir/gpc
%endif
%if_with pdf
%files doc
%doc gcc/doc/*.pdf
%endif
%changelog