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.11 --platform=*)
70 platform=$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 mike 1.11 Configures OpenPegasus build options.
|
181 mike 1.2
182 Configure examples.
183 $ ./configure
|
184 mike 1.11 $ make
|
185 mike 1.2
186 Options:
187 --help
188 Print this help message.
|
189 mike 1.11 --platform=PLATFORM
190 Build package for this PLATFORM, which must be one of the following:
191 LINUX_IX86_GNU
192 LINUX_X86_64_GNU
193 SOLARIS_SPARC_64_CC
194 SOLARIS_X86_64_CC
|
195 mike 1.2 --prefix=DIR
196 Install under DIR
197 --bindir=DIR
198 Install programs here.
199 --sbindir=DIR
200 Install super-user programs here.
201 --libdir=DIR
202 Install libraries here.
203 --incluedir=DIR
204 Install include files here.
205 --datadir=DIR
206 Install data files here.
207 --enable-debug
208 Build for debug.
209 --disable-oop
210 Disable out-of-process providers.
|
211 mike 1.8 --disable-ipv6
212 Disable IPV6 support.
|
213 mike 1.7 --disable-trace
214 Disable tracing facility
215 --disable-tests
216 Disable build of most of the tests.
|
217 mike 1.5 --enable-pam
218 Enable PAM authentication (fall back on password-file authentication).
|
219 mike 1.2 --with-pam=DIR
220 Specify an alternative PAM directory location (defaults to /etc/pam.d).
221 --enable-ssl
222 Enable SSL feature
|
223 mike 1.6 --with-ssl=DIR
224 Find SSL under DIR (e.g., --with-ssl=/usr).
|
225 mike 1.5 --enable-slp
226 Enable SLP feature
227 --enable-openslp
228 Enable OpenSLP feature
229 --with-openslp=DIR
230 Find OpenSLP installation under DIR (e.g., --with-openslp=/usr).
231 --disable-cmpi
232 Disable CMPI provider support
|
233 mike 1.2 --enable-binary-repository
234 Enable the binary repository feature, resulting in a smaller CIM
235 repository disk footprint.
|
236 mike 1.9
|
237 mike 1.2 END
238 exit
|
239 mike 1.1 fi
240
241 ##==============================================================================
242 ##
|
243 mike 1.11 ## Check the --platform option.
244 ##
245 ##==============================================================================
246
247 if [ ! -z "$platform" ]; then
248
249 case "$platform" in
250 LINUX_IX86_GNU)
251 ;;
252 LINUX_X86_64_GNU)
253 ;;
254 SOLARIS_SPARC_64_CC)
255 ;;
256 SOLARIS_X86_64_CC)
257 ;;
258 *)
259 echo "$0: Unknown platform: --platform=$platform"
260 echo ""
261 exit 1
262 ;;
263 esac
264 mike 1.11 fi
265
266 ##==============================================================================
267 ##
|
268 mike 1.5 ## Guess the platform.
|
269 mike 1.1 ##
270 ##==============================================================================
271
|
272 mike 1.11 if [ -z "$platform" ]; then
|
273 mike 1.2
274 machine=`(uname -m) 2>/dev/null` || machine=unknown
275 system=`(uname -s) 2>/dev/null` || system=unknown
276 release=`(uname -r) 2>/dev/null` || release=unknown
277 version=`(uname -v) 2>/dev/null` || version=unknown
278 token="$machine:$system:$release:$version"
279
280 case "$token" in
281
282 i686:Linux:*:*)
|
283 mike 1.11 platform=LINUX_IX86_GNU
284 libbase=lib
|
285 mike 1.2 ;;
286
287 x86_64:Linux:*:*)
|
288 mike 1.11 platform=LINUX_X86_64_GNU
289 libbase=lib64
|
290 mike 1.2 ;;
|
291 mike 1.1
|
292 mike 1.11 sun*:SunOS:*:*)
293 platform=SOLARIS_SPARC_64_CC
294 libbase=lib/64
|
295 mike 1.2 ;;
|
296 mike 1.1
|
297 mike 1.11 i86pc:SunOS:*:*)
298 platform=SOLARIS_X86_64_CC
299 libbase=lib/64
|
300 mike 1.5 ;;
301
|
302 mike 1.2 *)
|
303 mike 1.11 echo "$0: Failed to guess platform"
|
304 mike 1.2 echo " machine=$machine"
305 echo " system=$system"
306 echo " release=$release"
307 echo " version=$version"
308 exit 1
309 ;;
310
311 esac
|
312 mike 1.1 fi
313
314 ##==============================================================================
315 ##
|
316 mike 1.2 ## Resolve default directory names.
|
317 mike 1.1 ##
318 ##==============================================================================
319
|
320 mike 1.2 # --prefix:
321
322 if [ -z "$prefix" ]; then
323 prefix=/usr/local
324 fi
325
326 # --bindir:
327
|
328 mike 1.1 if [ -z "$bindir" ]; then
329 bindir=$prefix/bin
330 fi
331
|
332 mike 1.2 # --sbindir:
333
|
334 mike 1.1 if [ -z "$sbindir" ]; then
335 sbindir=$prefix/sbin
336 fi
337
|
338 mike 1.2 # --libdir:
339
|
340 mike 1.1 if [ -z "$libdir" ]; then
|
341 mike 1.2 libdir=$prefix/$libbase
|
342 mike 1.1 fi
343
|
344 mike 1.2 # --includedir:
345
|
346 mike 1.1 if [ -z "$includedir" ]; then
347 includedir=$prefix/include
348 fi
349
|
350 mike 1.2 # --datadir:
351
|
352 mike 1.1 if [ -z "$datadir" ]; then
353 datadir=$prefix/share
354 fi
355
|
356 mike 1.2 if [ -z "$with_pam" ]; then
357 with_pam=/etc/pam.d
358 fi
359
|
360 mike 1.1 ##==============================================================================
361 ##
|
362 karl 1.10 ## Verify --with-ssl directory.
|
363 mike 1.1 ##
364 ##==============================================================================
365
|
366 karl 1.10 if [ ! -z "$with_ssl" ]; then
|
367 mike 1.1
|
368 mike 1.2 if [ ! -d "$with_ssl" ]; then
369 echo "$0: Error: No such directory: --with-ssl=$with_ssl"
370 exit 1;
371 fi
372
|
373 karl 1.10 if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then
374 echo "$0: missing dependency: \$with_ssl/include/openssl/ssl.h"
375 missing=1
376 fi
377
378 if [ ! -f "$with_ssl/bin/openssl" ]; then
379 echo "$0: missing dependency: \$with_ssl/bin/openssl"
380 missing=1
381 fi
|
382 mike 1.2
|
383 karl 1.10 if [ ! -f "$with_ssl/$libbase/libssl.so" ]; then
384 echo "$0: missing dependency: \$with_ssl/$libbase/libss.so"
385 missing=1
386 fi
|
387 mike 1.2
|
388 karl 1.10 if [ "$missing" = "1" ]; then
389 echo "$0: where --with-ssl=$with_ssl"
390 exit 1;
|
391 mike 1.2 fi
392
|
393 karl 1.10 fi
394
395 ##==============================================================================
396 ##
397 ## Verify --with-slp directory.
398 ##
399 ##==============================================================================
400
401 if [ ! -z "$with_openslp" ]; then
|
402 mike 1.2
|
403 karl 1.10 if [ ! -d "$with_openslp" ]; then
404 echo "$0: Error: No such directory: --with-openslp=$with_openslp"
405 exit 1;
|
406 mike 1.2 fi
407
|
408 karl 1.10 if [ ! -f "$with_openslp/include/slp.h" ]; then
409 echo "$0: missing dependency: \$with_openslp/include/slp.h"
410 missing=1
411 fi
|
412 mike 1.2
|
413 karl 1.10 if [ ! -f "$with_openslp/$libbase/libslp.so" ]; then
414 echo "$0: missing dependency: \$with_openslp/$libbase/libslp.so"
415 missing=1
|
416 mike 1.2 fi
417
|
418 karl 1.10 if [ "$missing" = "1" ]; then
419 echo "$0: where --with-openslp=$with_openslp"
|
420 mike 1.2 exit 1;
421 fi
422
423 fi
424
425 ##==============================================================================
426 ##
427 ## These options (if non-empty) must denote absolute directory names.
428 ##
429 ##==============================================================================
430
431 for i in \
432 prefix \
433 bindir \
434 sbindir \
435 libdir \
436 includedir \
437 datadir \
438 with_ssl \
439 with_pam
440 do
441 mike 1.2
442 eval v=$`echo $i`
443
444 case $v in
445 /* | "")
446 ;;
447
448 *)
449 echo "$0: Error: Must be an absolute directory name: --$i=$v"
450 exit 1;
451 ;;
452 esac
453
454 done
455
456 ##==============================================================================
457 ##
458 ## Create options.mak
459 ##
460 ##==============================================================================
461
462 mike 1.2 options=options.mak
463 rm -f $options
464 echo "# This file was generated by configure." >> $options
465
466 cwd=`/bin/pwd`
467 root=$cwd
468 echo "export ROOT=$root" >> $options
469 echo "export PATH=$PATH:$cwd/$platform/bin" >> $options
470 echo "export LD_LIBRARY_PATH=$cwd/$platform/lib:$libdir" >> $options
471 echo "export PEGASUS_PLATFORM=$platform" >> $options
472 echo "export PEGASUS_ROOT=$root" >> $options
473 echo "export PEGASUS_HOME=$cwd/$platform" >> $options
474
475 if [ "$disable_oop" = "1" ]
476 then
477 echo "export PEGASUS_DEFAULT_ENABLE_OOP=false" >> $options
478 echo "export PEGASUS_DISABLE_PROV_USERCTXT=1" >> $options
|
479 mike 1.5 echo "export PEGASUS_DISABLE_PRIVILEGED_TESTS=true" >> $options
|
480 mike 1.2 fi
481
|
482 mike 1.8 if [ "$disable_ipv6" = "1" ]
483 then
484 echo "export PEGASUS_ENABLE_IPV6=false" >> $options
485 else
486 echo "export PEGASUS_ENABLE_IPV6=true" >> $options
487 fi
488
|
489 mike 1.7 if [ "$disable_trace" = "1" ]
490 then
491 echo "export PEGASUS_REMOVE_TRACE=1" >> $options
492 fi
493
494 if [ "$disable_tests" = "1" ]
495 then
496 echo "export PEGASUS_SKIP_MOST_TEST_DIRS=true" >> $options
497 fi
498
|
499 mike 1.2 if [ "$enable_debug" = 1 ]
500 then
501 echo "export PEGASUS_DEBUG=1" >> $options
502 fi
503
|
504 mike 1.5 if [ "$enable_pam" = "1" ]; then
|
505 mike 1.2 echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options
506 echo "export PEGASUS_USE_PAM_STANDALONE_PROC=true" >> $options
|
507 mike 1.1 fi
508
509 if [ "$enable_binary_repository" = "1" ]; then
|
510 mike 1.2 echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
|
511 mike 1.1 fi
512
|
513 mike 1.2 if [ "$enable_compressed_repository" = "1" ]; then
514 echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
|
515 mike 1.1 fi
516
|
517 mike 1.2 if [ "$enable_ssl" = "1" ]; then
518 echo "export PEGASUS_HAS_SSL=true" >> $options
|
519 mike 1.5 fi
520
|
521 karl 1.10 if [ ! -z "$with_ssl" ]; then
522 echo "export OPENSSL_HOME=$with_ssl" >> $options
523 fi
524
|
525 mike 1.5 if [ "$enable_slp" = "1" ]; then
526 echo "export PEGASUS_ENABLE_SLP=true" >> $options
527 fi
528
529 if [ "$enable_openslp" = "1" ]; then
530 echo "export PEGASUS_ENABLE_SLP=true" >> $options
531 echo "export PEGASUS_USE_OPENSLP=true" >> $options
532 fi
533
534 if [ ! -z "$with_openslp" ]; then
535 echo "export PEGASUS_OPENSLP_HOME=$with_openslp" >> $options
536 fi
537
538 if [ "$disable_cmpi" != "1" ]; then
539 echo "export PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=true" >> $options
540 fi
541
|
542 mike 1.2 echo "created $options"
543
544 ##==============================================================================
545 ##
546 ## Create GNUmakefile
547 ##
548 ##==============================================================================
549
550 cat > GNUmakefile << END
551 include options.mak
552
553 include Makefile
554
555 distclean:
556 rm -rf \$(PEGASUS_PLATFORM)
557 rm -f GNUmakefile
558 rm -f options.mak
559 END
560
561 echo "created GNUmakefile"
562
563 mike 1.2 ##==============================================================================
564 ##
565 ## Print final message:
566 ##
567 ##==============================================================================
568
|
569 mike 1.11 echo "configured for $platform"
|
570 mike 1.1 echo
|