(file) Return to buildtool CVS log (file) (dir) Up to [OMI] / omi

   1 mike  1.1 #!/bin/sh
   2           
   3           ##==============================================================================
   4           ##
   5           ## Extract leading arguments into $arg1 ... $arg9
   6           ## Extract options int $opts
   7           ##
   8           ##==============================================================================
   9           
  10           n="1"
  11           argc="0"
  12           
  13           for i
  14           do
  15           
  16               # Break on the first argument that starts with '-'
  17               case $i in
  18                   -h|--help)
  19                       help=1
  20                       break;
  21                       ;;
  22 mike  1.1         -*)
  23                       break;
  24                       ;;
  25               esac
  26           
  27               # Set arguments arg1 ... arg9
  28               case $n in
  29                   1)
  30                       arg1="$i"
  31                       shift
  32                       ;;
  33                   2)
  34                       arg2="$i"
  35                       shift
  36                       ;;
  37                   3)
  38                       arg3="$i"
  39                       shift
  40                       ;;
  41                   4)
  42                       arg4="$i"
  43 mike  1.1             shift
  44                       ;;
  45                   5)
  46                       arg5="$i"
  47                       shift
  48                       ;;
  49                   6)
  50                       arg6="$i"
  51                       shift
  52                       ;;
  53                   7)
  54                     arg7="$i"
  55                     shift
  56                     ;;
  57                   8)
  58                       arg8="$i"
  59                       shift
  60                       ;;
  61                   9)
  62                       arg9="$i"
  63                       shift
  64 mike  1.1             ;;
  65               esac
  66           
  67               argc=`expr $argc + 1`
  68               n=`expr $n + 1`
  69           
  70           done
  71           
  72           opts=$*
  73           
  74           #echo "help=$help"
  75           #echo "argc=$argc"
  76           #echo "arg1=$arg1"
  77           #echo "arg2=$arg2"
  78           #echo "arg3=$arg3"
  79           #echo "arg4=$arg4"
  80           #echo "arg5=$arg5"
  81           #echo "arg6=$arg6"
  82           #echo "arg7=$arg7"
  83           #echo "arg8=$arg8"
  84           #echo "arg9=$arg9"
  85 mike  1.1 #echo "opts{$opts}"
  86           
  87           ##==============================================================================
  88           ##
  89 krisbash 1.4 ## Extract the --target=TARGET option up front (leave other options in 
  90              ## localopts).
  91              ##
  92              ##==============================================================================
  93              
  94              localopts=
  95              
  96              for opt in $opts
  97              do
  98                  arg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
  99                  case $opt in
 100                      --target=*)
 101                          target=$arg
 102                          ;;
 103                      *)
 104                          if [ -z "$localopts" ]; then
 105                              localopts="$opt"
 106                          else
 107                              localopts="$localopts $opt"
 108                          fi
 109                          ;;
 110 krisbash 1.4     esac
 111              done
 112              
 113              opts=$localopts
 114              
 115              ##==============================================================================
 116              ##
 117 mike     1.1 ## Print the help message
 118              ##
 119              ##==============================================================================
 120              
 121              if [ "$help" = "1" ]; then
 122              
 123                  cat<<EOF
 124              Usage: $0 [COMMAND] [ARGUMENTS] [OPTIONS]
 125              
 126              COMMANDS:
 127                  platform
 128                      Print the platform ID for this platform.
 129                  os
 130                      Print operating system ID for this platform.
 131                  hostname
 132                      Print short hostname.
 133                  longhostname
 134                      Print long hostname.
 135                  username
 136                      Print the username of the current user.
 137                  arch
 138 mike     1.1         Print architecture ID for this platform.
 139                  compiler
 140                      Print compiler ID for this platform.
 141                  cc                  
 142                      Print command name of C compiler.
 143                  cxx                 
 144                      Print command name of C++ compiler.
 145 krisbash 1.4     ar
 146                      Print command name of archive command.
 147                  cflags [--debug --pic --errwarn --pal]
 148 mike     1.1         Print C compiler flags.
 149                  cxxflags [--debug --pic --errwarn]
 150                      Print C++ compiler flags.
 151 krisbash 1.4     cshlibflags [--libpath=PATH --pal]
 152 mike     1.1         Print compiler flags used to create a C shared library.
 153                  cxxshlibflags [--libpath=PATH]
 154                      Print compiler flags used to create a C++ shared library.
 155                  cprogflags [--libpath=PATH]
 156                      Print compiler flags used to create a C program.
 157                  cxxprogflags [--libpath=PATH]
 158                      Print compiler flags used to create a C++ program.
 159                  mkdep
 160                      Print out command to build dependencies.
 161                  syslibs
 162                      Print a list of system libraries.
 163                  libpath
 164                      Print dynamic library path option.
 165                  shlibname BASENAME
 166                      Print the shared library name of the given basename.
 167                  shlibext
 168                      Print the shared library extension (e.g., 'so').
 169 krisbash 1.4     openssllibdir
 170                      Print the directory containing the OpenSSL library
 171                  ldlibrarypath
 172                      Print the name of the dynamic library path variable, usually LD_LIBRARY_PATH or SHLIB_PATH
 173 mike     1.1 EOF
 174                  exit 0
 175              fi
 176              
 177              ##==============================================================================
 178              ##
 179              ## Check arguments
 180              ##
 181              ##==============================================================================
 182              
 183              if [ "$argc" = "0" ]; then
 184                  echo "Usage: $0 [COMMAND] [ARGUMENTS] [OPTIONS]"
 185                  echo "Try --help for help"
 186                  exit 1
 187              fi
 188              
 189              ##==============================================================================
 190              ##
 191              ## Get the platform ID and reject unknown platforms:
 192              ##
 193              ##==============================================================================
 194 mike     1.1 
 195 krisbash 1.4 if [ -z "$target" ]; then
 196 mike     1.1 
 197                  __m=`uname -m 2>/dev/null` || __m=unknown
 198                  __s=`uname -s 2>/dev/null`  || __s=unknown
 199                  __r=`uname -r 2>/dev/null` || __r=unknown
 200                  __v=`uname -v 2>/dev/null` || __v=unknown
 201              
 202                  case "$__m:$__s:$__r:$__v" in
 203                      i686:Linux:*:*)
 204                          os=LINUX
 205                          arch=IX86
 206                          compiler=GNU
 207                          ;;
 208                      x86_64:Linux:*:*)
 209                          os=LINUX
 210                          arch=X86_64
 211                          compiler=GNU
 212                          ;;
 213                      sun4*:SunOS:*:*)
 214                          os=SUNOS
 215                          arch=SPARC
 216                          compiler=SUNPRO
 217 mike     1.1             ;;
 218                      i86pc:SunOS:*:*)
 219                          os=SUNOS
 220                          arch=I86PC
 221                          compiler=SUNPRO
 222                          ;;
 223                      *:AIX:*:*)
 224                          os=AIX
 225                          arch=PPC
 226                          compiler=IBM
 227                          ;;
 228                      ia64:HP-UX:*:*)
 229                          os=HPUX
 230                          arch=IA64
 231                          compiler=HP
 232                          ;;
 233                      9000/800:HP-UX:*:*)
 234                          os=HPUX
 235                          arch=PARISC
 236                          compiler=HP
 237                          ;;
 238 mike     1.1 
 239                      i386:Darwin:*:Darwin* | x86_64:Darwin:*:Darwin*)
 240                          os=DARWIN
 241                          arch=IX86
 242                          compiler=GNU
 243                          ;;
 244                      *)
 245                          echo "$0: error: unsupported platform: $__m:$__s:$__r:$__v"
 246                          exit 1
 247                          ;;
 248                  esac
 249                  platform=$os"_"$arch"_"$compiler
 250              else
 251 krisbash 1.4     platform=$target
 252 mike     1.1 fi
 253              
 254              case "$platform" in
 255                  LINUX_IX86_GNU|LINUX_X86_64_GNU)
 256                      ;;
 257                  MONTAVISTA_IX86_GNU)
 258                      ;;
 259 krisbash 1.4     NETBSD_IX86_GNU)
 260                      ;;
 261 mike     1.1     SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
 262                      ;;
 263                  AIX_PPC_IBM)
 264                      ;;
 265                  HPUX_IA64_HP|HPUX_PARISC_HP)
 266                      ;;
 267                  DARWIN_IX86_GNU)
 268                      ;;
 269                  *)
 270                      echo "$0: error: unsupported platform: $platform"
 271                      exit 1
 272                      ;;
 273              esac
 274              
 275              ##==============================================================================
 276              ##
 277              ## platform command:
 278              ##
 279              ##==============================================================================
 280              
 281              if [ "$arg1" = "platform" ]; then
 282 mike     1.1 
 283                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 284                      echo "Usage: $0 $arg1"
 285                      echo
 286                      exit 1
 287                  fi
 288              
 289                  echo $platform
 290                  exit
 291              fi
 292              
 293              ##==============================================================================
 294              ##
 295              ## os command:
 296              ##
 297              ##==============================================================================
 298              
 299              if [ "$arg1" = "os" ]; then
 300              
 301                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 302                      echo "Usage: $0 $arg1"
 303 mike     1.1         echo
 304                      exit 1
 305                  fi
 306              
 307 krisbash 1.4     case "$platform" in
 308                      MONTAVISTA*)
 309                          os=LINUX
 310                          ;;
 311                      NETBSD*)
 312                          os=BSD
 313                          ;;
 314                  esac
 315              
 316 mike     1.1     echo $os
 317                  exit
 318              fi
 319              
 320              ##==============================================================================
 321              ##
 322              ## hostname command:
 323              ##
 324              ##==============================================================================
 325              
 326              if [ "$arg1" = "hostname" ]; then
 327              
 328                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 329                      echo "Usage: $0 $arg1"
 330                      echo
 331                      exit 1
 332                  fi
 333              
 334                  if [ "$os" = "DARWIN" ] ; then 
 335                      hostname -s
 336                  else
 337 mike     1.1         hostname
 338                  fi
 339                  exit
 340              fi
 341              
 342              ##==============================================================================
 343              ##
 344              ## longhostname command:
 345              ##
 346              ##==============================================================================
 347              
 348              if [ "$arg1" = "longhostname" ]; then
 349              
 350                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 351                      echo "Usage: $0 $arg1"
 352                      echo
 353                      exit 1
 354                  fi
 355              
 356                  case "$platform" in
 357              
 358 mike     1.1         LINUX*)
 359 mike     1.2             ##
 360                          ## First try hostname -f (this will fail on some Linux systems)
 361                          ##
 362                          hn=`hostname -f 2> /dev/null`
 363                          if [ "$?" = "0" ]; then
 364                              echo $hn
 365                          else
 366                              hostname
 367                          fi
 368 mike     1.1             ;;
 369                      MONTAVISTA*)
 370                          hostname
 371                          ;;
 372 krisbash 1.4         NETBSD*)
 373                          hostname
 374                          ;;
 375 mike     1.1         DARWIN*)
 376                          hostname
 377                          ;;
 378                      *)
 379              	    ##
 380              	    ## Attempt to obtain domain name from /etc/resolve.conf
 381              	    ##
 382                          if [ -f "/etc/resolv.conf" ]; then
 383                            domain=`cat /etc/resolv.conf | grep '^domain' | awk '{print $2}'`
 384              
 385                            if [ -n "$domain" ]; then
 386                              echo `hostname`.$domain
 387                              exit 0
 388                            fi
 389                          fi
 390              
 391              	    ##
 392              	    ## Attempt to obtain long hostname with 'nslookup' command
 393              	    ##
 394                          if [ -n "`which nslookup`" ]; then
 395              		host=`hostname`
 396 mike     1.1 		lhs=`nslookup $host | grep '^Name:' | awk '{print $2}' | grep $host`
 397              		if [ -n "$lhs" ]; then
 398              		    echo $lhs
 399              		    exit 0
 400              		fi
 401              	    fi
 402              
 403              	    ##
 404              	    ## Just print host hostname:
 405              	    ##
 406                          hostname
 407                          ;;
 408                  esac
 409              
 410                  exit
 411              fi
 412              
 413              ##==============================================================================
 414              ##
 415              ## username command:
 416              ##
 417 mike     1.1 ##==============================================================================
 418              
 419              if [ "$arg1" = "username" ]; then
 420              
 421                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 422                      echo "Usage: $0 $arg1"
 423                      echo
 424                      exit 1
 425                  fi
 426              
 427                  case "$platform" in
 428              
 429                      *)
 430                          id | cut -f2 -d'(' | cut -f1 -d')'
 431                          ;;
 432                  esac
 433              
 434                  exit
 435              fi
 436              
 437              ##==============================================================================
 438 mike     1.1 ##
 439              ## arch command:
 440              ##
 441              ##==============================================================================
 442              
 443              if [ "$arg1" = "arch" ]; then
 444              
 445                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 446                      echo "Usage: $0 $arg1"
 447                      echo
 448                      exit 1
 449                  fi
 450              
 451 krisbash 1.4     case "$platform" in
 452                      MONTAVISTA*)
 453                          arch=IX86
 454                          ;;
 455                      NETBSD*)
 456                          arch=IX86
 457                          ;;
 458                  esac
 459              
 460 mike     1.1     echo $arch
 461                  exit
 462              fi
 463              
 464              ##==============================================================================
 465              ##
 466              ## compiler command:
 467              ##
 468              ##==============================================================================
 469              
 470              if [ "$arg1" = "compiler" ]; then
 471              
 472                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 473                      echo "Usage: $0 $arg1"
 474                      echo
 475                      exit 1
 476                  fi
 477              
 478 krisbash 1.4     case "$platform" in
 479                      MONTAVISTA*)
 480                          compiler=GNU
 481                          ;;
 482                      NETBSD*)
 483                          compiler=GNU
 484                          ;;
 485                  esac
 486              
 487 mike     1.1     echo $compiler
 488                  exit
 489              fi
 490              
 491              ##==============================================================================
 492              ##
 493              ## cc command:
 494              ##
 495              ##==============================================================================
 496              
 497              if [ "$arg1" = "cc" ]; then
 498              
 499                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 500                      echo "Usage: $0 $arg1"
 501                      echo
 502                      exit 1
 503                  fi
 504              
 505                  case "$platform" in
 506              
 507                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
 508 mike     1.1             echo gcc
 509                          ;;
 510                      MONTAVISTA_IX86_GNU)
 511                          echo 586-gcc
 512                          ;;
 513 krisbash 1.4         NETBSD_IX86_GNU)
 514                          echo netbsd-gcc
 515                          ;;
 516 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
 517                          echo cc
 518                          ;;
 519                      AIX_PPC_IBM)
 520                          echo xlc_r
 521                          ;;
 522                      HPUX_IA64_HP|HPUX_PARISC_HP)
 523                          echo aCC -Ae
 524                          ;;
 525                      DARWIN_IX86_GNU)
 526                          echo gcc
 527                          ;;
 528                  esac
 529              
 530                  exit
 531              fi
 532              
 533              ##==============================================================================
 534              ##
 535              ## cxx command:
 536              ##
 537 mike     1.1 ##==============================================================================
 538              
 539              if [ "$arg1" = "cxx" ]; then
 540              
 541                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 542                      echo "Usage: $0 $arg1"
 543                      echo
 544                      exit 1
 545                  fi
 546              
 547                  case "$platform" in
 548                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
 549                          echo g++
 550                          ;;
 551                      MONTAVISTA_IX86_GNU)
 552                          echo 586-g++
 553                          ;;
 554 krisbash 1.4         NETBSD_IX86_GNU)
 555                          echo netbsd-g++
 556                          ;;
 557 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
 558                          echo CC
 559                          ;;
 560                      AIX_PPC_IBM)
 561 krisbash 1.4             echo xlC_r 
 562 mike     1.1             ;;
 563                      HPUX_IA64_HP|HPUX_PARISC_HP)
 564                          echo aCC -AA
 565                          ;;
 566                      DARWIN_IX86_GNU)
 567                          echo g++
 568                          ;;
 569                  esac
 570              
 571                  exit
 572              fi
 573              
 574              ##==============================================================================
 575              ##
 576 krisbash 1.4 ## ar command:
 577              ##
 578              ##==============================================================================
 579              
 580              if [ "$arg1" = "ar" ]; then
 581              
 582                  if [ "$argc" != "1" -o "$opts" != "" ]; then
 583                      echo "Usage: $0 $arg1"
 584                      echo
 585                      exit 1
 586                  fi
 587              
 588                  case "$platform" in
 589              
 590                      MONTAVISTA_IX86_GNU)
 591                          echo 586-ar
 592                          ;;
 593                      NETBSD_IX86_GNU)
 594                          echo netbsd-ar
 595                          ;;
 596                      *)
 597 krisbash 1.4             echo ar
 598                          ;;
 599                  esac
 600              
 601                  exit
 602              fi
 603              
 604              ##==============================================================================
 605              ##
 606 mike     1.1 ## 'cflags' command:
 607              ## 'cxxflags' command:
 608              ##
 609              ##==============================================================================
 610              
 611              if [ "$arg1" = "cflags" -o "$arg1" = "cxxflags" ]; then
 612              
 613                  if [ "$argc" != "1" ]; then
 614                      echo "Usage: $0 $arg1"
 615                      echo
 616                      exit 1
 617                  fi
 618              
 619                  if [ "$arg1" = "cflags" ]; then
 620                      c_opt=1
 621                  else
 622                      cxx_opt=1
 623                  fi
 624              
 625                  for opt in $opts
 626                  do
 627 mike     1.1         case $opt in
 628                          --debug)
 629                              debug_opt=1
 630                              ;;
 631                          --pic)
 632                              pic_opt=1
 633                              ;;
 634                          --errwarn)
 635                              errwarn_opt=1
 636                              ;;
 637 krisbash 1.4             --size)
 638                              size_opt=1
 639                              ;;
 640                          --pal)
 641                              pal_opt=1
 642                              ;;
 643 mike     1.1             *)
 644                              echo "$arg1: unknown option: $opt"
 645                              exit 1
 646                              ;;
 647                      esac
 648                  done
 649              
 650                  r=""
 651              
 652                  case "$platform" in
 653 krisbash 1.4         LINUX_IX86_GNU|LINUX_X86_64_GNU|MONTAVISTA_IX86_GNU|NETBSD_IX86_GNU)
 654              
 655                          if test -n "$debug_opt"; then
 656                              r="$r -g"
 657                          else
 658                              if test -n "$size_opt"; then
 659                                  r="$r -Os"
 660                              else
 661                                  r="$r -g -O2"
 662                              fi
 663                          fi
 664              
 665 mike     1.1             test -n "$pic_opt" && r="$r -fPIC"
 666                          test -n "$errwarn_opt" && r="$r -Werror"
 667                          r="$r -Wall"
 668                          r="$r -fvisibility=hidden"
 669 krisbash 1.4             r="$r -fno-strict-aliasing"
 670                          r="$r -D_GNU_SOURCE"
 671                          r="$r -D_XOPEN_SOURCE=600"
 672                          r="$r -D_BSD_SOURCE"
 673              
 674 mike     1.1             #test -n "$cxx_opt" && r="$r -fno-exceptions"
 675                          #test -n "$cxx_opt" && r="$r -fno-enforce-eh-specs"
 676                          #test -n "$cxx_opt" && r="$r -fno-rtti"
 677                          ;;
 678                      SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
 679              
 680                          ## Debugger options.
 681                          test -n "$debug_opt" && r="$r -g"
 682              
 683                          ## Optimization options.
 684                          if test -z "$debug_opt"; then
 685                              test -n "$c_opt" && r="$r -g"
 686                              test -n "$cxx_opt" && r="$r -g -O"
 687                          fi
 688              
 689                          ## Generate position independent code (PIC).
 690                          test -n "$pic_opt" && r="$r -KPIC"
 691              
 692                          ## treat warnings as errors.
 693                          test -n "$errwarn_opt" && r="$r -errwarn"
 694              
 695 mike     1.1             ## multi-threaded support.
 696                          r="$r -mt"
 697              
 698                          ## avoid optimizations that increase object code size.
 699                          r="$r -xspace"
 700              
 701                          ## specify target system.
 702                          r="$r -xtarget=generic"
 703              
 704                          ## specify target architecture.
 705                          r="$r -xarch=generic"
 706              
 707 krisbash 1.4             ## hide all library symbols by default.            
 708                          test -z "$pal_opt" && r="$r -xldscope=hidden"
 709                          test -n "$pal_opt" && r="$r -xldscope=symbolic"
 710 mike     1.1 
 711                          ## display brief message tag for each warning message.
 712                          r="$r -errtags=yes"
 713              
 714                          ## use standar pthread funciton declarations
 715                          r="$r -D_POSIX_PTHREAD_SEMANTICS"
 716              
 717 krisbash 1.4             r="$r -D_XOPEN_SOURCE=500"
 718              
 719                          r="$r -D__EXTENSIONS__"
 720              
 721 mike     1.1             ## suppress all warning messages.
 722                          #r="$r -erroff=%all"
 723              
 724                          ## suppress this warning message.
 725                          test -n "$c_opt" && r="$r -erroff=E_WHITE_SPACE_IN_DIRECTIVE"
 726 krisbash 1.4             
 727 mike     1.1             ;;
 728                      AIX_PPC_IBM)
 729                          test -n "$debug_opt" && r="$r -g"
 730                          test -n "$debug_opt" && r="$r -qcheck"
 731                          test -z "$debug_opt" && r="$r -O2"
 732                          test -z "$debug_opt" && r="$r -qcompact"
 733                          test -n "$pic_opt" && r="$r -qpic"
 734                          r="$r -q32"
 735                          r="$r -Daix"
 736              
 737                          ;;
 738                      HPUX_IA64_HP)
 739                          test -n "$debug_opt" && r="$r -g"
 740                          test -z "$debug_opt" && r="$r -s +O1"
 741                          r="$r +DD32"
 742                          r="$r -mt"
 743                          r="$r +Z"
 744                          r="$r -Dhpux"
 745                          r="$r +W4232"
 746                          r="$r +W4275"
 747 krisbash 1.4             r="$r -D_XOPEN_SOURCE=500"
 748 mike     1.1             r="$r -D__STDC_EXT__"
 749                          ;;
 750                      HPUX_PARISC_HP)
 751                          test -n "$debug_opt" && r="$r -g +noobjdebug"
 752                          test -z "$debug_opt" && r="$r +O2 -s"
 753                          r="$r +Z"
 754                          r="$r +DAportable"
 755                          r="$r -mt"
 756 krisbash 1.4             r="$r -Dhpux"
 757 mike     1.1             r="$r -D_PSTAT64"
 758                          r="$r +W749"
 759                          r="$r +W740"
 760                          r="$r -Wl,+s"
 761 krisbash 1.4             r="$r -D_INCLUDE__STDC_A1_SOURCE"
 762 mike     1.1             r="$r -D__STDC_EXT__"
 763                          r="$r -D_XOPEN_SOURCE_EXTENDED"
 764                          ;;
 765                      DARWIN_IX86_GNU)
 766                          test -n "$debug_opt" && r="$r -g"
 767                          test -z "$debug_opt" && r="$r -g -O2"
 768                          test -n "$pic_opt" && r="$r -fPIC"
 769                          test -n "$errwarn_opt" && r="$r -Werror"
 770                          r="$r -Wall"
 771                          r="$r -fvisibility=hidden"
 772                          r="$r -bind_at_load"
 773                          ;;
 774                  esac
 775              
 776                  echo $r
 777                  exit
 778              fi
 779              
 780              ##==============================================================================
 781              ##
 782              ## 'cshlibflags' command:
 783 mike     1.1 ## 'cxxshlibflags' command:
 784              ##
 785              ##==============================================================================
 786              
 787              if [ "$arg1" = "cshlibflags" -o "$arg1" = "cxxshlibflags" ]; then
 788              
 789                  if [ "$argc" != "1" ]; then
 790                      echo "Usage: $0 $arg1"
 791                      echo
 792                      exit 1
 793                  fi
 794              
 795                  if [ "$arg1" = "cshlibflags" ]; then
 796                      c_opt=1
 797                  else
 798                      cxx_opt=1
 799                  fi
 800              
 801                  for opt in $opts
 802                  do
 803                      arg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
 804 mike     1.1         case $opt in
 805                          --libpath=*)
 806                              libpath_opt=$arg
 807                              ;;
 808 krisbash 1.4             --pal)
 809                              palshlib_opt=1
 810                              ;;
 811 mike     1.1             *)
 812                              echo "$arg1: unknown option: $opt"
 813                              exit 1
 814                              ;;
 815                      esac
 816                  done
 817              
 818                  r=""
 819              
 820                  case "$platform" in
 821                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
 822                          r="$r -shared"
 823                          test -n "$libpath_opt" && r="$r -Wl,-rpath=$libpath_opt"
 824                          ;;
 825                      MONTAVISTA_IX86_GNU)
 826                          r="$r -shared"
 827                          test -n "$libpath_opt" && r="$r -Wl,-rpath=$libpath_opt"
 828                          ;;
 829 krisbash 1.4         NETBSD_IX86_GNU)
 830                          r="$r -shared"
 831                          test -n "$libpath_opt" && r="$r -Wl,-rpath=$libpath_opt"
 832                          ;;
 833 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
 834              
 835                          ## multi-threaded support.
 836                          r="$r -mt"
 837              
 838                          ## ignore the LD_LIBRARY_PATH variable when linking.
 839                          r="$r -i"
 840              
 841                          ## Build a dynamic shared library (rather than executable file).
 842                          r="$r -G"
 843              
 844                          ## Generate position independent code (PIC).
 845                          r="$r -KPIC"
 846              
 847                          ## Link with the standard C++ library.
 848                          test -n "$cxx_opt" && r="$r -lCstd"
 849              
 850                          ## link time library contains 'nanosleep'
 851                          r="$r -lrt"
 852              
 853                          ## hide all library symbols by default.
 854 krisbash 1.4             test -z "$palshlib_opt" && r="$r -xldscope=hidden"
 855                          test -n "$palshlib_opt" && r="$r -xldscope=symbolic"
 856 mike     1.1 
 857                          ## Add libpath_opt to the dynamic library path.
 858                          test -n "$libpath_opt" && r="$r -R:$libpath_opt"
 859              
 860                          ;;
 861                      AIX_PPC_IBM)
 862                          r="$r -brtl"
 863                          r="$r -G"
 864                          r="$r -qmkshrobj"
 865                          r="$r -q32"
 866                          if [ -n "$libpath_opt" ]; then
 867                              r="$r -blibpath:$libpath_opt:/usr/lib:/lib"
 868                          else
 869                              r="$r -blibpath:/usr/lib:/lib"
 870                          fi
 871                          r="$r -bnolibpath"
 872                          r="$r -Wl,-bnoautoexp"
 873                          r="$r -Wl,-bnoexpall"
 874                          ;;
 875                      HPUX_IA64_HP)
 876                          r="$r +DD32"
 877 mike     1.1             r="$r -mt"
 878                          r="$r +Z -Dhpux"
 879                          r="$r +W4232"
 880                          r="$r +W4275" 
 881                          r="$r -D_XOPEN_SOURCE=600"
 882                          r="$r -D__STDC_EXT__"
 883                          r="$r -lc"
 884 krisbash 1.4             r="$r -lrt"
 885 mike     1.1             r="$r -b"
 886 krisbash 1.4             r="$r -Wl,-Bsymbolic"
 887 mike     1.1             test -n "$libpath_opt" && r="$r +b $libpath_opt"
 888                          test -n "$cxx_opt" && r="$r -lunwind"
 889                          test -n "$cxx_opt" && r="$r -lCsup"
 890                          ;;
 891                      HPUX_PARISC_HP)
 892                          r="$r -b"
 893 krisbash 1.4             r="$r -lrt"
 894 mike     1.1             r="$r -Wl,-Bsymbolic"
 895                          r="$r -Wl,+s"
 896                          ;;
 897                      DARWIN_IX86_GNU)
 898                          r="$r -dynamiclib"
 899                          test -n "$libpath_opt" && r="$r -R$libpath_opt"
 900                          r="$r -bind_at_load"
 901                          ;;
 902                  esac
 903              
 904                  echo $r
 905                  exit
 906              fi
 907              
 908              ##==============================================================================
 909              ##
 910              ## 'cprogflags' command:
 911              ## 'cxxprogflags' command:
 912              ##
 913              ##==============================================================================
 914              
 915 mike     1.1 if [ "$arg1" = "cprogflags" -o "$arg1" = "cxxprogflags" ]; then
 916              
 917                  if [ "$argc" != "1" ]; then
 918                      echo "Usage: $0 $arg1"
 919                      echo
 920                      exit 1
 921                  fi
 922              
 923                  if [ "$arg1" = "cprogflags" ]; then
 924                      c_opt=1
 925                  else
 926                      cxx_opt=1
 927                  fi
 928              
 929                  for opt in $opts
 930                  do
 931                      arg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
 932                      case $opt in
 933                          --libpath=*)
 934                              libpath_opt=$arg
 935                              ;;
 936 mike     1.1             *)
 937                              echo "$arg1: unknown option: $opt"
 938                              exit 1
 939                              ;;
 940                      esac
 941                  done
 942              
 943                  r=""
 944              
 945                  case "$platform" in
 946                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
 947                          test -n "$libpath_opt" && r="$r -Wl,-rpath=$libpath_opt"
 948                          ;;
 949                      MONTAVISTA_IX86_GNU)
 950                          test -n "$libpath_opt" && r="$r -Wl,-rpath=$libpath_opt"
 951                          ;;
 952 krisbash 1.4         NETBSD_IX86_GNU)
 953                          test -n "$libpath_opt" && r="$r -Wl,-rpath=$libpath_opt"
 954                          ;;
 955 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
 956              
 957                          ## multi-threaded support.
 958                          r="$r -mt"
 959              
 960                          ## ignore the LD_LIBRARY_PATH variable when linking.
 961                          r="$r -i"
 962              
 963                          ## link time library contains 'nanosleep'
 964                          r="$r -lrt"
 965              
 966                          ## hide all library symbols by default.
 967                          r="$r -xldscope=hidden"
 968              
 969                          ## Add libpath_opt to the dynamic library path.
 970                          test -n "$libpath_opt" && r="$r -R:$libpath_opt"
 971              
 972                          ;;
 973              
 974                      AIX_PPC_IBM)
 975                          r="$r -brtl"
 976 mike     1.1             r="$r -q32"
 977                          r="$r -qrtti=dyna"
 978                          r="$r -qcpluscmt"
 979                          if [ -n "$libpath_opt" ]; then
 980                              r="$r -blibpath:$libpath_opt:/usr/lib:/lib"
 981                          else
 982                              r="$r -blibpath:/usr/lib:/lib"
 983                          fi
 984                          ;;
 985                      HPUX_IA64_HP)
 986                          r="$r +DD32"
 987                          r="$r -mt"
 988                          r="$r +Z -Dhpux"
 989                          r="$r +W4232"
 990                          r="$r +W4275" 
 991                          r="$r -D_XOPEN_SOURCE=600"
 992                          r="$r -D__STDC_EXT__"
 993 krisbash 1.4             r="$r -lrt"
 994                          r="$r -Wl,-Bsymbolic"
 995 mike     1.1             test -n "$libpath_opt" && r="$r +b $libpath_opt"
 996                          ;;
 997                      HPUX_PARISC_HP)
 998                          r="$r +Z"
 999                          r="$r +DAportable"
