#!/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="gfortran" COMPVER="9" FFLAGS="-g -cpp -O3 -fd-lines-as-comments -Wall -Waggregate-return -Wcast-align -Wline-truncation -Wno-conversion -Wno-integer-division -Wno-tabs -Wno-unused-dummy-argument -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wsystem-headers -Wuninitialized -Wunused-label -mtune=generic -msse2 -mfpmath=sse -fPIC -fexpensive-optimizations -funroll-loops -fstrength-reduce -fno-automatic -finit-local-zero -ffixed-line-length-132 -fbackslash -funderscoring -frecord-marker=4 -falign-commons -fbacktrace -frange-check -fbounds-check -fdump-core -ftrapping-math -ffpe-trap=invalid,zero,overflow " CFLAGS="-g -O3 -Wpadded -Wpacked -malign-double -mpreferred-stack-boundary=8" LFLAGS="" LIB="-lfluka" DPMLIB="-ldpmjet -lphojet -ldpmjet -lpythia -lrqmd" if [ "$1" = "" ]; then echo echo "syntax: fluka-config --path|--bin|--compiler|--compver|--include|--libpath|--lib|--dpmlib|--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" ;; --lib) echo ${LIB} ;; --dpmlib) OBJS=$(ls ${DIR}/lib/interface/*.o) echo ${OBJS} ${DPMLIB} ;; --flags|--fflags) echo ${FFLAGS} ;; --cflags) echo ${CFLAGS} ;; --lflags) echo ${LFLAGS} ;; --data) echo "${DIR}/data" ;; esac done