Changeset 649a64c in rtems-source-builder for source-builder/config/gcc-common-1.cfg


Ignore:
Timestamp:
Apr 16, 2013, 4:25:34 AM (8 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
82e9f91
Parents:
b022691
git-author:
Chris Johns <chrisj@…> (04/16/13 04:25:34)
git-committer:
Chris Johns <chrisj@…> (04/16/13 04:28:34)
Message:

Add download git support.

Add support to use a git cloned repo as the source. Move the download
code out of the build module and into a separate module. Add to this
module support for git.

Update the GCC common configuration to support using a symlinked
git repo.

Add checks for all languages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/config/gcc-common-1.cfg

    rb022691 r649a64c  
    3434%prep
    3535  # gcc and optional the g++ core if separate packages
     36  source_dir_0="gcc-%{gcc_version}"
    3637  %setup -q -c -n %{name}-%{version}
    3738  %{?source1:%setup -q -D -T -n %{name}-%{version} -a1}
    38   cd gcc-%{gcc_version}
     39  cd ${source_dir_0}
    3940  %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
    4041  %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
     
    5051
    5152  # newlib
     53  source_dir_10="newlib-%{newlib_version}"
    5254  %setup -q -D -T -n %{name}-%{version} -a10
    53   cd newlib-%{newlib_version}
     55  cd ${source_dir_10}
    5456  %{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}}
    5557  %{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}}
     
    6567
    6668  # Link newlib into the gcc source tree
    67   ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version}
     69  %{__rmfile} ${source_dir_0}/newlib
     70  %{__ln_s} $PWD/${source_dir_10}/newlib ${source_dir_0}/newlib
    6871
    6972  # MPFR
     73  source_dir_20="mpfr-%{mpfr_version}"
    7074  %setup -q -D -T -n %{name}-%{version} -a20
    71   cd mpfr-%{mpfr_version}
     75  cd ${source_dir_20}
    7276  %{?patch20:%patch20 -p1}
    7377  cd ..
    7478  # Build MPFR one-tree style
    75   ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_version}/mpfr
     79  %{__rmfile} ${source_dir_0}/mpfr
     80  %{__ln_s} $PWD/${source_dir_20} ${source_dir_0}/mpfr
    7681
    7782  # MPC
     83  source_dir_21="mpc-%{mpc_version}"
    7884  %setup -q -D -T -n %{name}-%{version} -a21
    79   cd mpc-%{mpc_version}
     85  cd ${source_dir_21}
    8086  %{?patch21:%patch21 -p1}
    8187  cd ..
    8288  # Build MPC one-tree style
    83   ln -s ../mpc-%{mpc_version} gcc-%{gcc_version}/mpc
     89  %{__rmfile} ${source_dir_0}/mpc
     90  %{__ln_s} $PWD/${source_dir_21} ${source_dir_0}/mpc
    8491
    8592  # GMP
     93  source_dir_22="gmp-%{gmp_version}"
    8694  %setup -q -D -T -n %{name}-%{version} -a22
    87   cd gmp-%{gmp_version}
     95  cd ${source_dir_22}
    8896  %{?patch22:%patch22 -p1}
    8997  cd ..
    9098  # Build GMP one-tree style
    91   ln -s ../gmp-%{gmp_version} gcc-%{gcc_version}/gmp
    92 
    93   echo "%{gcc_version_message}" > gcc-%{gcc_version}/gcc/DEV-PHASE
     99  %{__rmfile} ${source_dir_0}/gmp
     100  %{__ln_s} $PWD/${source_dir_22} ${source_dir_0}/gmp
     101
     102  echo "%{gcc_version_message}" > ${source_dir_0}/gcc/DEV-PHASE
    94103
    95104  # Fix timestamps
    96   cd gcc-%{gcc_version}
     105  cd ${source_dir_0}
    97106  contrib/gcc_update --touch
    98107  cd ..
    99108
    100109%build
     110  # Build directory support.
    101111  if test "%{_build}" != "%{_host}" ; then
    102112    build_dir="build-cxc"
     
    106116  mkdir -p ${build_dir}
    107117  cd ${build_dir}
     118
     119  # Languages.
    108120  languages="c"
    109121%if %{enable_cxx}
    110122  languages="$languages,c++"
    111123%endif
     124%if %{enable_ada}
     125  languages="$languages,ada"
     126%endif
     127%if %{enable_go}
     128  languages="$languages,go"
     129%endif
     130%if %{enable_fortran}
     131  languages="$languages,fortran"
     132%endif
     133%if %{enable_java}
     134  languages="$languages,java"
     135%endif
     136%if %{enable_objc}
     137  languages="$languages,objc"
     138%endif
     139
     140  # Host flags
    112141  if test "%{_build}" != "%{_host}" ; then
    113142    CFLAGS_FOR_BUILD="-g -O2 -Wall"
     
    121150  fi
    122151  export CFLAGS CFLAGS_FOR_BUILD CC CXXFLAGS_FOR_BUILD CXX
    123   ../gcc-%{gcc_version}/configure \
     152
     153  ../${source_dir_0}/configure \
    124154    --prefix=%{_prefix} \
    125155    --bindir=%{_bindir} \
     
    148178    --enable-languages="$languages"
    149179
    150   unset CFLAGS CFLAGS_FOR_BUILD CC CXXFLAGS_FOR_BUILD CXX
    151 
    152180  if test "%_host" != "%_build" ; then
    153181    # Bug in gcc-3.2.1:
    154182    # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
    155183    mkdir -p gcc/include
    156     cp ../gcc-%{gcc_version}/gcc/gsyslimits.h gcc/include/syslimits.h
     184    cp ../${source_dir_0}/gcc/gsyslimits.h gcc/include/syslimits.h
    157185  fi
    158186
    159187  %{__make} %{?_smp_mflags} all
    160188  cd ..
     189
     190  unset CFLAGS CFLAGS_FOR_BUILD CC CXXFLAGS_FOR_BUILD CXX
    161191
    162192%install
     
    180210  %{__rmfile} $SB_BUILD_ROOT%{_mandir}/man3/*ffi*
    181211
     212  # Clean the symlinks away incase the source is a repo
     213  %{__rmfile} ${source_dir_0}/newlib
     214  %{__rmfile} ${source_dir_0}/mpfr
     215  %{__rmfile} ${source_dir_0}/mpc
     216  %{__rmfile} ${source_dir_0}/gmp
     217
    182218%testing
    183219  # Add testing here.
Note: See TracChangeset for help on using the changeset viewer.