head	1.10;
access;
symbols
	OPENPKG_E1_MP_HEAD:1.10
	OPENPKG_E1_MP:1.10
	OPENPKG_1_3_RELEASE:1.7.2.1.2.1
	OPENPKG_1_3_SOLID:1.7.2.1.0.2
	OPENPKG_1_3_SOLID_BP:1.7.2.1
	OPENPKG_1_STABLE:1.7.0.2
	OPENPKG_1_STABLE_MP:1.7;
locks; strict;
comment	@-- @;


1.10
date	2003.12.28.12.30.43;	author rse;	state dead;
branches;
next	1.9;

1.9
date	2003.09.09.09.52.14;	author rse;	state Exp;
branches;
next	1.8;

1.8
date	2003.07.31.17.46.58;	author ms;	state Exp;
branches;
next	1.7;

1.7
date	2003.07.23.13.31.52;	author rse;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2003.07.08.14.39.37;	author rse;	state Exp;
branches;
next	1.5;

1.5
date	2003.07.04.09.40.57;	author rse;	state Exp;
branches;
next	1.4;

1.4
date	2003.07.02.07.48.25;	author rse;	state Exp;
branches;
next	1.3;

1.3
date	2003.07.01.13.34.13;	author rse;	state Exp;
branches;
next	1.2;

1.2
date	2003.06.30.09.15.48;	author mlelstv;	state Exp;
branches;
next	1.1;

1.1
date	2003.06.03.10.28.29;	author rse;	state Exp;
branches;
next	;

1.7.2.1
date	2003.07.24.20.49.34;	author rse;	state Exp;
branches
	1.7.2.1.2.1;
next	;

1.7.2.1.2.1
date	2003.07.29.14.58.58;	author rse;	state Exp;
branches;
next	;


desc
@@


1.10
log
@gcc 3.2 is already fully replaced with the current gcc 3.3, so no need for this package any more
@
text
@##
##  gcc32.spec -- OpenPKG RPM Specification
##  Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
##  Copyright (c) 2000-2003 Ralf S. Engelschall <rse@@engelschall.com>
##  Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##

#   package version
%define       V_full         3.2.3
%define       V_comp         32
%define       V_bounds       1.01

#   package information
Name:         gcc32
Summary:      GNU Compiler Collection
URL:          http://gcc.gnu.org/
Vendor:       Free Software Foundation
Packager:     The OpenPKG Project
Distribution: OpenPKG [PLUS]
Group:        Compiler
License:      GPL
Version:      %{V_full}
Release:      20030909

#   package options
%option       with_cxx       yes
%option       with_optimize  yes
%option       with_binutils  yes
%option       with_threads   yes
%option       with_bounds    no
%option       with_gcc       no

#   list of sources
Source0:      ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
Patch0:       gcc32.patch
Patch1:       http://web.inter.nl.net/hcc/Haj.Ten.Brugge/bounds-checking-gcc-%{version}-%{V_bounds}.patch.bz2

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 20030909, make
PreReq:       OpenPKG, openpkg >= 20030909
%if "%{with_binutils}" == "yes"
BuildPreReq:  binutils >= 2.13
PreReq:       binutils >= 2.13
%endif
AutoReq:      no
AutoReqProv:  no
%if "%{with_gcc}" == "yes"
Provides:     gcc = %{version}-%{release}
%endif

%description
    The GNU Compiler Collection (GCC) provides a standard conforming and
    highly portable ISO C and ISO C++ compiler.

%prep
    %setup -q -n gcc-%{version}
    %patch0 -p0
%if "%{with_bounds}" == "yes"
    %patch1 -p1
%endif
    %{l_shtool} subst -v -s \
        -e "s;PREFIX_INCLUDE_DIR;PREFIX_INCLUDE_DIR_DISABLED;g" \
        gcc/configure

%build
    #   create build sub-directory
    mkdir obj
    cd obj

    #   determine ld(1) and as(1) usage
    l_with_gnu_ld_as=""
%if "%{with_binutils}" == "yes"
    l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-ld --with-ld=%{l_prefix}/bin/ld"
    l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-as --with-as=%{l_prefix}/bin/as"
%else
    case "%{l_platform -t}" in
       *-linux* | *-freebsd* )
           l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-as --with-gnu-ld"
           ;;
    esac
%endif

    #   determine threads usage
%if "%{with_threads}" == "yes"
    l_enable_threads="posix"
%else
    l_enable_threads="single"
%endif

    #   determine language usage
    l_enable_languages="c"
%if "%{with_cxx}" == "yes"
    l_enable_languages="${l_enable_languages},c++"
