Instead of hardcoding GCC version (which can vary across different architectures), you can use something similar to the following: GCC_VERSION=$(readlink /usr/bin/gcc | sed 's/gcc-//')