1000                          r="$r -mt"
1001 krisbash 1.4             r="$r -lrt"
1002 mike     1.1             r="$r -D_PSTAT64"
1003                          ;;
1004                      DARWIN_IX86_GNU)
1005                          test -n "$libpath_opt" && r="$r -R$libpath_opt"
1006                          r="$r -bind_at_load"
1007                          ;;
1008                  esac
1009              
1010                  echo $r
1011                  exit
1012              fi
1013              
1014              ##==============================================================================
1015              ##
1016              ## mkdep command:
1017              ##
1018              ##==============================================================================
1019              
1020              if [ "$arg1" = "mkdep" ]; then
1021              
1022                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1023 mike     1.1         echo "Usage: $0 $arg1"
1024                      echo
1025                      exit 1
1026                  fi
1027              
1028                  r=""
1029              
1030                  case "$platform" in
1031                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
1032                          r="gcc -M"
1033                          ;;
1034                      MONTAVISTA_IX86_GNU)
1035                          r="586-gcc -M"
1036                          ;;
1037 krisbash 1.4         NETBSD_IX86_GNU)
1038                          r="gcc -M"
1039                          ;;
1040 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
1041                          r="CC -xM1"
1042                          ;;
1043                      AIX_PPC_IBM)
1044                          r="xlc++_r -E -qmakedep=gcc"
1045                          ;;
1046                      HPUX_IA64_HP|HPUX_PARISC_HP)
1047                          r="aCC +make -E"
1048                          ;;
1049                      DARWIN_IX86_GNU)
1050                          r="gcc -M"
1051                          ;;
1052                  esac
1053              
1054                  echo "$r"
1055                  exit
1056              fi
1057              
1058              ##==============================================================================
1059              ##
1060              ## syslibs command:
1061 mike     1.1 ##
1062              ##==============================================================================
1063              
1064              if [ "$arg1" = "syslibs" ]; then
1065              
1066                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1067                      echo "Usage: $0 $arg1"
1068                      echo
1069                      exit 1
1070                  fi
1071              
1072                  r=""
1073              
1074                  case "$platform" in
1075                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
1076                          r="-lpthread -ldl -lpam"
1077                          ;;
1078                      MONTAVISTA_IX86_GNU)
1079                          r="-lpthread -ldl -lpam"
1080                          ;;
1081 krisbash 1.4         NETBSD_IX86_GNU)
1082                          r="-lpthread -ldl -lpam"
1083                          ;;
1084 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
1085                          r="-lpthread -lsocket -lnsl -ldl -lpam"
1086                          ;;
1087                      AIX_PPC_IBM)
1088                          r="-lpthread -ldl -lpam"
1089                          ;;
1090                      HPUX_IA64_HP)
1091                          r="-lpthread -ldl -lpam"
1092                          ;;
1093                      HPUX_PARISC_HP)
1094                          r="-lpthread -lpam"
1095                          ;;
1096                      DARWIN_IX86_GNU)
1097                          r="-lpthread -ldl -lpam"
1098                          ;;
1099                  esac
1100              
1101                  echo "$r"
1102                  exit
1103              fi
1104              
1105 mike     1.1 ##==============================================================================
1106              ##
1107              ## libpath command:
1108              ##
1109              ##==============================================================================
1110              
1111              if [ "$arg1" = "libpath" ]; then
1112              
1113                  if [ "$argc" -lt "2" -o "$opts" != "" ]; then
1114                      echo "Usage: $0 $arg1 PATH"
1115                      echo
1116                      exit 1
1117                  fi
1118              
1119                  r=""
1120                  args="$arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9"
1121              
1122                  case "$platform" in
1123                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
1124                          for path in $args
1125                          do
1126 mike     1.1                 r="$r -Wl,-rpath=$path"
1127                          done
1128                          ;;
1129                      MONTAVISTA_IX86_GNU)
1130                          for path in $args
1131                          do
1132                              r="$r -Wl,-rpath=$path"
1133                          done
1134                          ;;
1135 krisbash 1.4         NETBSD_IX86_GNU)
1136                          for path in $args
1137                          do
1138                              r="$r -Wl,-rpath=$path"
1139                          done
1140                          ;;
1141 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
1142                          for path in $args
1143                          do
1144                              r="$r -R:$path"
1145                          done
1146                          ;;
1147                      AIX_PPC_IBM)
1148                          r="-blibpath:/usr/lib:/lib"
1149                          for path in $args
1150                          do
1151                              r="$r:$path"
1152                          done
1153                          ;;
1154                      HPUX_IA64_HP)
1155                          r="-Wl,+b,"
1156                          first=1
1157                          for path in $args
1158                          do
1159                              if [ -n "$first" ]; then
1160                                 r="$r$path"
1161                                 first=""
1162 mike     1.1                 else
1163                                 r="$r:$path"
1164                              fi
1165                          done
1166                          ;;
1167                      HPUX_PARISC_HP)
1168                          #r="-Wl,+cdp,"
1169                          r="-Wl,+b,"
1170                          first=1
1171                          for path in $args
1172                          do
1173                              if [ -n "$first" ]; then
1174                                 r="$r$path"
1175                                 first=""
1176                              else
1177                                 r="$r:$path"
1178                              fi
1179                          done
1180                          ;;
1181                      DARWIN_IX86_GNU)
1182                          for path in $args
1183 mike     1.1             do
1184                              r="$r -R$path"
1185                          done
1186                          ;;
1187                  esac
1188              
1189                  echo "$r"
1190                  exit
1191              fi
1192              
1193              ##==============================================================================
1194              ##
1195              ## libname command:
1196              ##
1197              ##==============================================================================
1198              
1199              if [ "$arg1" = "libname" ]; then
1200              
1201                  if [ "$argc" -lt "2" -o "$opts" != "" ]; then
1202                      echo "Usage: $0 $arg1 PATH"
1203                      echo
1204 mike     1.1         exit 1
1205                  fi
1206              
1207                  r=""
1208              
1209                  case "$platform" in
1210                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
1211                          ;;
1212                      MONTAVISTA_IX86_GNU)
1213                          ;;
1214 krisbash 1.4         NETBSD_IX86_GNU)
1215                          ;;
1216 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
1217                          ;;
1218                      AIX_PPC_IBM)
1219                          ;;
1220                      HPUX_IA64_HP)
1221                          ;;
1222                      HPUX_PARISC_HP)
1223                          ;;
1224                      DARWIN_IX86_GNU)
1225                          r="$r -Wl,-install_name -Wl,$arg2"
1226                          ;;
1227                  esac
1228              
1229                  echo "$r"
1230                  exit
1231              fi
1232              
1233              ##==============================================================================
1234              ##
1235              ## 'shlibname' command:
1236              ##
1237 mike     1.1 ##==============================================================================
1238              
1239              if [ "$arg1" = "shlibname" ]; then
1240              
1241                  if [ "$argc" != "2" -o "$opts" != "" ]; then
1242                      echo "Usage: $0 $arg1 LIBBASENAME"
1243                      echo
1244                      exit 1
1245                  fi
1246              
1247                  case "$platform" in
1248                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
1249                          echo "lib$arg2.so"
1250                          ;;
1251                      MONTAVISTA_IX86_GNU)
1252                          echo "lib$arg2.so"
1253                          ;;
1254 krisbash 1.4         NETBSD_IX86_GNU)
1255                          echo "lib$arg2.so"
1256                          ;;
1257 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
1258                          echo "lib$arg2.so"
1259                          ;;
1260                      AIX_PPC_IBM)
1261                          echo "lib$arg2.so"
1262                          ;;
1263                      HPUX_IA64_HP)
1264                          echo "lib$arg2.so"
1265                          ;;
1266                      HPUX_PARISC_HP)
1267                          echo "lib$arg2.sl"
1268                          ;;
1269                      DARWIN_IX86_GNU)
1270                          echo "lib$arg2.dylib"
1271                          ;;
1272                  esac
1273              
1274                  exit
1275              fi
1276              
1277              ##==============================================================================
1278 mike     1.1 ##
1279              ## 'shlibext' command:
1280              ##
1281              ##==============================================================================
1282              
1283              if [ "$arg1" = "shlibext" ]; then
1284              
1285                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1286                      echo "Usage: $0 $arg1"
1287                      echo
1288                      exit 1
1289                  fi
1290              
1291                  case "$platform" in
1292                      LINUX_IX86_GNU|LINUX_X86_64_GNU)
1293                          echo "so"
1294                          ;;
1295                      MONTAVISTA_IX86_GNU)
1296                          echo "so"
1297                          ;;
1298 krisbash 1.4         NETBSD_IX86_GNU)
1299                          echo "so"
1300                          ;;
1301 mike     1.1         SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO)
1302                          echo "so"
1303                          ;;
1304                      AIX_PPC_IBM)
1305                          echo "so"
1306                          ;;
1307                      HPUX_IA64_HP)
1308                          echo "so"
1309                          ;;
1310                      HPUX_PARISC_HP)
1311                          echo "sl"
1312                          ;;
1313                      DARWIN_IX86_GNU)
1314                          echo "dylib"
1315                          ;;
1316                      *)
1317                          echo "so"
1318                  esac
1319              
1320                  exit
1321              fi
1322 mike     1.1 
1323              ##==============================================================================
1324              ##
1325              ## 'openssllibdir' command:
1326              ##
1327              ##==============================================================================
1328              
1329              if [ "$arg1" = "openssllibdir" ]; then
1330              
1331                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1332                      echo "Usage: $0 $arg1"
1333                      echo
1334                      exit 1
1335                  fi
1336              
1337                  ##
1338                  ## (1) Locate libdir with pkg-config.
1339                  ##
1340              
1341                  pkgconfig=`which pkg-config 2> /dev/null`
1342              
1343 mike     1.1     if [ -x "$pkgconfig" ]; then
1344                      libdir=`$pkgconfig --variable=libdir openssl`
1345                  fi
1346              
1347                  ##
1348                  ## (2) Locate libdir relative to openssl program.
1349                  ##
1350              
1351                  if [ -z "$libdir" ]; then
1352                      openssl=`which openssl 2> /dev/null`
1353              
1354                      if [ -x "$openssl" ]; then
1355                          case "$platform" in
1356                              HPUX_PARISC_HP)
1357                                  shlibext="sl"
1358                                  ;;
1359                              DARWIN_IX86_GNU)
1360                                  shlibext="dylib"
1361                                  ;;
1362                              *)
1363                                  shlibext="so"
1364 mike     1.1                     ;;
1365                          esac
1366                          dirname=`dirname $openssl`/..
1367                          if [ -d "$dirname" ]; then
1368                              dirname=`cd "$dirname"; pwd`
1369                              if [ -f "$dirname/lib/libssl.$shlibext" ]; then
1370                                  libdir=$dirname/lib
1371                              elif [ -f "$dirname/ssl/lib/libssl.$shlibext" ]; then
1372                                  libdir=$dirname/ssl/lib
1373                              fi
1374                          fi
1375                      fi
1376                  fi
1377              
1378                  ##
1379                  ## (3) Locate libdir based on platform identifier.
1380                  ##
1381              
1382                  if [ -z "$libdir" ]; then
1383                      case "$platform" in
1384                          LINUX_IX86_GNU|LINUX_X86_64_GNU)
1385 mike     1.1                 if [ -f "/usr/lib/libssl.so" ]; then
1386                                  libdir=/usr/lib
1387                              fi
1388                              ;;
1389                          SUNOS_I86PC_SUNPRO)
1390                              if [ -f "/usr/sfw/lib/libssl.so" ]; then
1391                                  libdir=/usr/sfw/lib
1392                              fi
1393                              ;;
1394                          SUNOS_SPARC_SUNPRO)
1395                              if [ -f "/usr/local/ssl/lib/libssl.so" ]; then
1396                                  libdir=/usr/local/ssl/lib
1397                              fi
1398                              ;;
1399                          AIX_PPC_IBM)
1400                              if [ -f "/usr/lib/libssl.sl" ]; then
1401                                  libdir=/usr/lib
1402                              fi
1403                              ;;
1404                          HPUX_IA64_HP)
1405                              if [ -f "/opt/openssl/lib/libssl.sl" ]; then
1406 mike     1.1                     libdir=/opt/openssl/lib
1407                              fi
1408                              ;;
1409                          HPUX_PARISC_HP)
1410                              if [ -f "/usr/local/lib/libssl.sl" ]; then
1411                                  libdir=/usr/local/lib
1412                              fi
1413                              ;;
1414                          DARWIN_IX86_GNU)
1415                              if [ -f "/usr/lib/libssl.dylib" ]; then
1416                                  libdir=/usr/lib
1417                              fi
1418                              ;;
1419                          *)
1420                              echo "so"
1421                      esac
1422                  fi
1423              
1424                  echo "$libdir"
1425                  exit
1426              
1427 mike     1.1 fi
1428              
1429              ##==============================================================================
1430              ##
1431              ## 'ldlibrarypath' command:
1432              ##
1433              ##==============================================================================
1434              
1435              if [ "$arg1" = "ldlibrarypath" ]; then
1436              
1437                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1438                      echo "Usage: $0 $arg1"
1439                      echo
1440                      exit 1
1441                  fi
1442              
1443                  case "$platform" in
1444                      HPUX_IA64_HP|HPUX_PARISC_HP)
1445                          echo "SHLIB_PATH"
1446                          ;;
1447                      DARWIN_IX86_GNU)
1448 mike     1.1             echo "DYLD_LIBRARY_PATH"
1449                          ;;
1450                      *)
1451                          echo "LD_LIBRARY_PATH"
1452                  esac
1453              
1454                  exit
1455              fi
1456              
1457              ##==============================================================================
1458              ##
1459 krisbash 1.4 ## 'semnamelocalprefix' command (determine the prefix for a semaphore)
1460              ##
1461              ##==============================================================================
1462              
1463              if [ "$arg1" = "semnamelocalprefix" ]; then
1464              
1465                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1466                      echo "Usage: $0 $arg1"
1467                      echo
1468                      exit 1
1469                  fi
1470              
1471                  case "$platform" in
1472                      HPUX_IA64_HP|HPUX_PARISC_HP)
1473                          echo "/tmp/"
1474                          ;;
1475                      *)
1476                          echo "/"
1477                  esac
1478              
1479                  exit
1480 krisbash 1.4 fi
1481              
1482              ##==============================================================================
1483              ##
1484              ## 'shmnamelocalprefix' command (determine the prefix for a shmaphore)
1485              ##
1486              ##==============================================================================
1487              
1488              if [ "$arg1" = "shmnamelocalprefix" ]; then
1489              
1490                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1491                      echo "Usage: $0 $arg1"
1492                      echo
1493                      exit 1
1494                  fi
1495              
1496                  case "$platform" in
1497                      HPUX_IA64_HP|HPUX_PARISC_HP)
1498                          echo "/tmp/"
1499                          ;;
1500                      *)
1501 krisbash 1.4             echo "/"
1502                  esac
1503              
1504                  exit
1505              fi
1506              
1507              ##==============================================================================
1508              ##
1509              ## 'semnameglobalprefix' command (determine the prefix for a semaphore)
1510              ##
1511              ##==============================================================================
1512              
1513              if [ "$arg1" = "semnameglobalprefix" ]; then
1514              
1515                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1516                      echo "Usage: $0 $arg1"
1517                      echo
1518                      exit 1
1519                  fi
1520              
1521                  case "$platform" in
1522 krisbash 1.4         HPUX_IA64_HP|HPUX_PARISC_HP)
1523                          echo "/tmp/"
1524                          ;;
1525                      *)
1526                          echo "/"
1527                  esac
1528              
1529                  exit
1530              fi
1531              
1532              ##==============================================================================
1533              ##
1534              ## 'shmnameglobalprefix' command (determine the prefix for a shmaphore)
1535              ##
1536              ##==============================================================================
1537              
1538              if [ "$arg1" = "shmnameglobalprefix" ]; then
1539              
1540                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1541                      echo "Usage: $0 $arg1"
1542                      echo
1543 krisbash 1.4         exit 1
1544                  fi
1545              
1546                  case "$platform" in
1547                      HPUX_IA64_HP|HPUX_PARISC_HP)
1548                          echo "/tmp/"
1549                          ;;
1550                      *)
1551                          echo "/"
1552                  esac
1553              
1554                  exit
1555              fi
1556              
1557              ##==============================================================================
1558              ##
1559              ## 'faultinjection' command 
1560              ##     Whether fault injection is supported (1) or not (0)
1561              ##
1562              ##==============================================================================
1563              
1564 krisbash 1.4 if [ "$arg1" = "faultinjection" ]; then
1565              
1566                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1567                      echo "Usage: $0 $arg1"
1568                      echo
1569                      exit 1
1570                  fi
1571              
1572                  case "$os" in
1573                      LINUX)
1574                          # supported!
1575                          echo "1"
1576                          ;;
1577                      *)
1578                          # not-supported!
1579                          echo "0"
1580                  esac
1581              
1582                  exit
1583              fi
1584              
1585 krisbash 1.4 ##==============================================================================
1586              ##
1587              ## 'vsnprintf' command 
1588              ##     Whether vsnprintf return -1 on NULL buffer or not
1589              ##
1590              ##==============================================================================
1591              
1592              if [ "$arg1" = "vsnprintf" ]; then
1593              
1594                  if [ "$argc" != "1" -o "$opts" != "" ]; then
1595                      echo "Usage: $0 $arg1"
1596                      echo
1597                      exit 1
1598                  fi
1599              
1600                  case "$platform" in
1601                      HPUX_IA64_HP|HPUX_PARISC_HP|SUNOS_SPARC_SUNPRO)
1602                          # vsnprintf returns -1 if buffer is NULL
1603                          echo "1"
1604                          ;;
1605                      *)
1606 krisbash 1.4             # vsnprintf returns number of characters that would have been written
1607                          # if buffer is big enough
1608                          echo "0"
1609                  esac
1610              
1611                  exit
1612              fi
1613              
1614              ##==============================================================================
1615              ##
1616 mike     1.1 ## Unknown command:
1617              ##
1618              ##==============================================================================
1619              
1620              echo "$0: unknown command: $arg1"
1621              exit 1

ViewCVS 0.9.2