#!/bin/sh

prefix=$(dirname $(realpath $0))
libdir="/home/trahay/Soft/opt/pallas/install/lib"

usage()
{
cat << EOF
Usage: $0 [OPTION]... COMMAND
This is the Pallas version of OTF2-config.

Commands:
  --cflags     prints additional compiler flags. They already contain
               the include flags
  --cppflags   prints the include flags for the OTF2 headers
  --libs       prints the required libraries for linking
  --ldflags    prints the required linker flags
  --cc         prints the C compiler name
  --features <FEATURE-CATEGORY>
               prints available features selected by <FEATURE-CATEGORY>.
               Available feature categories:
                * substrates
                * compressions
                * targets
  --help       prints this usage information

  --version    prints the version number of the OTF2 package
  --revision   prints the revision number of the OTF2 package
  --interface-version
               prints the interface version number
  --config-summary
               prints the configure summary of the OTF2 package
  --pythonpath
               prints the python path for the OTF2 modules

Options:
  --target <TARGET>
               displays the requested information for the given <TARGET>.
               On non-cross compiling systems, the 'backend' target is ignored.
  --backend    equivalent to '--target backend' (deprecated)
  --cuda       specifies that the required flags are for the CUDA compiler
               nvcc (deprecated)
EOF
}

while [ $# -ge 1 ]; do
      case $1 in
         "--cflags")
	    echo "-I/home/trahay/Soft/opt/pallas/install/include"
	    ;;
	 "--cppflags")
	    echo "-I/home/trahay/Soft/opt/pallas/install/include"
	    ;;
	 "--libs")
	    echo "-lotf2"
	    ;;
	 "--ldflags")
	    echo "-L/home/trahay/Soft/opt/pallas/install/lib -Wl,-rpath -Wl,/home/trahay/Soft/opt/pallas/install/lib"
	    ;;
	 "--help")
	    usage
	    ;;
	 "--cc")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;
	 "--features")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;
	 "--version")
	    echo "otf2-config: version 3.0"
	    ;;
	 "--revision")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;
	 "--interface-version")
	    echo "10:0:0"
	    ;;
	 "--config-summary")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;
	 "--pythonpath")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;
	 "--target")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;
	 "--backend")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;
	 "--cuda")
	    echo "NOT IMPLEMENTED" >&2
	    exit 1
	    ;;

	 *)
	 usage
	 exit 1
	 ;;
      esac
      shift
done
