1 mike 1.2 #!/bin/sh
2
3 #//%2006///////////////////////////////////////////////////////////////////////
4 #//
5 #// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
6 #// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
7 #// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
8 #// IBM Corp.; EMC Corporation, The Open Group.
9 #// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
10 #// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
11 #// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 #// EMC Corporation; VERITAS Software Corporation; The Open Group.
13 #// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
14 #// EMC Corporation; Symantec Corporation; The Open Group.
15 #//
16 #// Permission is hereby granted, free of charge, to any person obtaining a copy
17 #// of this software and associated documentation files (the "Software"), to
18 #// deal in the Software without restriction, including without limitation the
19 #// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
20 #// sell copies of the Software, and to permit persons to whom the Software is
21 #// furnished to do so, subject to the following conditions:
22 mike 1.2 #//
23 #// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
24 #// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
25 #// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
26 #// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
27 #// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
28 #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 #// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 #// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 #//
32 #//=============================================================================
|
33 mike 1.1
34 ##==============================================================================
35 ##
|
36 mike 1.2 ## Check for existence of pegasus config.mak. If this does not exist, it means
37 ## that the distribution is incomplete or that the configure file has been run
38 ## from the wrong directory.
|
39 mike 1.1 ##
40 ##==============================================================================
41
|
42 mike 1.2 config=mak/config.mak
43
44 if [ ! -f "$config" ]; then
|
45 mike 1.4 echo "$0: Error: ./configure must be run from root of Pegasus distribution."
|
46 mike 1.2 echo
|
47 mike 1.1 exit 1
48 fi
49
50 ##==============================================================================
51 ##
|
52 mike 1.2 ## Collection command line options.
|
53 mike 1.1 ##
54 ##==============================================================================
55
|
56 mike 1.2 help=
|
57 mike 1.1
58 for opt
59 do
60
61 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
62
63 case $opt in
64
|
65 mike 1.2 -h | --help)
|
66 mike 1.1 help=1
67 ;;
68
|
69 mike 1.2 --host=*)
70 host=$optarg
|
71 mike 1.1 ;;
72
73 --prefix=*)
|
74 mike 1.2 prefix=$optarg
|
75 mike 1.1 ;;
76
77 --bindir=*)
78 bindir=$optarg
79 ;;
80
81 --sbindir=*)
82 sbindir=$optarg
83 ;;
84
|
85 mike 1.2 -libdir=*)
|
86 mike 1.1 libdir=$optarg
87 ;;
88
89 --includedir=*)
|
90 mike 1.2 incdir=$optarg
|
91 mike 1.1 ;;
92
93 --datadir=*)
94 datadir=$optarg
95 ;;
96
97 --enable-debug)
98 enable_debug=1
99 ;;
100
|
101 mike 1.2 --disable-oop)
102 disable_oop=1
103 ;;
104
|
105 mike 1.5 --enable-pam)
106 enable_pam=1
|
107 mike 1.2 ;;
108
109 --with-pam=*)
110 with_pam=$optarg
111 ;;
112
113 --with-pam-mod=*)
114 with_pam_mod=$optarg
|
115 mike 1.1 ;;
116
|
117 mike 1.2 --enable-ssl)
118 enable_ssl=1
|
119 mike 1.1 ;;
120
|
121 mike 1.5 --enable-slp)
122 enable_slp=1
123 ;;
124
125 --enable-openslp)
126 enable_openslp=1
127 ;;
128
129 --with-openslp=*)
130 with_openslp=$optarg
131 ;;
132
133 --disable-cmpi)
134 disable_cmpi=1
135 ;;
136
|
137 mike 1.2 --with-ssl=*)
138 with_ssl=$optarg
|
139 mike 1.1 ;;
140
|
141 mike 1.2 --enable-binary-repository)
142 enable_binary_repository=1
|
143 mike 1.1 ;;
144
|
145 mike 1.2 --enable-compressed-repository)
146 enable_compressed_repository=1
|
147 mike 1.1 ;;
148
149 *)
150 echo "$0: unknown option: $opt"
151 exit 1
152 ;;
153
154 esac
155 done
156
157 ##==============================================================================
158 ##
|
159 mike 1.2 ## Print help message if --help given on command line.
|
160 mike 1.1 ##
161 ##==============================================================================
162
163 if [ "$help" = "1" ]; then
|
164 mike 1.2 cat<<END
165
166 Usage: ./configure [OPTION]...
167
168 Configures Inova OpenPegasus build options.
169
170 Configure examples.
171 $ ./configure
172
173 Options:
174 --help
175 Print this help message.
176 --host=HOST
177 Build package for this HOST, where HOST is of the form
178 "<cpu>-<manufacturer>-<os>-<kernel>".
179 --prefix=DIR
180 Install under DIR
181 --bindir=DIR
182 Install programs here.
183 --sbindir=DIR
184 Install super-user programs here.
185 mike 1.2 --libdir=DIR
186 Install libraries here.
187 --incluedir=DIR
188 Install include files here.
189 --datadir=DIR
190 Install data files here.
191 --enable-debug
192 Build for debug.
193 --disable-oop
194 Disable out-of-process providers.
|
195 mike 1.5 --enable-pam
196 Enable PAM authentication (fall back on password-file authentication).
|
197 mike 1.2 --with-pam=DIR
198 Specify an alternative PAM directory location (defaults to /etc/pam.d).
199 --with-pam-mod=FILE
200 Specify an alternative name for the PAM module file (defaults to
201 inova-pegasus).
202 --enable-ssl
203 Enable SSL feature
|
204 mike 1.5 --enable-slp
205 Enable SLP feature
206 --enable-openslp
207 Enable OpenSLP feature
208 --with-openslp=DIR
209 Find OpenSLP installation under DIR (e.g., --with-openslp=/usr).
210 --disable-cmpi
211 Disable CMPI provider support
|
212 mike 1.2 --with-ssl=DIR
213 Find SSL under DIR (e.g., --with-ssl=/usr).
214 --enable-binary-repository
215 Enable the binary repository feature, resulting in a smaller CIM
216 repository disk footprint.
217 END
218 exit
|
219 mike 1.1 fi
220
221 ##==============================================================================
222 ##
|
223 mike 1.5 ## Guess the platform.
|
224 mike 1.1 ##
225 ##==============================================================================
226
|
227 mike 1.2 if [ -z "$host" ]; then
228
229 machine=`(uname -m) 2>/dev/null` || machine=unknown
230 system=`(uname -s) 2>/dev/null` || system=unknown
231 release=`(uname -r) 2>/dev/null` || release=unknown
232 version=`(uname -v) 2>/dev/null` || version=unknown
233 token="$machine:$system:$release:$version"
234
235 case "$token" in
236
237 i686:Linux:*:*)
238 host=i686-unknown-linux-gnu
239 ;;
240
241 x86_64:Linux:*:*)
242 host=x86_64-unknown-linux-gnu
243 ;;
|
244 mike 1.1
|
245 mike 1.2 ia64:Linux:*:*)
246 host=ia64-unknown-linux-gnu
247 ;;
|
248 mike 1.1
|
249 mike 1.2 s390:Linux:*:*)
250 host=s390-unknown-linux-gnu
251 ;;
|
252 mike 1.1
|
253 mike 1.2 s390x:Linux:*:*)
254 host=s390x-unknown-linux-gnu
255 ;;
|
256 mike 1.1
|
257 mike 1.2 ppc64:Linux:*:*)
258 host=ppc64-unknown-linux-gnu
259 ;;
|
260 mike 1.1
|
261 mike 1.2 ppc:Linux:*:*)
262 host=ppc-unknown-linux-gnu
263 ;;
|
264 mike 1.1
|
265 mike 1.5 sun*:SunOS:*:*)
266 host=sparc-sun-solaris
267 ;;
268
|
269 mike 1.2 *)
270 echo "$0: Failed to guess host"
271 echo " machine=$machine"
272 echo " system=$system"
273 echo " release=$release"
274 echo " version=$version"
275 exit 1
276 ;;
277
278 esac
|
279 mike 1.1 fi
280
281 ##==============================================================================
282 ##
|
283 mike 1.2 ## Set the platform library basename ("lib" or "lib64" depending on vendor
284 ## convention and architecture).
|
285 mike 1.1 ##
286 ##==============================================================================
287
|
288 mike 1.2 case "$host" in
289
290 i686-unknown-linux-gnu)
291 platform=LINUX_IX86_GNU
292 libbase=lib
293 ;;
294
295 x86_64-unknown-linux-gnu)
296 platform=LINUX_X86_64_GNU
297 libbase=lib64
298 ;;
299
300 ia64-unknown-linux-gnu)
301 platform=LINUX_IA64_GNU
302 libbase=lib
303 ;;
304
305 ppc-unknown-linux-gnu)
306 platform=LINUX_PPC_GNU
307 libbase=lib
308 ;;
|
309 mike 1.1
|
310 mike 1.2 ppc64-unknown-linux-gnu)
311 platform=LINUX_PPC64_GNU
312 libbase=lib64
|
313 mike 1.1 ;;
314
|
315 mike 1.2 arm-wrs-vxworks-gnu)
316 platform=VXWORKS_XSCALE_GNU
317 libbase=lib
318 enable_static=1
|
319 mike 1.1 ;;
320
|
321 mike 1.5 sparc-sun-solaris)
322 platform=SOLARIS_SPARC_64_CC
323 libbase=lib/64
324 ;;
325
|
326 mike 1.1 *)
|
327 mike 1.2 echo "$0: unknown host: $host"
|
328 mike 1.1 exit 1
329 ;;
330
331 esac
332
333 ##==============================================================================
334 ##
|
335 mike 1.2 ## Resolve default directory names.
|
336 mike 1.1 ##
337 ##==============================================================================
338
|
339 mike 1.2 # --prefix:
340
341 if [ -z "$prefix" ]; then
342 prefix=/usr/local
343 fi
344
345 # --bindir:
346
|
347 mike 1.1 if [ -z "$bindir" ]; then
348 bindir=$prefix/bin
349 fi
350
|
351 mike 1.2 # --sbindir:
352
|
353 mike 1.1 if [ -z "$sbindir" ]; then
354 sbindir=$prefix/sbin
355 fi
356
|
357 mike 1.2 # --libdir:
358
|
359 mike 1.1 if [ -z "$libdir" ]; then
|
360 mike 1.2 libdir=$prefix/$libbase
|
361 mike 1.1 fi
362
|
363 mike 1.2 # --includedir:
364
|
365 mike 1.1 if [ -z "$includedir" ]; then
366 includedir=$prefix/include
367 fi
368
|
369 mike 1.2 # --datadir:
370
|
371 mike 1.1 if [ -z "$datadir" ]; then
372 datadir=$prefix/share
373 fi
374
|
375 mike 1.2 if [ -z "$with_ssl" ]; then
376 with_ssl=/usr
377 fi
378
379 if [ -z "$with_pam" ]; then
380 with_pam=/etc/pam.d
381 fi
382
383 if [ -z "$with_pam_mod" ]; then
384 with_pam_mod=wsman
385 fi
386
|
387 mike 1.1 ##==============================================================================
388 ##
|
389 mike 1.2 ## Verify existence of SSL files and directories.
|
390 mike 1.1 ##
391 ##==============================================================================
392
|
393 mike 1.2 if [ "$enable_ssl" = "1" ]; then
|
394 mike 1.1
|
395 mike 1.2 # Verify that SSL base directory exists (e.g., /usr).
|
396 mike 1.1
|
397 mike 1.2 if [ ! -d "$with_ssl" ]; then
398 echo "$0: Error: No such directory: --with-ssl=$with_ssl"
399 echo
400 exit 1;
401 fi
402
403 # Verify that "ssl.h" exists.
404
405 missing=
406
407 if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then
408 missing=include/openssl/ssl.h
409 fi
410
411 # Verify that "openssl" program exists.
412
413 if [ ! -f "$with_ssl/bin/openssl" ]; then
414 missing=bin/openssl
415 fi
416
417 # Verify that "libssl.a" or "libssl.so" exist.
418 mike 1.2
419 if [ ! -f "$with_ssl/$libbase/libssl.a" -a ! -f "$with_ssl/$libbase/libssl.so" ]; then
420 missing="$libbase/libssl.so"
421 fi
422
423 # Print error if any of the above components are missing.
424
425 if [ ! -z $missing ]; then
426 echo -n "$0: Error: SSL component not found: $with_ssl/$missing. "
427 echo -n "Specify location of SSL with the --with-ssl=DIR option."
428 echo
429 exit 1;
430 fi
431
432 fi
433
434 ##==============================================================================
435 ##
436 ## These options (if non-empty) must denote absolute directory names.
437 ##
438 ##==============================================================================
439 mike 1.2
440 for i in \
441 prefix \
442 bindir \
443 sbindir \
444 libdir \
445 includedir \
446 datadir \
447 with_ssl \
448 with_pam
449 do
450
451 eval v=$`echo $i`
452
453 case $v in
454 /* | "")
455 ;;
456
457 *)
458 echo "$0: Error: Must be an absolute directory name: --$i=$v"
459 exit 1;
460 mike 1.2 ;;
461 esac
462
463 done
464
465 ##==============================================================================
466 ##
467 ## Create options.mak
468 ##
469 ##==============================================================================
470
471 options=options.mak
472 rm -f $options
473 echo "# This file was generated by configure." >> $options
474
475 cwd=`/bin/pwd`
476 root=$cwd
477 echo "export ROOT=$root" >> $options
478 echo "export PATH=$PATH:$cwd/$platform/bin" >> $options
479 echo "export LD_LIBRARY_PATH=$cwd/$platform/lib:$libdir" >> $options
480 echo "export PEGASUS_PLATFORM=$platform" >> $options
481 mike 1.2 echo "export PEGASUS_ROOT=$root" >> $options
482 echo "export PEGASUS_HOME=$cwd/$platform" >> $options
483
484 if [ "$disable_oop" = "1" ]
485 then
486 echo "export PEGASUS_DEFAULT_ENABLE_OOP=false" >> $options
487 echo "export PEGASUS_DISABLE_PROV_USERCTXT=1" >> $options
|
488 mike 1.5 echo "export PEGASUS_DISABLE_PRIVILEGED_TESTS=true" >> $options
|
489 mike 1.2 fi
490
491 if [ "$enable_debug" = 1 ]
492 then
493 echo "export PEGASUS_DEBUG=1" >> $options
494 fi
495
|
496 mike 1.5 if [ "$enable_pam" = "1" ]; then
|
497 mike 1.2 echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options
498 echo "export PEGASUS_USE_PAM_STANDALONE_PROC=true" >> $options
|
499 mike 1.1 fi
500
501 if [ "$enable_binary_repository" = "1" ]; then
|
502 mike 1.2 echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
|
503 mike 1.1 fi
504
|
505 mike 1.2 if [ "$enable_compressed_repository" = "1" ]; then
506 echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
|
507 mike 1.1 fi
508
|
509 mike 1.2 if [ "$enable_ssl" = "1" ]; then
510 echo "export PEGASUS_HAS_SSL=true" >> $options
|
511 mike 1.5 fi
512
513 if [ "$enable_slp" = "1" ]; then
514 echo "export PEGASUS_ENABLE_SLP=true" >> $options
515 fi
516
517 if [ "$enable_openslp" = "1" ]; then
518 echo "export PEGASUS_ENABLE_SLP=true" >> $options
519 echo "export PEGASUS_USE_OPENSLP=true" >> $options
520 fi
521
522 if [ ! -z "$with_openslp" ]; then
523 if [ ! -d "$with_openslp" ]; then
524 echo "$0: Error: No such directory: --with-openslp=$with_openslp"
525 echo
526 exit 1;
527 fi
528 echo "export PEGASUS_OPENSLP_HOME=$with_openslp" >> $options
529 fi
530
531 if [ "$disable_cmpi" != "1" ]; then
532 mike 1.5 echo "export PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=true" >> $options
533 fi
534
535 if [ -z "$with_ssl" ]; then
|
536 mike 1.2 echo "export OPENSSL_HOME=$with_ssl" >> $options
|
537 mike 1.1 fi
538
|
539 mike 1.2 if [ "$enable_binary_repository" = "1" ]; then
540 echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
|
541 mike 1.1 fi
542
|
543 mike 1.2 if [ "$enable_compressed_repository" = "1" ]; then
544 echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
|
545 mike 1.1 fi
546
|
547 mike 1.2 echo "created $options"
548
549 ##==============================================================================
550 ##
551 ## Create GNUmakefile
552 ##
553 ##==============================================================================
554
555 cat > GNUmakefile << END
556 include options.mak
557
558 include Makefile
559
560 distclean:
561 rm -rf \$(PEGASUS_PLATFORM)
562 rm -f GNUmakefile
563 rm -f options.mak
564 END
565
566 echo "created GNUmakefile"
567
568 mike 1.2 ##==============================================================================
569 ##
570 ## Print final message:
571 ##
572 ##==============================================================================
573
574 echo "configured for $host"
|
575 mike 1.1 echo
|