Add some comments about bootstrapping and rename a few variables for clarity

epel9
Kalev Lember 4 years ago
parent fc2289651c
commit ffa423a56d

@ -7,11 +7,15 @@
%global llvm_version 10 %global llvm_version 10
# Enable this for bootstrapping with an older version that doesn't require a # bootstrap_stage1 is for bringing up a D compiler for the very first time,
# working D compiler to build itself # without having a working D compiler in the build root.
%global bootstrap 0 %global bootstrap_stage1 0
%global bootstrap_version 0.17.6 %global bootstrap_stage1_ldc_version 0.17.6
# bootstrap_stage2 is for updating LDC to a newer version: it relies on an
# older, working LDC compiler in the buildroot, which is then used to build a
# new intermediate LDC version, and finally this in turn is used to build the
# final compiler that gets installed in the rpm.
%global bootstrap_stage2 0 %global bootstrap_stage2 0
%undefine _hardened_build %undefine _hardened_build
@ -27,14 +31,14 @@ Summary: LLVM D Compiler
License: BSD License: BSD
URL: https://github.com/ldc-developers/ldc URL: https://github.com/ldc-developers/ldc
Source0: https://github.com/ldc-developers/ldc/releases/download/v%{version}%{?pre:-%{pre}}/%{name}-%{version}%{?pre:-%{pre}}-src.tar.gz Source0: https://github.com/ldc-developers/ldc/releases/download/v%{version}%{?pre:-%{pre}}/%{name}-%{version}%{?pre:-%{pre}}-src.tar.gz
%if 0%{?bootstrap} %if 0%{?bootstrap_stage1}
Source1: https://github.com/ldc-developers/ldc/releases/download/v%{bootstrap_version}/%{name}-%{bootstrap_version}-src.tar.gz Source1: https://github.com/ldc-developers/ldc/releases/download/v%{bootstrap_stage1_ldc_version}/%{name}-%{bootstrap_stage1_ldc_version}-src.tar.gz
%endif %endif
Source3: macros.%{name} Source3: macros.%{name}
ExclusiveArch: %{ldc_arches} ExclusiveArch: %{ldc_arches}
%if ! 0%{?bootstrap} %if ! 0%{?bootstrap_stage1}
BuildRequires: ldc BuildRequires: ldc
%endif %endif
BuildRequires: libconfig-devel BuildRequires: libconfig-devel
@ -163,12 +167,12 @@ mkdir geany_config
%global optflags %{optflags} -fno-strict-aliasing %global optflags %{optflags} -fno-strict-aliasing
%if 0%{?bootstrap} %if 0%{?bootstrap_stage1}
tar xf %{SOURCE1} tar xf %{SOURCE1}
mkdir build-bootstrap mkdir build-bootstrap1
pushd build-bootstrap pushd build-bootstrap1
cmake -DLLVM_CONFIG:PATH=%{_bindir}/llvm-config-%{?llvm_version:%{llvm_version}-}%{__isa_bits} \ cmake -DLLVM_CONFIG:PATH=%{_bindir}/llvm-config-%{?llvm_version:%{llvm_version}-}%{__isa_bits} \
../%{name}-%{bootstrap_version}-src ../%{name}-%{bootstrap_stage1_ldc_version}-src
make %{?_smp_mflags} make %{?_smp_mflags}
popd popd
%endif %endif
@ -178,8 +182,8 @@ tar xf %{SOURCE0}
mkdir build-bootstrap2 mkdir build-bootstrap2
pushd build-bootstrap2 pushd build-bootstrap2
cmake -DLLVM_CONFIG:PATH=%{_bindir}/llvm-config-%{?llvm_version:%{llvm_version}-}%{__isa_bits} \ cmake -DLLVM_CONFIG:PATH=%{_bindir}/llvm-config-%{?llvm_version:%{llvm_version}-}%{__isa_bits} \
%if 0%{?bootstrap} %if 0%{?bootstrap_stage1}
-DD_COMPILER:PATH=`pwd`/../build-bootstrap/bin/ldmd2 \ -DD_COMPILER:PATH=`pwd`/../build-bootstrap1/bin/ldmd2 \
%endif %endif
../%{name}-%{version}%{?pre:-%{pre}}-src ../%{name}-%{version}%{?pre:-%{pre}}-src
make %{?_smp_mflags} make %{?_smp_mflags}

Loading…
Cancel
Save