5.3. Build Variables

#### Cross-Compiled Linux From Scratch - Version 1.0.0rc1-Sparc64-Multilib

### Chapter 5. Constructing Cross-Compile Tools

- Prev

  Build CFLAGS

- Next

  Build Flags

- Up.
- Home

# 5.3. Build Variables

#### Setting Host and Target

During the building of the cross-compile tools you will need to set a few variables that will be dependent on your particular needs. The first variable will be the triplet of the `HOST` machine. You will need to set the `CHOST` triplet to match your particular needs. To set this information you can issue the following command:

    export LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"

Now you will need to set the target triplet for the target architecture. You can do this by running the same command as above, just running it on the target machine. If you can't run the command on the target machine, you can use the table at the bottom of this page. Set the command using the method listed below:

    export LFS_TARGET="sparc64-unknown-linux-gnu"

Now we will set our Target Triplet for 32 Bits:

    export LFS_TARGET32="sparc-unknown-linux-gnu"

#### Copy settings to Environment

Now we will add these to `~/.bashrc`, just in case you have to exit and restart building later:

    echo export LFS_HOST=\""${LFS_HOST}\"" >> ~/.bashrc
    echo export LFS_TARGET=\""${LFS_TARGET}\"" >> ~/.bashrc
    echo export LFS_TARGET32=\""${LFS_TARGET32}\"" >> ~/.bashrc

- Prev

  Build CFLAGS

- Next

  Build Flags

- Up.
- Home.