#!/bin/bash

# libtool calls gcc -dumpversion to get the gcc version and then adds an
# explicit requires on that version of gcc.  Therefore, we can't add our
# gcc ->clang symlink to the path, because otherwise libtool will end up
# with: Requires: gcc(major) = $clang_version and won't be installable.
#if [ "$RPM_PACKAGE_NAME" == "libtool" -a $# -eq 1 -a "$1" == "-dumpversion" ]; then
if [ $# -eq 1 -a "$1" == "-dumpversion" ]; then
  gcc-real $1
elif [ $# -eq 1 -a "$1" == "--version" ]; then
  gcc-real $1
elif [ "$RPM_PACKAGE_NAME" == "ppp" ]; then
  gcc-real "$@"
elif [ "$RPM_PACKAGE_NAME" == "ruby" ]; then
  gcc-real "$@"
elif [ "$RPM_PACKAGE_NAME" == "annobin" ]; then
  gcc-real "$@"
elif [ "$RPM_PACKAGE_NAME" == "pcp" ]; then
  gcc-real "$@"
elif [ "$RPM_PACKAGE_NAME" == "thermald" ]; then
  gcc-real "$@"
else
  clang "$@"
fi
