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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2