#!/bin/sh #try #1 at a configure script for EvtGen config.mk #Authors: David Lange and Anders Ryd #Date: October 5, 1998 echo "Welcome to configure for EvtGen" if test -r config.mk then echo "Deleting config.mk" rm -f config.mk fi os=`uname -a | awk '{ print $1}'` echo "This machine is running: $os" case $os in SunOS) echo "$os is supported." syslib="-t -lF77 -lsunmath -lM77 -lxnet -lcx -lc -lnsl";; OSF1) echo "$os is supported." syslib="-lcomplex -lfor";; Linux) echo "$os is supported." syslib="-lg2c -lnsl";; *) echo "$os is not supported, but feel free to try it!" ;; esac echo "Enter Name of c++ compiler (ie c++,cxx,CC, etc)" read compiler echo "Will use $compiler for compilation of C++ code" echo "Enter name of fortran compiler" read fcompiler echo "Will use $fcompiler for compilation of fortran code" echo "Enter name of linker (for example ${compiler} or ${fcompiler})" read linker echo "Will use $linker for linking the code to binaries" echo "The EvtGen package uses photos and pythia from cernlib: Please set CERN_ROOT if not already" echo "The EvtGen package uses root for histograming. Please set ROOTSYS if not already" echo "The EvtGen package relies on CLHEP. Please set CLHEP_BASE_DIR if not already" echo "Finding compiler includes" touch test.cc $compiler -v -c test.cc > temp.EvtGen 2>&1 sysinclist=" " tinclist=" " case $os in OSF1) compminusv=`cat < temp.EvtGen` rm temp.EvtGen for item in $compminusv do addtolist=`echo $item | awk /-I/` tinclist="$tinclist $addtolist" done;; SunOS) compminusv=`cat < temp.EvtGen` rm temp.EvtGen for item in $compminusv do addtolist=`echo $item | awk /-I/` tinclist="$tinclist $addtolist" done;; Linux) compminusv=`cat < temp.EvtGen | grep '/include'` rm temp.EvtGen for item in $compminusv do addtolist=`echo -I$item` tinclist="$tinclist $addtolist" done;; esac #Get rid of spaces in tinclist and put into sysinclist for #further use. for item in $tinclist do sysinclist="$sysinclist $item" done #for the cxx flags -I need to drop the CLHEP from $clhep inclist="$inclist -I\${CLHEP_BASE_DIR}/include -I\${ROOTSYS}/include -I../" echo "The $compiler compiler includes are" echo $sysinclist defoptions="-I. -DEVTSTANDALONE" #echo "The default $compiler options are " #echo $defoptions #echo "Enter any other options that you would like" #echo "to use in compilation. Examples -g -pg -o4 etc" # #read useroptions #defoptions="$defoptions $useroptions" echo "The following options will be used by default" echo $defoptions deflinkopt="-lRIO -lNet" #echo "The default link options are $deflinkopt" #echo "for the test program." #echo "Please enter any others that you would like to use" #echo "(such as '-lRIO -lSQL -lNet' with ROOT >= 5.16)" #read userlinkopt # #deflinkopt="$deflinkopt $userlinkopt" #autodetect pythia/photos/pdf lib names pylibs=`ls $CERN_ROOT/lib/libpythia*.a | awk '{print $1}' |tr '/' ' ' | awk '{print $NF}' | tr '.' ' ' | awk '{print substr($1,4,100)}'` phlibs=`ls $CERN_ROOT/lib/libphotos*.a | awk '{print $1}' |tr '/' ' ' | awk '{print $NF}' | tr '.' ' ' | awk '{print substr($1,4,100)}'` pdlibs=`ls $CERN_ROOT/lib/libpdf*.a | awk '{print $1}' |tr '/' ' ' | awk '{print $NF}' | tr '.' ' ' | awk '{print substr($1,4,100)}'` #Making config.mk echo "EVTCXX=$compiler" > config.mk echo "EVTF77=$fcompiler" >> config.mk echo "EVTLNKBIN=$linker" >> config.mk echo "EVTCXXFLAGS=$defoptions $inclist" >> config.mk echo "EVTDEPINC=$defoptions $inclist $sysinclist">> config.mk echo "EVTF77FLAGS=$inclist" >> config.mk echo "EVTLINK=-L. -L\${CERN_ROOT}/lib/ -L\${CLHEP_BASE_DIR}/lib -L\${ROOTSYS}/lib" >> config.mk echo "EVTLINKOPT=$deflinkopt" >> config.mk echo "EVTSYSLIB=$syslib" >> config.mk echo "EVTPYLIB=$pylibs" >> config.mk echo "EVTPHLIB=$phlibs" >> config.mk echo "EVTPDLIB=$pdlibs" >> config.mk echo "Done. Type make then make bin"