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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2