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_ssl" ]; then
392 with_ssl=/usr
393 fi
394
395 if [ -z "$with_pam" ]; then
396 with_pam=/etc/pam.d
397 fi
398
|
399 mike 1.1 ##==============================================================================
400 ##
|
401 mike 1.2 ## Verify existence of SSL files and directories.
|
402 mike 1.1 ##
403 ##==============================================================================
404
|
405 mike 1.2 if [ "$enable_ssl" = "1" ]; then
|
406 mike 1.1
|
407 mike 1.2 # Verify that SSL base directory exists (e.g., /usr).
|
408 mike 1.1
|
409 mike 1.2 if [ ! -d "$with_ssl" ]; then
410 echo "$0: Error: No such directory: --with-ssl=$with_ssl"
411 echo
412 exit 1;
413 fi
414
415 # Verify that "ssl.h" exists.
416
417 missing=
418
419 if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then
420 missing=include/openssl/ssl.h
421 fi
422
423 # Verify that "openssl" program exists.
424
425 if [ ! -f "$with_ssl/bin/openssl" ]; then
426 missing=bin/openssl
427 fi
428
429 # Verify that "libssl.a" or "libssl.so" exist.
430 mike 1.2
431 if [ ! -f "$with_ssl/$libbase/libssl.a" -a ! -f "$with_ssl/$libbase/libssl.so" ]; then
432 missing="$libbase/libssl.so"
433 fi
434
435 # Print error if any of the above components are missing.
436
437 if [ ! -z $missing ]; then
438 echo -n "$0: Error: SSL component not found: $with_ssl/$missing. "
439 echo -n "Specify location of SSL with the --with-ssl=DIR option."
440 echo
441 exit 1;
442 fi
443
444 fi
445
446 ##==============================================================================
447 ##
448 ## These options (if non-empty) must denote absolute directory names.
449 ##
450 ##==============================================================================
451 mike 1.2
452 for i in \
453 prefix \
454 bindir \
455 sbindir \
456 libdir \
457 includedir \
458 datadir \
459 with_ssl \
460 with_pam
461 do
462
463 eval v=$`echo $i`
464
465 case $v in
466 /* | "")
467 ;;
468
469 *)
470 echo "$0: Error: Must be an absolute directory name: --$i=$v"
471 exit 1;
472 mike 1.2 ;;
473 esac
474
475 done
476
477 ##==============================================================================
478 ##
479 ## Create options.mak
480 ##
481 ##==============================================================================
482
483 options=options.mak
484 rm -f $options
485 echo "# This file was generated by configure." >> $options
486
487 cwd=`/bin/pwd`
488 root=$cwd
489 echo "export ROOT=$root" >> $options
490 echo "export PATH=$PATH:$cwd/$platform/bin" >> $options
491 echo "export LD_LIBRARY_PATH=$cwd/$platform/lib:$libdir" >> $options
492 echo "export PEGASUS_PLATFORM=$platform" >> $options
493 mike 1.2 echo "export PEGASUS_ROOT=$root" >> $options
494 echo "export PEGASUS_HOME=$cwd/$platform" >> $options
495
496 if [ "$disable_oop" = "1" ]
497 then
498 echo "export PEGASUS_DEFAULT_ENABLE_OOP=false" >> $options
499 echo "export PEGASUS_DISABLE_PROV_USERCTXT=1" >> $options
|
500 mike 1.5 echo "export PEGASUS_DISABLE_PRIVILEGED_TESTS=true" >> $options
|
501 mike 1.2 fi
502
|
503 mike 1.8 if [ "$disable_ipv6" = "1" ]
504 then
505 echo "export PEGASUS_ENABLE_IPV6=false" >> $options
506 else
507 echo "export PEGASUS_ENABLE_IPV6=true" >> $options
508 fi
509
|
510 mike 1.7 if [ "$disable_trace" = "1" ]
511 then
512 echo "export PEGASUS_REMOVE_TRACE=1" >> $options
513 fi
514
515 if [ "$disable_tests" = "1" ]
516 then
517 echo "export PEGASUS_SKIP_MOST_TEST_DIRS=true" >> $options
518 fi
519
|
520 mike 1.2 if [ "$enable_debug" = 1 ]
521 then
522 echo "export PEGASUS_DEBUG=1" >> $options
523 fi
524
|
525 mike 1.5 if [ "$enable_pam" = "1" ]; then
|
526 mike 1.2 echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options
527 echo "export PEGASUS_USE_PAM_STANDALONE_PROC=true" >> $options
|
528 mike 1.1 fi
529
530 if [ "$enable_binary_repository" = "1" ]; then
|
531 mike 1.2 echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
|
532 mike 1.1 fi
533
|
534 mike 1.2 if [ "$enable_compressed_repository" = "1" ]; then
535 echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
|
536 mike 1.1 fi
537
|
538 mike 1.2 if [ "$enable_ssl" = "1" ]; then
539 echo "export PEGASUS_HAS_SSL=true" >> $options
|
540 mike 1.5 fi
541
542 if [ "$enable_slp" = "1" ]; then
543 echo "export PEGASUS_ENABLE_SLP=true" >> $options
544 fi
545
546 if [ "$enable_openslp" = "1" ]; then
547 echo "export PEGASUS_ENABLE_SLP=true" >> $options
548 echo "export PEGASUS_USE_OPENSLP=true" >> $options
549 fi
550
551 if [ ! -z "$with_openslp" ]; then
552 if [ ! -d "$with_openslp" ]; then
553 echo "$0: Error: No such directory: --with-openslp=$with_openslp"
554 echo
555 exit 1;
556 fi
557 echo "export PEGASUS_OPENSLP_HOME=$with_openslp" >> $options
558 fi
559
560 if [ "$disable_cmpi" != "1" ]; then
561 mike 1.5 echo "export PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=true" >> $options
562 fi
563
564 if [ -z "$with_ssl" ]; then
|
565 mike 1.2 echo "export OPENSSL_HOME=$with_ssl" >> $options
|
566 mike 1.1 fi
567
|
568 mike 1.2 if [ "$enable_binary_repository" = "1" ]; then
569 echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
|
570 mike 1.1 fi
571
|
572 mike 1.2 if [ "$enable_compressed_repository" = "1" ]; then
573 echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
|
574 mike 1.1 fi
575
|
576 mike 1.2 echo "created $options"
577
578 ##==============================================================================
579 ##
580 ## Create GNUmakefile
581 ##
582 ##==============================================================================
583
584 cat > GNUmakefile << END
585 include options.mak
586
587 include Makefile
588
589 distclean:
590 rm -rf \$(PEGASUS_PLATFORM)
591 rm -f GNUmakefile
592 rm -f options.mak
593 END
594
595 echo "created GNUmakefile"
596
597 mike 1.2 ##==============================================================================
598 ##
599 ## Print final message:
600 ##
601 ##==============================================================================
602
603 echo "configured for $host"
|
604 mike 1.1 echo
|