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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2