(file) Return to configure CVS log (file) (dir) Up to [Pegasus] / pegasus_unsupported / config

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2