Consolidate GCC 10 installation steps into single script format

This commit is contained in:
Shang Chieh Tseng
2025-10-28 15:28:11 +08:00
parent 85d98064d1
commit 29706d14d7

View File

@@ -444,55 +444,36 @@ EOF
#### Installation Steps
1. **Update and Install Prerequisites:**
**Complete installation script:**
```bash
# Install prerequisites
dnf -y install wget unzip lbzip2
dnf -y groupinstall "Development Tools"
```
2. **Download GCC 10 Source Code:**
```bash
# Download and extract GCC 10 source
cd /usr/local/src
wget https://github.com/gcc-mirror/gcc/archive/refs/heads/releases/gcc-10.zip
```
3. **Extract Source Code:**
```bash
unzip gcc-10.zip
cd gcc-releases-gcc-10
```
4. **Download Prerequisites:**
```bash
# Download GCC prerequisites (GMP, MPFR, MPC, ISL)
contrib/download_prerequisites
```
5. **Create Installation Directory:**
```bash
# Create build directory and configure
mkdir /usr/local/gcc-10
```
6. **Configure GCC Build:**
```bash
cd /usr/local/gcc-10
/usr/local/src/gcc-releases-gcc-10/configure --disable-multilib
```
7. **Compile GCC:**
```bash
# Compile and install (1-2 hours depending on CPU)
make -j $(nproc)
```
> **Estimated time**: 1-2 hours depending on CPU performance
8. **Install GCC:**
```bash
make install
```
9. **Post-Install Configuration:**
> **Note**: The compilation step `make -j $(nproc)` will take 1-2 hours depending on your CPU performance. The `$(nproc)` command uses all available CPU cores to speed up compilation.
**Post-Install Configuration:**
```bash
# Create environment script
# Create environment script for library paths
cat > /etc/profile.d/gcc-10.sh << 'EOF'
#!/bin/sh
# gcc-10.sh - GCC 10 library path configuration
@@ -504,7 +485,7 @@ EOF
ldconfig
```
10. **Verify Installation:**
**Verify Installation:**
```bash
/usr/local/bin/gcc --version
# Should output: gcc (GCC) 10.x.x