#!/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 [ $# -eq 1 -a "$1" == "-print-multi-os-directory" ]; then
  # ppp Fedora package applies a patch that depends on this option.
  gcc-real $1
else
  clang "$@"
fi
