Просмотр исходного кода

switch to %option(s) and remove dynamic default for binutils because this makes trouble and is inconsistent anyway

Ralf S. Engelschall 23 лет назад
Родитель
Сommit
ab464b683d
2 измененных файлов с 8 добавлено и 83 удалено
  1. 0 62
      gcc/gcc.sh
  2. 8 21
      gcc/gcc.spec

+ 0 - 62
gcc/gcc.sh

@@ -1,62 +0,0 @@
-#!/bin/sh
-##
-##  gcc.sh -- GCC Package Build Utility
-##  Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com> 
-##
-
-check="$1"
-shift
-case $check in
-    require-binutils ) 
-         #   determine whether GNU gcc requires GNU binutils on this platform
-         require="no"
-         target="$1"
-         shift
-         case $target in
-            *-linux* )
-                #   under Linux the vendor ld is GNU binutils,
-                #   but make sure it is GNU binutils >= 2.12
-                if [ -f /etc/debian_version ]; then
-                    v=`/usr/bin/dpkg -l binutils | grep binutils | awk '{ print $3; }'`
-                elif [ -f /etc/redhat-release ]; then
-                    v=`/bin/rpm -q --qf '%{VERSION}' binutils`
-                elif [ -f /etc/SuSE-release ]; then
-                    v=`/bin/rpm -q --qf '%{VERSION}' binutils`
-                else
-                    v=`(/usr/bin/ld --version | grep 'GNU ld' | sed -e 's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
-                fi
-                case "$v" in
-                    2.1[2-9] | 2.1[2-9].* ) ;;
-                    * ) require="yes" ;;
-                esac
-                ;;
-             *-freebsd* )
-                #   under FreeBSD the vendor ld is GNU binutils,
-                #   but make sure it is GNU binutils >= 2.12
-                v=`(/usr/bin/ld --version | grep 'GNU ld' | sed -e 's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
-                case "$v" in
-                    2.1[2-9] | 2.1[2-9].* ) ;;
-                    * ) require="yes" ;;
-                esac
-                ;;
-             * )
-                #   under other OS the vendor ld is usually not GNU binutils,
-                #   but if it is, make sure it is GNU binutils >= 2.12
-                for dir in /bin /usr/bin /usr/ccs/bin /sbin /usr/sbin /usr/ccs/sbin; do
-                    if [ -f "$dir/ld" ]; then
-                        if [ ".`($dir/ld --version) 2>/dev/null | grep 'GNU ld'`" != . ]; then
-                            v=`($dir/ld --version | grep 'GNU ld' | sed -e 's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
-                            #   require GNU binutils >= 2.12
-                            case "$v" in
-                                2.1[2-9] | 2.1[2-9].* ) ;;
-                                * ) require="yes"; break ;;
-                            esac
-                        fi
-                    fi
-                done
-                ;;
-         esac
-         echo "$require" | awk '{ printf("%s", $1); }'
-         ;;
-esac
-

+ 8 - 21
gcc/gcc.spec

@@ -29,18 +29,10 @@
 %define       V_long         3.2.1
 
 #   package options
-%ifndef       with_cxx
-%define       with_cxx       yes
-%endif
-%ifndef       with_optimize
-%define       with_optimize  yes
-%endif
-%ifndef       with_binutils
-%define       with_binutils  %(if [ -f %{SOURCE gcc.sh} ]; then sh %{SOURCE gcc.sh} require-binutils %{l_target}; else echo "no"; fi)
-%endif
-%ifndef       with_threads
-%define       with_threads   yes
-%endif
+%option       with_cxx       yes
+%option       with_optimize  yes
+%option       with_binutils  yes
+%option       with_threads   yes
 
 #   package information
 Name:         gcc
@@ -52,18 +44,17 @@ Distribution: OpenPKG [CORE]
 Group:        Language
 License:      GPL
 Version:      %{V_short}
-Release:      20021125
+Release:      20021230
 
 #   list of sources
 Source0:      ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_long}/gcc-%{V_long}.tar.bz2
-Source1:      gcc.sh
 Patch0:       gcc.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20020206, make
-PreReq:       OpenPKG, openpkg >= 20020206
+BuildPreReq:  OpenPKG, openpkg >= 20021230, make
+PreReq:       OpenPKG, openpkg >= 20021230
 %if "%{with_binutils}" == "yes"
 BuildPreReq:  binutils >= 2.13
 PreReq:       binutils >= 2.13
@@ -75,11 +66,7 @@ AutoReqProv:  no
     The GNU Compiler Collection (GCC) provides a standard conforming and
     highly portable ISO C and ISO C++ compiler.
 
-    Options:
-    --define 'with_cxx %{with_cxx}'
-    --define 'with_optimize %{with_optimize}'
-    --define 'with_binutils %{with_binutils}'
-    --define 'with_threads %{with_threads}'
+    %options -p13
 
 %prep
     %setup -q -n gcc-%{V_long}