#!/bin/sh # mac doesn't have readlink with -f option to canonicalize the path canonicalDirname() { cd $(dirname "$1") echo $(pwd -P) } DIR=$(dirname "${0}") if [ "${DIR}" = . ]; then DIR=$(pwd -P) fi DIR=$(canonicalDirname "${DIR}") #DIR=$(readlink -f "${DIR}/..") # Variables to be modified from the makefile during compilation COMPILER="" COMPVER="" FFLAGS="" CFLAGS="" LFLAGS="" LIB="" DPMLIB="" RQMDLIB="" INTOBJS="" if [ "$1" = "" ]; then echo echo "syntax: fluka-config --path|--bin|--compiler|--compver|--include|--libpath|--intobjs|--lib|--dpmlib|--rqmdlib|--flags|--fflags|--cflags|--lflags|--data" echo echo "desc: echo on standard output the relative option to be used in a make file" echo echo "author: Vasilis.Vlachoudis@cern.ch" echo "date: 2019.06.01" exit 0 fi for ARG in $* do case $ARG in --path) echo "${DIR}" ;; --bin) echo "${DIR}/bin" ;; --compiler) echo ${COMPILER} ;; --compver) echo ${COMPVER} ;; --include) echo "-I${DIR}/include" ;; --libpath) echo "-L${DIR}/lib" ;; --intobjs) echo $INTOBJS | tr ' ' '\n' | sed -e "s|^|${DIR}/lib/interface/|" | tr '\n' ' ' ;; --lib) echo ${LIB} ;; --dpmlib) echo ${DPMLIB} ;; --rqmdlib) echo ${RQMDLIB} ;; --flags|--fflags) echo ${FFLAGS} ;; --cflags) echo ${CFLAGS} ;; --lflags) echo ${LFLAGS} ;; --data) echo "${DIR}/data" ;; esac done