%endif

    #   configure the package
    CC="%{l_cc}" \
    CFLAGS="%{l_cflags}" \
    ../configure \
        --prefix=%{l_prefix} \
        --exec-prefix=%{l_prefix} \
        --includedir=%{l_prefix}/include/gcc%{V_comp} \
        --with-gxx-include-dir=%{l_prefix}/include/g++%{V_comp} \
        --with-local-prefix=%{l_prefix}/lib/gcc%{V_comp}-lib \
        --enable-languages="${l_enable_languages}" \
        --enable-threads="${l_enable_threads}" \
        --disable-maintainer-mode \
        --disable-shared \
        --disable-nls \
        ${l_with_gnu_ld_as}

    #   explicitly redirect remaining gcc-lib directories
    %{l_shtool} subst -v -s \
        -e "s;/gcc-lib/;/gcc%{V_comp}-lib/;" \
        `find . -name Makefile -type f -print`

    #   determine build flags
    l_cflags=""
    l_boot_cflags=""
    l_libcflags="-g"
    l_libcxxflags="-g"
%if "%{with_binutils}" == "yes"
    #   at least GNU as from GNU binutils supports -pipe always
    l_boot_cflags="$l_boot_cflags -pipe"
    l_libcxxflags="$l_libcxxflags -pipe"
%endif
%if "%{with_optimize}" == "yes"
    #   conservatively optimize the generated program code
    #   (also _tune_ for particular CPUs, but _without_ requiring these CPUs!)
    l_cflags="$l_cflags -O"
    l_boot_cflags="$l_boot_cflags -O2 -fomit-frame-pointer -funroll-loops"
    case "%{l_platform -t}" in
        *i?86-*  ) l_boot_cflags="$l_boot_cflags -mcpu=pentium3" ;;
        *sun4u-* ) l_boot_cflags="$l_boot_cflags -mtune=v9"      ;;
    esac
    l_libcxxflags="$l_libcxxflags -O2 -fno-implicit-templates"
%else
    #   else do no optimizations at all to reduce problems to minimum in advance
    l_boot_cflags="$l_boot_cflags -O0"
    l_libcxxflags="$l_libcxxflags -O0"
%endif

    #   build the package
    %{l_make} %{l_mflags} \
        MAKE="%{l_make} %{l_mflags}" \
        BOOT_CFLAGS="${l_boot_cflags}" \
        CFLAGS="${l_cflags}" \
        LIBCFLAGS="${l_libcflags}" \
        LIBCXXFLAGS="${l_libcxxflags}" \
        bootstrap-lean

