(re)added "-dev" suffix for the CMake hardcoded version number
[gromacs/rigid-bodies.git] / scripts / GMXRC.bash.in
blobe0b69b472df1de5a6d34aac207f4f69bf11922f8
1 # zsh configuration file for Gromacs
2 # First we remove old gromacs stuff from the paths
3 # by selecting everything else.
4 # This is not 100% necessary, but very useful when we
5 # repeatedly switch between gmx versions in a shell.
7 # First remove gromacs part of ld_library_path
8 tmppath=""
9 for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
10 if test "$i" != "$GMXLDLIB"; then
11 if test "${tmppath}" == ""; then
12 tmppath=$i
13 else
14 tmppath=${tmppath}:$i
17 done
18 LD_LIBRARY_PATH=$tmppath
20 # remove gromacs part of PKG_CONFIG_PATH
21 tmppath=""
22 for i in `echo $PKG_CONFIG_PATH | sed "s/:/ /g"`; do
23 if test "$i" != "$GMXLDLIB/pkgconfig"; then
24 tmppath=${tmppath}:$i
26 done
27 PKG_CONFIG_PATH=$tmppath
29 # remove gromacs part of path
30 tmppath=""
31 for i in `echo $PATH | sed "s/:/ /g"`; do
32 if test "$i" != "$GMXBIN"; then
33 tmppath=${tmppath}:$i
35 done
36 PATH=$tmppath
38 # and remove the gmx part of manpath
39 tmppath=""
40 for i in `echo $MANPATH | sed "s/:/ /g"`; do
41 if test "$i" != "$GMXMAN"; then
42 tmppath=${tmppath}:$i
44 done
45 if test "$tmppath" == ""; then
46 tmppath=":"
48 MANPATH=$tmppath
50 ##########################################################
51 # This is the real configuration part. We save the Gromacs
52 # things in separate vars, so we can remove them later.
53 # If you move gromacs, change the next four line.
54 ##########################################################
55 GMXBIN=@bindir@
56 GMXLDLIB=@libdir@
57 GMXMAN=@mandir@
58 GMXDATA=@datadir@
60 # NB: The variables already begin with ':' now, or are empty
61 LD_LIBRARY_PATH=${GMXLDLIB}${LD_LIBRARY_PATH}
62 PKG_CONFIG_PATH=${GMXLDLIB}/pkgconfig${PKG_CONFIG_PATH}
63 PATH=${GMXBIN}${PATH}
64 MANPATH=${GMXMAN}${MANPATH}
66 # export should be separate, so /bin/sh understands it
67 export GMXBIN GMXLDLIB GMXMAN GMXDATA LD_LIBRARY_PATH PATH MANPATH PKG_CONFIG_PATH
69 # read bash completions if understand how to use them
70 # and this shell supports extended globbing
71 if (complete) > /dev/null 2>&1; then
72 if (shopt -s extglob) > /dev/null 2>&1; then
73 if [ -f $GMXBIN/completion.bash ]; then
74 source $GMXBIN/completion.bash;