浏览代码

optional support for binutils (hope this helps under brain-dead platforms with too old binutils)

Ralf S. Engelschall 23 年之前
父节点
当前提交
39fddcd376
共有 1 个文件被更改,包括 16 次插入2 次删除
  1. 16 2
      gcc/gcc.spec

+ 16 - 2
gcc/gcc.spec

@@ -35,6 +35,9 @@
 %ifndef       with_optimize
 %define       with_optimize  yes
 %endif
+%ifndef       with_binutils
+%define       with_binutils  yes
+%endif
 
 #   package information
 Name:         gcc
@@ -46,7 +49,7 @@ Distribution: OpenPKG [REL]
 Group:        Language
 License:      GPL
 Version:      %{V_short}
-Release:      20020727
+Release:      20020808
 
 #   list of sources
 Source0:      ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_long}/gcc-%{V_long}.tar.bz2
@@ -57,6 +60,10 @@ Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20020206, make
 PreReq:       OpenPKG, openpkg >= 20020206
+%if "%{with_binutils}" == "yes"
+BuildPreReq:  binutils >= 2.13
+PreReq:       binutils >= 2.13
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -64,7 +71,10 @@ AutoReqProv:  no
     The GNU Compiler Collection (GCC) provides a standard conforming and
     highly portable ISO C and ISO C++ compiler.
 
-    Options: with_cxx=%{with_cxx} with_optimize=%{with_optimize}
+    Options: 
+    --define 'with_cxx %{with_cxx}' \
+    --define 'with_optimize %{with_optimize}' \
+    --define 'with_binutils %{with_binutils}' \
 
 %prep
     %setup -q -n gcc-%{V_long}
@@ -98,6 +108,10 @@ AutoReqProv:  no
         --disable-maintainer-mode \
         --disable-shared \
         --disable-nls \
+%if "%{with_optimize}" == "yes"
+        --with-gnu-ld --with-ld=%{l_prefix}/bin/ld \
+        --with-gnu-as --with-as=%{l_prefix}/bin/as \
+%endif
         $options
 
     #   build the package