(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 karl  1.14     --with-test-user=*)
170                  with_test_user=$optarg
171                  ;;
172            
173 mike  1.1      *)
174                  echo "$0: unknown option:  $opt"
175                  exit 1
176                  ;;
177            
178              esac
179            done
180            
181            ##==============================================================================
182            ##
183 mike  1.2  ## Print help message if --help given on command line.
184 mike  1.1  ##
185            ##==============================================================================
186            
187            if [ "$help" = "1" ]; then
188 mike  1.2  cat<<END
189            
190            Usage: ./configure [OPTION]...
191            
192 mike  1.11 Configures OpenPegasus build options.
193 mike  1.2  
194            Configure examples.
195                $ ./configure
196 mike  1.11     $ make
197 mike  1.2  
198            Options:
199                --help
200                    Print this help message.
201 mike  1.11     --platform=PLATFORM
202                    Build package for this PLATFORM, which must be one of the following:
203                        LINUX_IX86_GNU
204                        LINUX_X86_64_GNU
205                        SOLARIS_SPARC_64_CC
206                        SOLARIS_X86_64_CC
207 mike  1.2      --prefix=DIR
208                    Install under DIR
209                --bindir=DIR
210                    Install programs here.
211                --sbindir=DIR
212                    Install super-user programs here.
213                --libdir=DIR
214                    Install libraries here.
215                --incluedir=DIR
216                    Install include files here.
217                --datadir=DIR
218                    Install data files here.
219                --enable-debug
220                    Build for debug.
221                --disable-oop
222                    Disable out-of-process providers.
223 mike  1.8      --disable-ipv6
224                    Disable IPV6 support.
225 mike  1.7      --disable-trace
226                    Disable tracing facility
227                --disable-tests
228                    Disable build of most of the tests.
229 mike  1.5      --enable-pam
230 karl  1.13         Enable PAM authentication.
231                --enable-pam-standalone
232                    Use PAM standalone cimservera program (implies --enable-pam).
233 mike  1.2      --with-pam=DIR
234                    Specify an alternative PAM directory location (defaults to /etc/pam.d).
235 karl  1.14     --with-test-user=USER
236                    The USER for user-related tests (must refer to actual OS user).
237 mike  1.2      --enable-ssl
238                    Enable SSL feature
239 mike  1.6      --with-ssl=DIR
240                    Find SSL under DIR (e.g., --with-ssl=/usr).
241 mike  1.5      --enable-slp
242                    Enable SLP feature
243                --enable-openslp
244 karl  1.13         Enable OpenSLP feature (implies --enable-slp).
245 mike  1.5      --with-openslp=DIR
246                    Find OpenSLP installation under DIR (e.g., --with-openslp=/usr).
247                --disable-cmpi
248                    Disable CMPI provider support
249 mike  1.2      --enable-binary-repository
250                    Enable the binary repository feature, resulting in a smaller CIM 
251                    repository disk footprint.
252 karl  1.13     --with-solaris-defaults
253                    Enables reasonable defaults for the Solaris Nevada platform. These
254                    includes:
255                        --enable-ssl
256                        --enable-openslp
257                        --enable-pam-standalone
258 mike  1.9  
259 mike  1.2  END
260            exit
261 mike  1.1  fi
262            
263            ##==============================================================================
264            ##
265 karl  1.13 ## Resolve platform specific default options.
266            ##
267            ##==============================================================================
268            
269            if [ "$with_solaris_defaults" = 1 ]; then
270                enable_ssl=1
271                enable_openslp=1
272                enable_pam_standalone=1
273            fi
274            
275            ##==============================================================================
276            ##
277 mike  1.11 ## Check the --platform option.
278            ##
279            ##==============================================================================
280            
281            if [ ! -z "$platform" ]; then
282            
283                case "$platform" in
284                    LINUX_IX86_GNU)
285                        ;;
286                    LINUX_X86_64_GNU)
287                        ;;
288                    SOLARIS_SPARC_64_CC)
289                        ;;
290                    SOLARIS_X86_64_CC)
291                        ;;
292                    *)
293                        echo "$0: Unknown platform: --platform=$platform"
294                        echo ""
295                        exit 1
296                        ;;
297                esac
298 mike  1.11 fi
299            
300            ##==============================================================================
301            ##
302 mike  1.5  ## Guess the platform.
303 mike  1.1  ##
304            ##==============================================================================
305            
306 mike  1.11 if [ -z "$platform" ]; then
307 mike  1.2  
308              machine=`(uname -m) 2>/dev/null` || machine=unknown
309              system=`(uname -s) 2>/dev/null`  || system=unknown
310              release=`(uname -r) 2>/dev/null` || release=unknown
311              version=`(uname -v) 2>/dev/null` || version=unknown
312              token="$machine:$system:$release:$version"
313            
314              case "$token" in
315            
316                i686:Linux:*:*)
317 mike  1.11       platform=LINUX_IX86_GNU
318                  libbase=lib
319 mike  1.2        ;;
320            
321                x86_64:Linux:*:*)
322 mike  1.11       platform=LINUX_X86_64_GNU
323                  libbase=lib64
324 mike  1.2        ;;
325 mike  1.1  
326 mike  1.11     sun*:SunOS:*:*)
327                  platform=SOLARIS_SPARC_64_CC
328                  libbase=lib/64
329 mike  1.2        ;;
330 mike  1.1  
331 mike  1.11     i86pc:SunOS:*:*)
332                  platform=SOLARIS_X86_64_CC
333                  libbase=lib/64
334 mike  1.5        ;;
335            
336 mike  1.2      *)
337 mike  1.11         echo "$0: Failed to guess platform"
338 mike  1.2          echo "  machine=$machine"
339                    echo "  system=$system"
340                    echo "  release=$release"
341                    echo "  version=$version"
342                    exit 1
343                    ;;
344            
345              esac
346 mike  1.1  fi
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_pam" ]; then
391              with_pam=/etc/pam.d
392            fi
393            
394 karl  1.14 if [ -z "$with_test_user" ]; then
395              with_test_user=guest
396            fi
397            
398 mike  1.1  ##==============================================================================
399            ##
400 karl  1.10 ## Verify --with-ssl directory.
401 mike  1.1  ##
402            ##==============================================================================
403            
404 karl  1.10 if [ ! -z "$with_ssl" ]; then
405 mike  1.1  
406 mike  1.2    if [ ! -d "$with_ssl" ]; then
407                echo "$0: Error: No such directory: --with-ssl=$with_ssl"
408                exit 1;
409              fi
410            
411 karl  1.10   if [ ! -f "$with_ssl/include/openssl/ssl.h" ]; then
412                echo "$0: missing dependency: \$with_ssl/include/openssl/ssl.h"
413                missing=1
414              fi
415            
416              if [ ! -f "$with_ssl/bin/openssl" ]; then
417                echo "$0: missing dependency: \$with_ssl/bin/openssl"
418                missing=1
419              fi
420 mike  1.2  
421 karl  1.10   if [ ! -f "$with_ssl/$libbase/libssl.so" ]; then
422                echo "$0: missing dependency: \$with_ssl/$libbase/libss.so"
423                missing=1
424              fi
425 mike  1.2  
426 karl  1.10   if [ "$missing" = "1" ]; then
427                echo "$0: where --with-ssl=$with_ssl"
428                exit 1;
429 mike  1.2    fi
430            
431 karl  1.10 fi
432            
433            ##==============================================================================
434            ##
435            ## Verify --with-slp directory.
436            ##
437            ##==============================================================================
438            
439            if [ ! -z "$with_openslp" ]; then
440 mike  1.2  
441 karl  1.10   if [ ! -d "$with_openslp" ]; then
442                echo "$0: Error: No such directory: --with-openslp=$with_openslp"
443                exit 1;
444 mike  1.2    fi
445            
446 karl  1.10   if [ ! -f "$with_openslp/include/slp.h" ]; then
447                echo "$0: missing dependency: \$with_openslp/include/slp.h"
448                missing=1
449              fi
450 mike  1.2  
451 karl  1.10   if [ ! -f "$with_openslp/$libbase/libslp.so" ]; then
452                echo "$0: missing dependency: \$with_openslp/$libbase/libslp.so"
453                missing=1
454 mike  1.2    fi
455            
456 karl  1.10   if [ "$missing" = "1" ]; then
457                echo "$0: where --with-openslp=$with_openslp"
458 mike  1.2      exit 1;
459              fi
460            
461            fi
462            
463            ##==============================================================================
464            ##
465            ## These options (if non-empty) must denote absolute directory names.
466            ##
467            ##==============================================================================
468            
469            for i in \
470              prefix \
471              bindir \
472              sbindir \
473              libdir \
474              includedir \
475              datadir \
476              with_ssl \
477              with_pam
478            do
479 mike  1.2  
480              eval v=$`echo $i`
481            
482              case $v in
483                /* | "")
484                  ;;
485            
486                *)
487                  echo "$0: Error: Must be an absolute directory name: --$i=$v"
488                  exit 1;
489                  ;;
490              esac
491            
492            done
493            
494            ##==============================================================================
495            ##
496 karl  1.14 ## Check whether the test user will be able to access pegasus home.
497            ##
498            ##==============================================================================
499            
500            uid=`id -u`
501            cwd=`/bin/pwd`
502            
503            if [ "$uid" = "0" -a "$disable_tests" != "1" ]; then
504            
505              if [ "$enable_pam" = "1" -o "$enable_pam_standalone" = "1" ]; then
506            
507                su $with_test_user -c "/bin/true"
508            
509                if [ "$?" != "0" ]; then
510                  echo "$0: The test user account ($with_test_user) does not exist on this system. Please create a test user with this name or designate an existing one with the --with-test-user option."
511                  exit 1
512                fi
513            
514                su $with_test_user -c "cd $cwd 2> /dev/null"
515            
516                if [ "$?" != "0" ]; then
517 karl  1.14       echo "$0: The test user account ($with_test_user) has insufficient privileges to access the pegasus root directory ($cwd), which will cause the user-context tests to fail. Please configure from a different directory."
518                  exit 1
519                fi
520              fi
521            
522            fi
523            
524            ##==============================================================================
525            ##
526 mike  1.2  ## Create options.mak
527            ##
528            ##==============================================================================
529            
530            options=options.mak
531            rm -f $options
532            echo "# This file was generated by configure." >> $options
533            
534            cwd=`/bin/pwd`
535            root=$cwd
536            echo "export ROOT=$root" >> $options
537            echo "export PATH=$PATH:$cwd/$platform/bin" >> $options
538            echo "export LD_LIBRARY_PATH=$cwd/$platform/lib:$libdir" >> $options
539            echo "export PEGASUS_PLATFORM=$platform" >> $options
540            echo "export PEGASUS_ROOT=$root" >> $options
541            echo "export PEGASUS_HOME=$cwd/$platform" >> $options
542            
543            if [ "$disable_oop" = "1" ]
544            then
545              echo "export PEGASUS_DEFAULT_ENABLE_OOP=false" >> $options
546              echo "export PEGASUS_DISABLE_PROV_USERCTXT=1" >> $options
547 mike  1.5    echo "export PEGASUS_DISABLE_PRIVILEGED_TESTS=true" >> $options
548 mike  1.2  fi
549            
550 mike  1.8  if [ "$disable_ipv6" = "1" ]
551            then
552              echo "export PEGASUS_ENABLE_IPV6=false" >> $options
553            else
554              echo "export PEGASUS_ENABLE_IPV6=true" >> $options
555            fi
556            
557 mike  1.7  if [ "$disable_trace" = "1" ]
558            then
559              echo "export PEGASUS_REMOVE_TRACE=1" >> $options
560            fi
561            
562            if [ "$disable_tests" = "1" ]
563            then
564              echo "export PEGASUS_SKIP_MOST_TEST_DIRS=true" >> $options
565            fi
566            
567 mike  1.2  if [ "$enable_debug" = 1 ]
568            then
569              echo "export PEGASUS_DEBUG=1" >> $options
570            fi
571            
572 mike  1.5  if [ "$enable_pam" = "1" ]; then
573 mike  1.2    echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options
574 karl  1.13 fi
575            
576            if [ "$enable_pam_standalone" = "1" ]; then
577              echo "export PEGASUS_PAM_AUTHENTICATION=true" >> $options
578 mike  1.2    echo "export PEGASUS_USE_PAM_STANDALONE_PROC=true" >> $options
579 mike  1.1  fi
580            
581            if [ "$enable_binary_repository" = "1" ]; then
582 mike  1.2    echo "export PEGASUS_REPOSITORY_MODE=BIN" >> $options
583 mike  1.1  fi
584            
585 mike  1.2  if [ "$enable_compressed_repository" = "1" ]; then
586              echo "export PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1" >> $options
587 mike  1.1  fi
588            
589 mike  1.2  if [ "$enable_ssl" = "1" ]; then
590              echo "export PEGASUS_HAS_SSL=true" >> $options
591 mike  1.5  fi
592            
593 karl  1.10 if [ ! -z "$with_ssl" ]; then
594              echo "export OPENSSL_HOME=$with_ssl" >> $options
595            fi
596            
597 mike  1.5  if [ "$enable_slp" = "1" ]; then
598                echo "export PEGASUS_ENABLE_SLP=true" >> $options
599            fi
600            
601            if [ "$enable_openslp" = "1" ]; then
602                echo "export PEGASUS_ENABLE_SLP=true" >> $options
603                echo "export PEGASUS_USE_OPENSLP=true" >> $options
604            fi
605            
606            if [ ! -z "$with_openslp" ]; then
607              echo "export PEGASUS_OPENSLP_HOME=$with_openslp" >> $options
608            fi
609            
610            if [ "$disable_cmpi" != "1" ]; then
611              echo "export PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER=true" >> $options
612            fi
613            
614 mike  1.2  echo "created $options"
615            
616            ##==============================================================================
617            ##
618            ## Create GNUmakefile
619            ##
620            ##==============================================================================
621            
622            cat > GNUmakefile << END
623            include options.mak
624            
625            include Makefile
626            
627            distclean:
628            	rm -rf \$(PEGASUS_PLATFORM)
629            	rm -f GNUmakefile
630            	rm -f options.mak
631            END
632            
633            echo "created GNUmakefile"
634            
635 mike  1.2  ##==============================================================================
636            ##
637            ## Print final message:
638            ##
639            ##==============================================================================
640            
641 mike  1.11 echo "configured for $platform"
642 mike  1.1  echo

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2