#!/usr/bin/sh

prefix="/usr/lib64/openmpi"
exec_prefix=${prefix}

usage()
{
    cat <<EOF
Usage: nest-config [OPTION]

Known values for OPTION are:

  --prefix              NEST install prefix for architecture-independent files
  --exec-prefix         NEST install prefix for architecture-dependent files
  --libs                print library linking information for extension modules
  --cflags              print pre-processor and compiler flags
  --includes            print includes
  --compiler            print the compiler used to compile NEST
  --compiler-name       Print the compiler name used to compile NEST
  --compiler-version    Print the compiler version used to compile NEST
  --python-executable   print full path to Python interpreter used
  --python-version      print Python version string for interpreter
  --static-libraries    print "ON" if configured for static libraries, "OFF" otherwise
  --docdir              print the relative path (to prefix) to the installed documentation
  --datadir             print the relative path (to prefix) to the installed data
  --libdir              print the relative path (to prefix) to the installed libraries
  --help                display this help and exit
  --version             output version information

EOF

    exit $1
}

if test $# -eq 0; then
    usage 1
fi

cflags=false
libs=false

while test $# -gt 0; do
    case "$1" in
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) optarg= ;;
    esac

    case "$1" in
    --prefix=*)
        prefix=$optarg
        ;;
    --prefix)
        echo $prefix
        ;;
    --exec-prefix)
        echo $exec_prefix
        ;;
    --version)
        echo "3.8"
        ;;
    --help)
        usage 0
        ;;
    --includes)
        echo " -I/usr/include/openmpi-x86_64/nest -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include "
        ;;
    --cflags)
        echo "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -std=c++17 -Wall -fopenmp  -fdiagnostics-color=auto"
        ;;
    --libs)
        echo "-L/usr/lib64/openmpi/lib/nest -lnest -lsli /lib64/libltdl.so /lib64/libreadline.so /lib64/libncurses.so /usr/lib64/libgsl.so /usr/lib64/libgslcblas.so /usr/lib64/openmpi/lib/libneurosim.so /usr/lib64/openmpi/lib/libpy3neurosim.so   /usr/lib/gcc/x86_64-redhat-linux/16/libgomp.so /usr/lib64/libpthread.a  "
        ;;
    --compiler)
        echo "/usr/lib64/openmpi/bin/mpicxx"
        ;;
    --compiler-name)
        echo "GNU"
        ;;
    --compiler-version)
        echo "16.0.1"
        ;;
    --python-executable)
        echo "/usr/bin/python3.14"
        ;;
    --python-version)
        echo "3.14.2"
        ;;

    --static-libraries)
        echo "OFF"
        ;;
    --docdir)
        echo "share/doc/nest"
        ;;
    --datadir)
        echo "share/nest"
        ;;
    --libdir)
        echo "/usr/lib64/openmpi/lib"
        ;;
    *)
        usage
        exit 1
        ;;
    esac
    shift
done

exit 0
