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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2