%install
    rm -rf $RPM_BUILD_ROOT

    #   fetch GNU platform triple
    triple=`./config.guess`
    triple=`./config.sub ${triple}`

    #   perform the standard installation procedure
    ( cd obj
      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
    ) || exit $?

    #   cleanup installation tree
    mv $RPM_BUILD_ROOT%{l_prefix}/lib/lib*.a \
       $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}-lib/${triple}/%{V_full}/
    for multilib in `$RPM_BUILD_ROOT%{l_prefix}/bin/gcc --print-multi-lib`; do
        subdir=`echo "$multilib" | sed -e 's/;.*$//'`
        [ ".$subdir" = .. ] && continue
        mv $RPM_BUILD_ROOT%{l_prefix}/lib/$subdir/lib*.a \
           $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}-lib/${triple}/%{V_full}/$subdir/
        rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/$subdir
    done
    mv $RPM_BUILD_ROOT%{l_prefix}/${triple}/include/* \
       $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}-lib/${triple}/%{V_full}/include/ \
           >/dev/null 2>&1 || true

    #   strip installation tree
    rm -rf $RPM_BUILD_ROOT%{l_prefix}/${triple}
    rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man7   >/dev/null 2>&1 || true
    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/*.la   >/dev/null 2>&1 || true
    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/*-gcc* >/dev/null 2>&1 || true
%if "%{with_cxx}" == "yes"
    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/*-c++  >/dev/null 2>&1 || true
    rm -f  $RPM_BUILD_ROOT%{l_prefix}/bin/*-g++  >/dev/null 2>&1 || true
%endif
    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
    for prog in cc1 cc1plus collect2 cpp; do
        strip $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}-lib/${triple}/%{V_full}/${prog} \
            >/dev/null 2>&1 || true
    done

    #   bump up installation tree
    ln $RPM_BUILD_ROOT%{l_prefix}/bin/gcc \
       $RPM_BUILD_ROOT%{l_prefix}/bin/cc
    ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/gcc.1 \
       $RPM_BUILD_ROOT%{l_prefix}/man/man1/cc.1
%if "%{with_cxx}" == "yes"
    ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/g++.1 \
       $RPM_BUILD_ROOT%{l_prefix}/man/man1/c++.1
%endif

    #   resolve filename conflicts
%if "%{with_gcc}" != "yes" && "%{V_comp}" != ""
    ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
      for file in *; do
          mv ${file} ${file}%{V_comp}
      done
    ) || exit $?
    ( cd $RPM_BUILD_ROOT%{l_prefix}/info
      for file in *; do
          mv ${file} `echo ${file} | sed -e 's;^\([^.]*\)\(\..*\)$;\1%{V_comp}\2;'`
      done
    ) || exit $?
    ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man1
      for file in *; do
          mv ${file} `echo ${file} | sed -e 's;^\([^.]*\)\(\..*\)$;\1%{V_comp}\2;'`
      done
    ) || exit $?
%endif

    #   determine installation file list
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}

%files -f files

%clean
    rm -rf $RPM_BUILD_ROOT

@


1.9
log
@convert to new %{l_platform} world order
@
text
@@


1.8
log
@RT#220, correct group names
@
text
@d41 1
a41 1
Release:      20030731
d59 2
a60 2
BuildPreReq:  OpenPKG, openpkg >= 20030103, make
PreReq:       OpenPKG, openpkg >= 20030103
d96 1
a96 1
    case "%{l_target}" in
d152 3
a154 3
    case "%{l_target}" in
        *x86-*     ) l_boot_cflags="$l_boot_cflags -mcpu=pentium3" ;;
        *sparc64-* ) l_boot_cflags="$l_boot_cflags -mtune=v9"      ;;
@


1.7
log
@achieve robust subshell handling by consistently using '(...) || exit 0' constructs to make sure the scripts fail if a subshell fails
@
text
@d38 1
a38 1
Group:        Language
d41 1
a41 1
Release:      20030723
@


1.7.2.1
log
@mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class PLUS only]
@
text
@d41 1
a41 1
Release:      1.20030724
d59 2
a60 2
BuildPreReq:  OpenPKG, openpkg >= 1.20030724, make
PreReq:       OpenPKG, openpkg >= 1.20030724
@


1.7.2.1.2.1
log
@bump release numbers on OpenPKG 1.3-STABLE branch for OpenPKG 1.3.0-RELEASE
@
text
@d41 1
a41 1
Release:      1.3.0
d59 2
a60 2
BuildPreReq:  OpenPKG, openpkg >= 1.3.0, make
PreReq:       OpenPKG, openpkg >= 1.3.0
@


1.6
log
@cleanup copyright part by using just the main company name of Cable & Wireless and adding the URL to the global website
@
text
@d41 1
a41 1
Release:      20030704
d181 2
a182 1
      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT )
d228 2
a229 1
      done )
d233 2
a234 1
      done )
d238 2
a239 1
      done )
@


1.5
log
@add multilib support here, too
@
text
@a2 1
##  Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
d5 1
@


1.4
log
@cleanup again the build flags to 100% match those in the 'gcc' package
@
text
@d41 1
a41 1
Release:      20030702
d186 7
@


1.3
log
@finally fix the build flags handling
@
text
@d41 1
a41 1
Release:      20030701
d138 1
a139 1
    l_cflags=""
d144 1
a144 2
    l_cflags="$l_cflags -pipe"
    l_libcflags="$l_libcflags -pipe"
d150 2
a151 1
    l_cflags="$l_cflags -O2 -fomit-frame-pointer -funroll-loops"
d153 2
a154 2
        *x86-*     ) l_cflags="$l_cflags -mcpu=pentium3" ;;
        *sparc64-* ) l_cflags="$l_cflags -mtune=v9"      ;;
d156 1
a156 2
    l_libcflags="$l_libcflags -O"
    l_libcxxflags="$l_libcxxflags -O -fno-implicit-templates"
d159 1
a159 2
    l_cflags="$l_cflags -O0"
    l_libcflags="$l_libcflags -O0"
@


1.2
log
@fix building on solaris
@
text
@d41 1
a41 1
Release:      20030630
d138 1
a139 1
    l_boot_cflags=""
d144 3
a146 3
    l_boot_cflags="$l_boot_cflags"
    l_libcflags="$l_libcflags"
    l_libcxxflags="$l_libcxxflags"
d151 1
a151 2
    l_cflags="$l_cflags -O"
    l_boot_cflags="$l_boot_cflags -O2 -fomit-frame-pointer -funroll-loops"
d153 2
a154 2
        *x86-*     ) l_boot_cflags="$l_boot_cflags -mcpu=pentium3" ;;
        *sparc64-* ) l_boot_cflags="$l_boot_cflags -mtune=v9"      ;;
d160 1
a160 1
    l_boot_cflags="$l_boot_cflags -O0"
@


1.1
log
@provide the old 'gcc' package version in a new compat package
@
text
@d41 1
a41 1
Release:      20030603
d144 3
a146 3
    l_boot_cflags="$l_boot_cflags -pipe"
    l_libcflags="$l_libcflags -pipe"
    l_libcxxflags="$l_libcxxflags -pipe"
d157 2
a158 2
    l_libcflags="$l_libcflags -O2"
    l_libcxxflags="$l_libcxxflags -O2 -fno-implicit-templates"
@

