1 karl 1.1.2.2 #!/bin/sh
2 #set -x
3 #//%LICENSE////////////////////////////////////////////////////////////////
4 #//
5 #// Licensed to The Open Group (TOG) under one or more contributor license
6 #// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
7 #// this work for additional information regarding copyright ownership.
8 #// Each contributor licenses this file to you under the OpenPegasus Open
9 #// Source License; you may not use this file except in compliance with the
10 #// License.
11 #//
12 #// Permission is hereby granted, free of charge, to any person obtaining a
13 #// copy of this software and associated documentation files (the "Software"),
14 #// to deal in the Software without restriction, including without limitation
15 #// the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 #// and/or sell copies of the Software, and to permit persons to whom the
17 #// Software is furnished to do so, subject to the following conditions:
18 #//
19 #// The above copyright notice and this permission notice shall be included
20 #// in all copies or substantial portions of the Software.
21 #//
22 karl 1.1.2.2 #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 #// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 #// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 #// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26 #// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27 #// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28 #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #//
30 #//////////////////////////////////////////////////////////////////////////
31
32 ##==============================================================================
33 ##
34 ## Check for existence of pegasus config.mak. If this does not exist, it means
35 ## that the distribution is incomplete or that the configure file has been run
36 ## from the wrong directory.
37 ##
38 ##==============================================================================
39 tiny=0
40 prefix=""
41 test_option=0
42 disable_tests=0
43 karl 1.1.2.2 disable_tests=0
44 interop_name=""
45 enable_pertinst=0
46 dis_wsman=0
47 config=mak/config.mak
48
49 if [ ! -f "$config" ]; then
50 echo "$0: Error: ./configure must be run from root of Pegasus distribution."
51 echo
52 exit 1
53 fi
54
55 ##==============================================================================
56 ##
57 ## Collection command line options.
58 ##
59 ##==============================================================================
60
61 help=
62
63 for opt
64 karl 1.1.2.2 do
65
66 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
67
68 case $opt in
69
70 -h | --help)
71 help=1
72 ;;
73
74 --prefix=*)
75 prefix=$optarg
76 ;;
77
78 --test)
79 test_option=1
80 ;;
81
82 --tiny)
83 tiny=1
84 disable_trace=1
85 karl 1.1.2.2 disable_tests=1
86 interop_name=interop
87 enable_perinst=1
88 ;;
89
90 --flavor=*)
91 flavor=$optarg
92 ;;
93
94 --disable-wsman)
95 dis_wsman=1
96 ;;
97
98 *)
99 echo "$0: unknown option: $opt"
100 exit 1
101 ;;
102
103 esac
104 done
105
106 karl 1.1.2.2 ##==============================================================================
107 ##
108 ## Print help message if --help given on command line.
109 ##
110 ##==============================================================================
111
112 if [ "$help" = "1" ]; then
113 cat<<END
114
115 Usage: ./configure [OPTION]...
116
117 Configures OpenPegasus build options.
118
119 Configure examples.
120 $ ./configure
121 $ make
122
123 Options:
124 --help
125 Print this help message.
126 --prefix=DIR
127 karl 1.1.2.2 Install under DIR
128 --test
129 Build with test options included.
130 --tiny
131 Build tiny version of pegasus with support to SSL,SLP,ICU and PAM all disabled.
132 --flavor
133 Building pegasus with the given flavor tag.
134 END
135 fi
136
137
138
139 ##==============================================================================
140 ##
141 ## Guess the platform.
142 ##
143 ##==============================================================================
144 if [ "$help" != "1" ]; then
145 if [ -z "$platform" ]; then
146
147 machine=`(uname -m) 2>/dev/null` || machine=unknown
148 karl 1.1.2.2 system=`(uname -s) 2>/dev/null` || system=unknown
149 token="$machine:$system"
150
151 case "$token" in
152
153 i686:Linux)
154 platform=LINUX_IX86_GNU
155 libbase=lib
156 ;;
157
158 x86_64:Linux)
159 platform=LINUX_X86_64_GNU
160 libbase=lib64
161 ;;
162
163 sun*:SunOS)
164 platform=SOLARIS_SPARC_64_CC
165 libbase=lib/64
166 ;;
167
168 i86pc:SunOS)
169 karl 1.1.2.2 platform=SOLARIS_X86_64_CC
170 libbase=lib/64
171 ;;
172
173 ia64:HP-UX)
174 platform=HPUX_IA64_ACC
175 libbase=lib/64
176 ;;
177
178 9000/800:HP-UX)
179 platform=HPUX_PARISC_ACC
180 libbase=lib
181 ;;
182
183 ia64:Linux)
184 platform=LINUX_IA64_GNU
185 libbase=lib/64
186 ;;
187
188 ppc:Linux)
189 platform=LINUX_PPC_GNU
190 karl 1.1.2.2 libbase=lib
191 ;;
192
193 ppc64:Linux)
194 platform=LINUX_PPC64_GNU
195 libbase=lib/64
196 ;;
197
198 s390x:Linux)
199 platform=LINUX_ZSERIES64_GNU
200 libbase=lib/64
201 ;;
202
203 s390:Linux)
204 platform=LINUX_ZSERIES_GNU
205 libbase=lib/64
206 ;;
207
208
209 *)
210
211 karl 1.1.2.2 unresolved=1
212 ;;
213
214 esac
215
216 if [ "unresolved" = "1" ]; then
217 Machine=`(Uname -m) 2>/dev/null`||Machine=unknown
218 System=`(Uname -s) 2>/dev/null`||System=unknown
219 Token="$Machine:$System"
220
221
222 case "$Token" in
223
224 alpha:VMS)
225 platform=VMS_ALPHA_DECCXX
226 libbase=lib
227 ;;
228
229 IA64:OpenVMS)
230 platform=VMS_IA64_DECCXX
231 libbase=lib/64
232 karl 1.1.2.2 ;;
233
234 *)
235 echo "$0: Failed to guess platform"
236 echo " machine=$machine"
237 echo " system=$system"
238 exit 1
239 ;;
240
241 esac
242 fi
243 fi
244
245 ##==============================================================================
246 ##
247 ## Resolve default directory names.
248 ##
249 ##==============================================================================
250
251 # --prefix:
252
253 karl 1.1.2.2 if [ -z "$prefix" ]; then
254 prefix=`pwd`
255 fi
256
257 # --bindir:
258
259 if [ -z "$bindir" ]; then
260 bindir=$prefix/bin
261 fi
262
263 # --sbindir:
264
265 if [ -z "$sbindir" ]; then
266 sbindir=$prefix/sbin
267 fi
268
269 # --libdir:
270
271 if [ -z "$libdir" ]; then
272 libdir=$prefix/$libbase
273 fi
274 karl 1.1.2.2
275 # --includedir:
276
277 if [ -z "$includedir" ]; then
278 includedir=$prefix/include
279 fi
280
281 if [ -z "$with_pam" ]; then
282 with_pam=/etc/pam.d
283 fi
284
285 ##=============================================================================
286 ##
287 ##Check for Pre-Requsite
288 ##
289 ##============================================================================
290
291 path="$PATH"
292 IFS=":"
293 ccYes=0
294 missing=0
295 karl 1.1.2.2 cmdlist="cc:gcc:g++:make"
296 for cc in $cmdlist
297 do
298 echo "checking for $cc"
299 for i in $path
300 do
301 if test -f $i/$cc; then
302 ccYes=1
303 break
304 fi
305 done
306
307 if [ "$ccYes" = "1" ];
308 then
309 echo "$cc :yes"
310 else
311 echo "$cc :no"
312 missing=1
313 break
314 fi
315 done
316 karl 1.1.2.2
317 if [ "missing" = "1" ]; then
318 echo "$0: missing dependency $cc"
319 exit 1;
320 fi
321
322 ##==============================================================================
323 ##
324 ## Detect openssl.
325 ##
326 ##==============================================================================
327 enable_ssl=0
328 with_ssl=""
329 if [ "$tiny" != "1" ] ;then
330 sslcmd="openssl"
331 sslYes=0
332 echo "checking for $sslcmd"
333 for i in $path
334 do
335 if test -f $i/$sslcmd; then
336 sslYes=1
337 karl 1.1.2.2 withssl=$i
338 break
339 fi
340 done
341 if [ "$sslYes" = "1" ]; then
342 echo "ssl: Yes = $withssl/$sslcmd"
343 with_ssl=${withssl%/*}
344 else
345 echo "ssl: No"
346 fi
347
348 if [ ! -z "$with_ssl" ]; then
349
350 if [ ! -d "$with_ssl" ]; then
351 echo "$0: Error: No such directory: --with-ssl=$with_ssl"
352 exit 1;
353 fi
354
355 if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then
356 echo "$0: missing dependency: \$with_ssl/include/openssl/ssl.h"
357 missing=1
358 karl 1.1.2.2 fi
359
360 if [ ! -f "$with_ssl/$libbase/libssl.so" ]; then
361 echo "$0: missing dependency: \$with_ssl/$libbase/libss.so"
362 missing=1
363 fi
364
365 if [ "$missing" = "1" ]; then
366 echo "$0: where --with-ssl=$with_ssl"
367 unset with_ssl
368 else
369 enable_ssl=1
370 fi
371
372 fi
373 fi
374 ##==============================================================================
375 ##
376 ## Detect openslp.
377 ## Note that if openslp is not found it should use pegasus slp.
378 ##
379 karl 1.1.2.2 ##==============================================================================
380 enable_slp=0
381 with_openslp=""
382 enable_openslp=0
383 if [ "$tiny" != "1" ] ;then
384 slpcmd="slptool"
385 slpYes=0
386 echo "checking for openslp"
387 for i in $path
388 do
389 if test -f $i/$slpcmd; then
390 slpYes=1
391 withslp=$i
392 break
393 fi
394 done
395 if [ "$slpYes" = "1" ]; then
396 echo "slp: Yes = $withslp/$slpcmd"
397 with_openslp=${withslp%/*}
398 else
399 echo "slp: No"
400 karl 1.1.2.2 fi
401
402
403
404 if [ ! -z "$with_openslp" ]; then
405
406 if [ ! -d "$with_openslp" ]; then
407 echo "$0: Error: No such directory: --with-openslp=$with_openslp"
408 exit 1;
409 fi
410
411 if [ ! -f "$with_openslp/include/slp.h" ]; then
412 echo "$0: missing dependency: \$with_openslp/include/slp.h"
413 missing=1
414 fi
415
416 if [ ! -f "$with_openslp/$libbase/libslp.so" ]; then
417 echo "$0: missing dependency: \$with_openslp/$libbase/libslp.so"
418 missing=1
419 fi
420
421 karl 1.1.2.2 if [ "$missing" = "1" ]; then
422 echo "$0: where --with-openslp=$with_openslp"
423 enable_slp=1
424 else
425 enable_openslp=1
426 fi
427
428 fi
429 fi
430
431 ##==============================================================================
432 ##
433 ## Detect sqlite.
434 ##
435 ##==============================================================================
436 enable_sql=0
437
438 if [ "$tiny" != "1" ] ;then
439 sqlcmd="sqlite3"
440 sqlYes=0
441 echo "checking for sql"
442 karl 1.1.2.2 for i in $path
443 do
444 if test -f $i/$sqlcmd; then
445 sqlYes=1
446 withsql=$i
447 break
448 fi
449 done
450 if [ "$sqlYes" = "1" ]; then
451 echo "sql: Yes = $withsql/$sqlcmd"
452 with_sql=${withsql%/*}
453 else
454 echo "sql: No"
455 fi
456
457
458
459 if [ ! -z "$with_sql" ]; then
460
461 if [ ! -d "$with_sql" ]; then
462 echo "$0: Error: No such directory: $with_sql"
463 karl 1.1.2.2 exit 1;
464 fi
465
466 if [ ! -f "$with_sql/lib64/libsqlite3.so" ]; then
467 echo "$0: missing dependency: \$with_sql/lib64/libsqlite3.so"
468 missing=1
469 fi
470 if [ ! -f "$with_sql/include/sqlite3.h" ]; then
471 echo "$0:missing dependency :\$with_sql/include/sqlite3.h"
472 missing=1
473 fi
474 if [ "$missing" = "1" ]; then
475 echo "$0: sql not installed properly at $with_sql"
476 else
477 enable_sql=1
478 fi
479
480 fi
481 fi
482
483 ##==============================================================================
484 karl 1.1.2.2 ##
485 ## Detect net-snmp.
486 ##
487 ##==============================================================================
488
489 enable_snmp=0
490 if [ "$tiny" != "1" ]; then
491 snmpcmd="net-snmp-config"
492 snmpYes=0
493 echo "checking for net-snmp"
494 for i in $path
495 do
496 if test -f $i/$snmpcmd; then
497 snmpYes=1
498 withsnmp=$i
499 break
500 fi
501 done
502 if [ "$snmpYes" = "1" ]; then
503 echo "snmp: Yes = $withsnmp/$snmpcmd"
504 with_snmp=${withsnmp%/*}
505 karl 1.1.2.2 else
506 echo "snmp: No"
507 fi
508
509
510
511 if [ ! -z "$with_snmp" ]; then
512
513 if [ ! -d "$with_snmp" ]; then
514 echo "$0: Error: No such directory: $with_snmp"
515 exit 1;
516 fi
517
518 if [ ! -f "$with_snmp/lib64/libnetsnmp.so" ]; then
519 echo "$0: missing dependency: "
520 missing=1
521 fi
522
523 if [ "$missing" = "1" ]; then
524 echo "$0: snmp not installed properly at $with_snmp"
525 else
526 karl 1.1.2.2 enable_snmp=1
527 fi
528
529 fi
530 fi
531
532 ##=============================================================================
533 ##
534 ##Detect icu ( Currently supported till 3.6)
535 ##
536 ##=============================================================================
537 supporticu=0
538 if [ "$tiny" != "1" ] ;then
539 icucmd="icu-config"
540 gencmd="genrb"
541 icuYes=0
542 echo "checking for icu"
543 for i in $path
544 do
545 if test -f $i/$icucmd ;then
546 if test -f $i/$gencmd ; then
547 karl 1.1.2.2 icuYes=1
548 withicu=$i
549 break
550 fi
551 fi
552 done
553 if [ "$icuYes" = "1" ]; then
554 echo "icu: Yes = $withicu/$icucmd"
555 with_icu=${withicu%/*}
556 else
557 echo "icu: No"
558 fi
559
|