/[PAMELA software]/DarthVader/docs/cernlib_pam
ViewVC logotype

Contents of /DarthVader/docs/cernlib_pam

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Nov 8 12:11:54 2006 UTC (18 years ago) by mocchiut
Branch: MAIN
libshift bug fixed

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

  ViewVC Help
Powered by ViewVC 1.1.23