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.8 --disable-ipv6)
106 disable_ipv6=1
107 ;;
108
|
109 mike 1.7 --disable-trace)
110 disable_trace=1
111 ;;
112
113 --disable-tests)
114 disable_tests=1
115 ;;
116
|
117 mike 1.5 --enable-pam)
118 enable_pam=1
|
119 mike 1.2 ;;
120
121 --with-pam=*)
122 with_pam=$optarg
123 ;;
124
125 --with-pam-mod=*)
126 with_pam_mod=$optarg
|
127 mike 1.1 ;;
128
|
129 mike 1.2 --enable-ssl)
130 enable_ssl=1
|
131 mike 1.1 ;;
132
|
133 mike 1.5 --enable-slp)
134 enable_slp=1
135 ;;
136
137 --enable-openslp)
138 enable_openslp=1
139 ;;
140
141 --with-openslp=*)
142 with_openslp=$optarg
143 ;;
144
145 --disable-cmpi)
146 disable_cmpi=1
147 ;;
148
|
149 mike 1.2 --with-ssl=*)
150 with_ssl=$optarg
|
151 mike 1.1 ;;
152
|
153 mike 1.2 --enable-binary-repository)
154 enable_binary_repository=1
|
155 mike 1.1 ;;
156
|
157 mike 1.2 --enable-compressed-repository)
158 enable_compressed_repository=1
|
159 mike 1.1 ;;
160
161 *)
162 echo "$0: unknown option: $opt"
163 exit 1
164 ;;
165
166 esac
167 done
168
169 ##==============================================================================
170 ##
|
171 mike 1.2 ## Print help message if --help given on command line.
|
172 mike 1.1 ##
173 ##==============================================================================
174
175 if [ "$help" = "1" ]; then
|
176 mike 1.2 cat<<END
177
178 Usage: ./configure [OPTION]...
179
180 Configures Inova OpenPegasus build options.
181
182 Configure examples.
183 $ ./configure
184
185 Options:
186 --help
187 Print this help message.
188 --host=HOST
189 Build package for this HOST, where HOST is of the form
190 "<cpu>-<manufacturer>-<os>-<kernel>".
191 --prefix=DIR
192 Install under DIR
193 --bindir=DIR
194 Install programs here.
195 --sbindir=DIR
196 Install super-user programs here.
197 mike 1.2 --libdir=DIR
198 Install libraries here.
199 --incluedir=DIR
200 Install include files here.
201 --datadir=DIR
202 Install data files here.
203 --enable-debug
204 Build for debug.
205 --disable-oop
206 Disable out-of-process providers.
|
207 mike 1.8 --disable-ipv6
208 Disable IPV6 support.
|
209 mike 1.7 --disable-trace
210 Disable tracing facility
211 --disable-tests
212 Disable build of most of the tests.
|
213 mike 1.5 --enable-pam
214 Enable PAM authentication (fall back on password-file authentication).
|
215 mike 1.2 --with-pam=DIR
216 Specify an alternative PAM directory location (defaults to /etc/pam.d).
217 --enable-ssl
218 Enable SSL feature
|
219 mike 1.6 --with-ssl=DIR
220 Find SSL under DIR (e.g., --with-ssl=/usr).
|
221 mike 1.5 --enable-slp
222 Enable SLP feature
223 --enable-openslp
224 Enable OpenSLP feature
225 --with-openslp=DIR
226 Find OpenSLP installation under DIR (e.g., --with-openslp=/usr).
227 --disable-cmpi
228 Disable CMPI provider support
|
229 mike 1.2 --enable-binary-repository
230 Enable the binary repository feature, resulting in a smaller CIM
231 repository disk footprint.
|
232 mike 1.9
|
233 mike 1.2 END
234 exit
|
235 mike 1.1 fi
236
237 ##==============================================================================
238 ##
|
239 mike 1.5 ## Guess the platform.
|
240 mike 1.1 ##
241 ##==============================================================================
242
|
243 mike 1.2 if [ -z "$host" ]; then
244
245 machine=`(uname -m) 2>/dev/null` || machine=unknown
246 system=`(uname -s) 2>/dev/null` || system=unknown
247 release=`(uname -r) 2>/dev/null` || release=unknown
248 version=`(uname -v) 2>/dev/null` || version=unknown
249 token="$machine:$system:$release:$version"
250
251 case "$token" in
252
253 i686:Linux:*:*)
254 host=i686-unknown-linux-gnu
255 ;;
256
257 x86_64:Linux:*:*)
258 host=x86_64-unknown-linux-gnu
259 ;;
|
260 mike 1.1
|
261 mike 1.2 ia64:Linux:*:*)
262 host=ia64-unknown-linux-gnu
263 ;;
|
264 mike 1.1
|
265 mike 1.2 s390:Linux:*:*)
266 host=s390-unknown-linux-gnu
267 ;;
|
268 mike 1.1
|
269 mike 1.2 s390x:Linux:*:*)
270 host=s390x-unknown-linux-gnu
271 ;;
|
272 mike 1.1
|
273 mike 1.2 ppc64:Linux:*:*)
274 host=ppc64-unknown-linux-gnu
275 ;;
|
276 mike 1.1
|
277 mike 1.2 ppc:Linux:*:*)
278 host=ppc-unknown-linux-gnu
279 ;;
|
280 mike 1.1
|
281 mike 1.5 sun*:SunOS:*:*)
282 host=sparc-sun-solaris
283 ;;
284
|
285 mike 1.2 *)
286 echo "$0: Failed to guess host"
287 echo " machine=$machine"
288 echo " system=$system"
289 echo " release=$release"
290 echo " version=$version"
291 exit 1
292 ;;
293
294 esac
|
295 mike 1.1 fi
296
297 ##==============================================================================
298 ##
|
299 mike 1.2 ## Set the platform library basename ("lib" or "lib64" depending on vendor
300 ## convention and architecture).
|
301 mike 1.1 ##
302 ##==============================================================================
303
|
304 mike 1.2 case "$host" in
305
306 i686-unknown-linux-gnu)
307 platform=LINUX_IX86_GNU
308 libbase=lib
309 ;;
310
311 x86_64-unknown-linux-gnu)
312 platform=LINUX_X86_64_GNU
313 libbase=lib64
314 ;;
315
316 ia64-unknown-linux-gnu)
317 platform=LINUX_IA64_GNU
318 libbase=lib
319 ;;
320
321 ppc-unknown-linux-gnu)
322 platform=LINUX_PPC_GNU
323 libbase=lib
324 ;;
|
325 mike 1.1
|
326 mike 1.2 ppc64-unknown-linux-gnu)
327 platform=LINUX_PPC64_GNU
328 libbase=lib64
|
329 mike 1.1 ;;
330
|
331 mike 1.2 arm-wrs-vxworks-gnu)
332 platform=VXWORKS_XSCALE_GNU
333 libbase=lib
334 enable_static=1
|
335 mike 1.1 ;;
336
|
337 mike 1.5 sparc-sun-solaris)
338 platform=SOLARIS_SPARC_64_CC
339 libbase=lib/64
340 ;;
341
|
342 mike 1.1 *)
|
343 mike 1.2 echo "$0: unknown host: $host"
|
344 mike 1.1 exit 1
345 ;;
346
347 esac
348
349 ##==============================================================================
350 ##
|
351 mike 1.2 ## Resolve default directory names.
|
352 mike 1.1 ##
353 ##==============================================================================
354
|
355 mike 1.2 # --prefix:
356
357 if [ -z "$prefix" ]; then
358 prefix=/usr/local
359 fi
360
361 # --bindir:
362
|
363 mike 1.1 if [ -z "$bindir" ]; then
364 bindir=$prefix/bin
365 fi
366
|
367 mike 1.2 # --sbindir:
368
|
369 mike 1.1 if [ -z "$sbindir" ]; then
370 sbindir=$prefix/sbin
371 fi
372
|
373 mike 1.2 # --libdir:
374
|
375 mike 1.1 if [ -z "$libdir" ]; then
|
376 mike 1.2 libdir=$prefix/$libbase
|
377 mike 1.1 fi
378
|
379 mike 1.2 # --includedir:
380
|
381 mike 1.1 if [ -z "$includedir" ]; then
382 includedir=$prefix/include
383 fi
384
|
385 mike 1.2 # --datadir:
386
|
387 mike 1.1 if [ -z "$datadir" ]; then
388 datadir=$prefix/share
389 fi
390
|
391 mike 1.2 if [ -z "$with_pam" ]; then
392 with_pam=/etc/pam.d
393 fi
394
|
395 mike 1.1 ##==============================================================================
396 ##
|
397 karl 1.10 ## Verify --with-ssl directory.
|
398 mike 1.1 ##
399 ##==============================================================================
400
|
401 karl 1.10 if [ ! -z "$with_ssl" ]; then
|
402 mike 1.1
|
403 mike 1.2 if [ ! -d "$with_ssl" ]; then
404 echo "$0: Error: No such directory: --with-ssl=$with_ssl"
405 exit 1;
406 fi
407
|
408 karl 1.10 if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then
409 echo "$0: missing dependency: \$with_ssl/include/openssl/ssl.h"
410 missing=1
411 fi
412
413 if [ ! -f "$with_ssl/bin/openssl" ]; then
414 echo "$0: missing dependency: \$with_ssl/bin/openssl"
415 missing=1
416 fi
|
417 mike 1.2
|
418 karl 1.10 if [ ! -f "$with_ssl/$libbase/libssl.so" ]; then
419 echo "$0: missing dependency: \$with_ssl/$libbase/libss.so"
420 missing=1
421 fi
|
422 mike 1.2
|
423 karl 1.10 if [ "$missing" = "1" ]; then
424 echo "$0: where --with-ssl=$with_ssl"
425 exit 1;
|
426 mike 1.2 fi
427
|
428 karl 1.10 fi
429
430 ##==============================================================================
431 ##
432 ## Verify --with-slp directory.
433 ##
434 ##==============================================================================
435
436 if [ ! -z "$with_openslp" ]; then
|
437 mike 1.2
|
438 karl 1.10 if [ ! -d "$with_openslp" ]; then
439 echo "$0: Error: No such directory: --with-openslp=$with_openslp"
440 exit 1;
|
441 mike 1.2 fi
442
|
443 karl 1.10 if [ ! -f "$with_openslp/include/slp.h" ]; then
444 echo "$0: missing dependency: \$with_openslp/include/slp.h"
445 missing=1
446 fi
|
447 mike 1.2
|
448 karl 1.10 if [ ! -f "$with_openslp/$libbase/libslp.so" ]; then
449 echo "$0: missing dependency: \$with_openslp/$libbase/libslp.so"
450 missing=1
|
451 mike 1.2 fi
452
|
453 karl 1.10 if [ "$missing" = "1" ]; then
454 echo "$0: where --with-openslp=$with_openslp"
|
455 mike 1.2 exit 1;
456 fi
457
458 fi
459
460 ##==============================================================================
461 ##
462 ## These options (if non-empty) must denote absolute directory names.
463 ##
464 ##==============================================================================
465
466 for i in \
467 prefix \
468 bindir \
469 sbindir \
470 libdir \
471 includedir \
472 datadir \
473 with_ssl \
474 with_pam
475 do
476 mike 1.2
477 eval v=$`echo $i`
478
479 case $v in
480 /* | "")
481 ;;
482
483 *)
484 echo "$0: Error: Must be an absolute directory name: --$i=$v"
485 exit 1;
486 ;;
487 esac
488
489 done
490
491 ##==============================================================================
492 ##
493 ## Create options.mak
494 ##
495 ##==============================================================================
496
497 mike 1.2 options=options.mak
498 rm -f $options
499 echo "# This file was generated by configure." >> $options
500
501 cwd=`/bin/pwd`
502 root=$cwd
503 echo "export ROOT=$root" >> $options
504 echo "export PATH=$PATH:$cwd/$platform/bin" >> $options
505 echo "export LD_LIBRARY_PATH=$cwd/$platform/lib:$libdir" >> $options
506 echo "export PEGASUS_PLATFORM=$platform" >> $options
507 echo "export PEGASUS_ROOT=$root" >> $options
508 echo "export PEGASUS_HOME=$cwd/$platform" >> $options
509
510 if [ "$disable_oop" = "1" ]
511 then
512 echo "export PEGASUS_DEFAULT_ENABLE_OOP=false" >> $options
513 echo "export PEGASUS_DISABLE_PROV_USERCTXT=1" >> $options
|
514 mike 1.5 echo "export PEGASUS_DISABLE_PRIVILEGED_TESTS=true" >> $options
|
515 mike 1.2 fi
516
|
517 mike 1.8 if [ "$disable_ipv6" = "1" ]
518 then
519 echo "export PEGASUS_ENABLE_IPV6=false" >> $options
520 else
521 echo "export PEGASUS_ENABLE_IPV6=true" >> $options
522 fi
523
|
524 mike 1.7 if [ "$disable_trace" = "1" ]
525 then
526 echo "export PEGASUS_REMOVE_TRACE=1" >> $options
527 fi
528
529 if [ "$disable_tests" = "1" ]
530 then
531 echo "export PEGASUS_SKIP_MOST_TEST_DIRS=true" >> $options
532 fi
533
|
534 mike 1.2 if [ "$enable_debug" = 1 ]
535 then
536 echo "export PEGASUS_DEBUG=1" >> $options
537 fi
538
|
539 mike 1.5 if [ "$enable_pam" = "1" ]; then
|
540 mike 1.2 echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options
541 echo "export PEGASUS_USE_PAM_STANDALONE_PROC=true" >> $options
|
542 mike 1.1 fi
543
544 if [ "$enable_binary_repository" = "1" ]; then
|
545 mike 1.2 echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
|
546 mike 1.1 fi
547
|
548 mike 1.2 if [ "$enable_compressed_repository" = "1" ]; then
549 echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
|
550 mike 1.1 fi
551
|
552 mike 1.2 if [ "$enable_ssl" = "1" ]; then
553 echo "export PEGASUS_HAS_SSL=true" >> $options
|
554 mike 1.5 fi
555
|
556 karl 1.10 if [ ! -z "$with_ssl" ]; then
557 echo "export OPENSSL_HOME=$with_ssl" >> $options
558 fi
559
|
560 mike 1.5 if [ "$enable_slp" = "1" ]; then
561 echo "export PEGASUS_ENABLE_SLP=true" >> $options
562 fi
563
564 if [ "$enable_openslp" = "1" ]; then
565 echo "export PEGASUS_ENABLE_SLP=true" >> $options
566 echo "export PEGASUS_USE_OPENSLP=true" >> $options
567 fi
568
569 if [ ! -z "$with_openslp" ]; then
570 echo "export PEGASUS_OPENSLP_HOME=$with_openslp" >> $options
571 fi
572
573 if [ "$disable_cmpi" != "1" ]; then
574 echo "export PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=true" >> $options
575 fi
576
|
577 mike 1.2 if [ "$enable_binary_repository" = "1" ]; then
578 echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
|
579 mike 1.1 fi
580
|
581 mike 1.2 if [ "$enable_compressed_repository" = "1" ]; then
582 echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
|
583 mike 1.1 fi
584
|
585 mike 1.2 echo "created $options"
586
587 ##==============================================================================
588 ##
589 ## Create GNUmakefile
590 ##
591 ##==============================================================================
592
593 cat > GNUmakefile << END
594 include options.mak
595
596 include Makefile
597
598 distclean:
599 rm -rf \$(PEGASUS_PLATFORM)
600 rm -f GNUmakefile
601 rm -f options.mak
602 END
603
604 echo "created GNUmakefile"
605
606 mike 1.2 ##==============================================================================
607 ##
608 ## Print final message:
609 ##
610 ##==============================================================================
611
612 echo "configured for $host"
|
613 mike 1.1 echo
|