/[PAMELA software]/PamelaLevel2/doc/cernlib_pam
ViewVC logotype

Annotation of /PamelaLevel2/doc/cernlib_pam

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Fri Dec 5 08:34:02 2008 UTC (16 years ago) by pam-fi
Branch: MAIN
Changes since 1.3: +4 -0 lines
*** empty log message ***

1 pam-fi 1.1 #!/bin/sh
2     # **********************************************************************
3     # * @(#) cernlib
4 pam-fi 1.4 <<<<<<< cernlib_pam
5 pam-fi 1.3 # * @(#) $Header: /afs/ba.infn.it/user/pamela/src/CVS/PamelaLevel2/doc/cernlib_pam,v 1.2 2007/01/24 09:07:49 mocchiut Exp $
6 pam-fi 1.4 =======
7     # * @(#) $Header: /afs/ba.infn.it/user/pamela/src/CVS/PamelaLevel2/doc/cernlib_pam,v 1.3 2008-12-04 15:34:25 pam-fi Exp $
8     >>>>>>> 1.3
9 pam-fi 1.1 # * *
10     # * Attachment of CERN Libraries for link step *
11     # * *
12     # * Author: M.Marquina 91/05/10 *
13     # * Change history is in CVS log files and in source 1.27 ( and older)
14     # **********************************************************************
15    
16     SHOPT="G:Psuv:"
17     #SEQ,GETOPTD.
18    
19     [ -z "$CERN" ] && CERN="/cern"
20     [ -z "$CERN_LEVEL" ] && gver="pro" || gver="$CERN_LEVEL"
21    
22     _P=0 ; _p=0 ; _u=0 ; Gsys=""
23     while [ $# -gt 0 ]
24     do case $1 in
25     -G) Gsys=$2 ; shift ;;
26     -P) _P=1 ;;
27     -s) _s="is an obsolete option" ;;
28     -u) _u=1 ; _p=1 ;;
29     -v) gver=$2 ; shift ;;
30     --) shift ; break ;;
31     *) break ;;
32     esac
33     shift
34     done
35    
36    
37    
38     CERNLIB=""
39    
40     liblist=`echo $* | sed -e 's/,/ /g'`
41     for lib in $liblist
42     do
43     case $lib in
44     shift) continue ;;
45     -*) CERNLIB="$CERNLIB $lib" ; continue ;;
46     esac
47     lver=$gver
48     val=`echo $lib | sed -e "s?\/? ?g"`
49     set - $val
50     [ $# -eq 2 -a $1 != "graflib" ] && lver=$2
51     dir=$CERN/$lver/lib
52     ln=$1
53     if [ $1 = "kernlib" -o $1 = "packlib" ] ; then
54     _p=1
55     fi
56     [ $1 = "genlib" ] && ln="mathlib.a $dir/libphtools"
57     [ $1 = "bvsl" ] && ln="mathlib"
58     [ $1 = "mpalib" ] && ln="mathlib"
59     [ $1 = "lapack" ] && ln="lapack3.a $dir/libblas"
60     [ $1 = "pawlib" ] && ln="pawlib.a $dir/liblapack3.a $dir/libblas"
61     [ $1 = "pythia" ] && ln="jetset"
62     if [ $1 = "GKS" -o $1 = "gks" ] ; then
63     drv="X11" ; glib="$1" ; dir="$CERN/gks/$lver/lib"
64     fi
65     [ $1 = "naglib" ] && dir="$CERN/nag/$lver/lib"
66     if [ $1 = "graflib" ] ; then
67     [ -z "$Gsys" ] && Gsys="X11"
68     drv="$Gsys"
69     if [ $# -gt 1 ] ; then
70     drv="$2" ; Gsys="$2"
71     fi
72     [ $# -eq 3 ] && dir="$CERN/$3/lib"
73     [ $drv = "Motif" ] && drv="X11"
74     ln="$ln.a $dir/libgraf$drv"
75     fi
76     CERNLIB="$CERNLIB $dir/lib$ln.a"
77     done
78     if [ -f $CERN/$gver/lib/libpacklib_noshift.a ]; then
79     [ $_p -eq 0 ] && CERNLIB="$CERNLIB $CERN/$gver/lib/libpacklib_noshift.a"
80     else
81     [ $_p -eq 0 ] && CERNLIB="$CERNLIB $CERN/$gver/lib/libpacklib.a"
82     fi;
83    
84     # get system name
85     [ -d /NextAdmin ] && Msys="NeXT" || Msys=`uname -s`
86     case $Msys in
87     SunOS) [ `uname -r | awk '{ print substr($1,1,1) }'` -ge 5 ] \
88     && Msys="SunSol"
89     ;;
90     *) ;;
91     esac
92    
93    
94     if [ -n "$Gsys" ] ; then
95     case $Msys in
96     AIX) SYSGGL="-lfgl -lgl" ;
97     [ -f /usr/lib/libgP.a ] && \
98     SYSGGKS="-lgksco -lgP -lX11" ;
99     SYSGMOTIF="-lXm -lXt -lX11 -lPW" ;;
100     ALLIANT) SYSGX11="-lX11 -lcurses -lm" ;;
101     HP-UX) if [ -d /usr/lib/X11R5 -a -d /usr/lib/Motif1.2 ] ; then
102     X11="/usr/lib/X11R5"
103     Motif="/usr/lib/Motif1.2"
104     SYSGMOTIF="-L$Motif -lXm -L$X11 -lXt -lX11 -lm -lc -lPW"
105     else
106     X11="/usr/lib/X11R4"
107     Motif="/usr/lib/Motif1.1"
108     # Xm must appear late, else you get unresolved extrernals
109     SYSGMOTIF="-L$Motif -L$X11 -lXm -lXt -lX11 -lm -lc -lPW"
110     fi
111     SYSGX11="-L$X11 -lX11 -lm";;
112     IBMAIX) SYSGX11="-lX11 -lm" ;;
113     IRIX) SYSGX11="-lX11 -lbsd" ;
114     SYSGGL="-lfgl -lgl_s -lm -lbsd" ;
115     SYSGMOTIF="-lXm -lXt -lX11 -lPW"
116     ;;
117     IRIX64) SYSGX11="-lX11 -lbsd" ;
118     SYSGGL="-lfgl -lgl_s -lm -lbsd" ;
119     SYSGMOTIF="-lXm -lXt -lX11 -lPW"
120     ;;
121     Linux) [ -d /usr/X386/lib ] && SYSGX11="-L/usr/X386/lib -lX11"
122     [ -d /usr/X11/lib ] && SYSGX11="-L/usr/X11/lib -lX11"
123     [ -d /usr/X11R6/lib ] && SYSGX11="-L/usr/X11R6/lib -lX11"
124     [ -d /usr/X11R6/lib ] && SYSGMOTIF="-L/usr/X11R6/lib -lXm -lXt -lXp -lXext -lX11"
125     [ `uname -m` = ppc ] && SYSGMOTIF="$SYSGMOTIF -lSM -lICE -lXpm"
126     ;;
127     NeXT) SYSGX11="/usr/lib/X11/libX11.r" ;
128     SYSGMOTIF="-lXm -lXt /usr/lib/X11/libX11.r" ;;
129     OSF1) SYSGX11="-lX11 -ldnet_stub" ;
130     SYSGMOTIF="-lXm -lXt -lX11 -ldnet_stub -lPW -lXmu" ;;
131     SunOS) [ -d /usr/motif/lib ] && Motif="-L/usr/motif/lib" || Motif=" "
132     if [ -d /usr/motif12/usr/lib ] ; then
133     Motif="-L/usr/motif12/usr/lib"
134     # motif12 needs X11R5 from usr/local/lib
135     X11="-L/usr/local/lib"
136     else
137     X11=""
138     fi
139     SYSGMOTIF="$Motif -lXm $X11 -lXt -lX11"
140     [ -f /usr/lib/libgks77.a ] && \
141     SYSGGKS="-lgks77 -lgks -lsuntool -lsunwindow -lpixrect -lm" ;;
142     SunSol) [ -d /usr/motif/lib ] && Motif="-L/usr/motif/lib" || Motif=" "
143     [ -d /usr/motif12/usr/lib ] && Motif="-L/usr/motif12/usr/lib"
144     [ -d /usr/dt/lib ] && \
145     Motif="-L/usr/dt/lib -R/usr/dt/lib -Bdynamic"
146     [ -d /usr/openwin/lib ] && X11="-L/usr/openwin/lib" || X11=""
147     SYSGX11="$X11 -Bdynamic -lX11"
148     SYSGMOTIF="$Motif -lXm $X11 -Bdynamic -lXt -lX11"
149     [ -f /usr/lib/libgks77.a ] && \
150     SYSGGKS="-lgks77 -lgks -lsuntool -lsunwindow -lpixrect -lm"
151     ;;
152     ULTRIX) [ -f /usr/lib/libGKS3D.a ] && \
153     SYSGGKS="-lGKS3Dforbnd -lGKS3D -lddif -ldwt -lc -lX11 -lcursesX -lm" ;;
154     DomainOS) SYSGX11="" ;
155     SYSGMOTIF="-L/usr/lib/X11 -lXm -lXt -lX11 -lm" ;;
156     esac
157    
158     [ -z "$SYSGX11" ] && SYSGX11="-lX11"
159     case $Gsys in
160     X11) CERNLIB="$CERNLIB $SYSGX11" ;;
161     Motif) [ -z "$SYSGMOTIF" ] && SYSGMOTIF="-lXm -lXt $SYSGX11" ;
162     CERNLIB="$CERNLIB $SYSGMOTIF" ;;
163     GPHIGS) [ -z "$SYSGPHIGS" ] && \
164     SYSGPHIGS="-L$CERN/phigs/$gver/lib -lgphigsf2c -lgphigsc" ;
165     CERNLIB="$CERNLIB $SYSGPHIGS" ;;
166     GKS) [ -z "$SYSGGKS" ] && \
167     SYSGGKS="-L$CERN/gks/$gver/lib -lGKS -lGKSdriv $SYSGX11" ;
168     CERNLIB="$CERNLIB $SYSGGKS" ;;
169     GL) CERNLIB="$CERNLIB $SYSGGL" ;;
170     GPR) CERNLIB="$CERNLIB $SYSGGPR" ;;
171     --) break ;;
172     *) break ;;
173     esac
174     fi
175    
176     if [ $_u -eq 0 ] ; then
177     # SGI needs -lsun, to see yellow pages
178     # As of 5.x, the yp version is in libc, so -lsun is no longer needed.
179     # GF. 18-7-96
180     # [ -f /usr/lib/libsun.a -o -f /usr/lib/libsun.so ] \
181     # && CERNLIB="$CERNLIB -lsun"
182     [ -f /usr/lib/libulsock.a -o -f /usr/lib/libulsock.so ] \
183     && CERNLIB="$CERNLIB -lulsock"
184     # Solaris, many things won't link without -lsocket -lnsl
185     if [ "$Msys" = "SunSol" ] ; then
186     [ -f /usr/lib/libw.so -o -f /usr/lib/libw.a ] \
187     && CERNLIB="$CERNLIB -lw"
188     [ -f /usr/ccs/lib/libgen.so -o -f /usr/ccs/lib/libgen.a ] \
189     && CERNLIB="$CERNLIB -lgen"
190     [ -f /usr/lib/libsocket.so -o -f /usr/lib/libsocket.a ] \
191     && CERNLIB="$CERNLIB -lsocket"
192     [ -f /usr/lib/libnsl.so -o -f /usr/lib/libnsl.a ] \
193     && CERNLIB="$CERNLIB -lnsl"
194     [ -f /usr/lib/libintl.so -o -f /usr/lib/libintl.a ] \
195     && CERNLIB="$CERNLIB -lintl"
196     echo $CERNLIB | grep pawlib >/dev/null && \
197     CERNLIB="$CERNLIB -ldl"
198    
199     fi
200     if [ "$Msys" = "HP-UX" ] ; then
201     if [ -f /usr/lib/libU77.a -o -f /usr/lib/libU77.sl ] ; then
202     CERNLIB="$CERNLIB -lU77"
203     elif [ -f /opt/fortran/lib/libU77.a ] ; then
204     CERNLIB="$CERNLIB /opt/fortran/lib/libU77.a"
205     elif [ -f /opt/fortran/lib/libU77.sl ] ; then
206     CERNLIB="$CERNLIB /opt/fortran/lib/libU77.sl"
207     fi
208    
209     echo $CERNLIB | grep pawlib >/dev/null && \
210     CERNLIB="$CERNLIB /usr/lib/libdld.sl"
211     echo $CERNLIB | grep packlib >/dev/null && \
212     [ -f /lib/pa1.1/libm.a ] && CERNLIB="$CERNLIB /lib/pa1.1/libm.a"
213     fi
214     if [ "$Msys" = "AIX" ] ; then
215     echo $CERNLIB | grep pawlib >/dev/null && CERNLIB="$CERNLIB -lld"
216     fi
217     if [ "$Msys" = "Linux" ] ; then
218 mocchiut 1.2 if [ -f $CERN/$gver/lib/libpacklib_noshift.a ]||[ -f $CERN/$gver/lib/libpacklib-shift.a ]; then
219 pam-fi 1.1 CERNLIB="$CERNLIB -lnsl -lcrypt -ldl"
220     else
221     CERNLIB="$CERNLIB -lshift -lnsl -lcrypt -ldl"
222     fi;
223     fi
224     fi
225    
226    
227     echo $CERNLIB ; export CERNLIB

  ViewVC Help
Powered by ViewVC 1.1.23