home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / cxxlink-driver.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1998-04-08  |  2.5 KB  |  102 lines

  1. #!/bin/sh
  2. #
  3. # The contents of this file are subject to the Netscape Public License
  4. # Version 1.0 (the "NPL"); you may not use this file except in
  5. # compliance with the NPL.  You may obtain a copy of the NPL at
  6. # http://www.mozilla.org/NPL/
  7. #
  8. # Software distributed under the NPL is distributed on an "AS IS" basis,
  9. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10. # for the specific language governing rights and limitations under the
  11. # NPL.
  12. #
  13. # The Initial Developer of this code under the NPL is Netscape
  14. # Communications Corporation.  Portions created by Netscape are
  15. # Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16. # Reserved.
  17.  
  18.  
  19.  
  20. #-----------------------------------------------------------------------------
  21. #    cxxlink-driver.sh
  22. #
  23. #    Created: David Williams <djw@netscape.com>, 18-Jul-1996
  24. #
  25. #    C++ Link driver. This guy is a replacement for a broken C++ link
  26. #    command. It will fix the options for the link so that no unwanted
  27. #    shared libraries get linked in, and other stuff. It may use it's
  28. #    pal cxxlink-filter.sh (for Cfront based loser linking) to do this.
  29. #    
  30. #-----------------------------------------------------------------------------
  31.  
  32. OS_NAME=OSF1
  33. CC_NAME=cxx
  34.  
  35. ARGS=$*
  36. OUT_ARGS=
  37. VERBOSE=
  38.  
  39. while [ X$1 != X ]
  40. do
  41.   case X$1 in
  42.     # This must be stripped out first, because it would match 'X-O*' as well,
  43.     # and that doesn't strip out the limit arg.
  44.     X-Olimit)
  45.             shift
  46.             shift
  47.             ;;
  48.     # Include, define, undefine, optimize (also optimization level), ignore
  49.     X-I*|X-D*|X-U*|X-O*)
  50.             shift
  51.             ;;
  52.     # Verbose
  53.     X-v)
  54.             VERBOSE=TRUE
  55.             shift
  56.             ;;
  57.     # HP-UX, OSF1, IRIX5.2.....
  58.     X-cxx_platform)
  59.             OS_NAME=$2
  60.             shift 2
  61.             ;;
  62.     # CC, cxx, gcc, .....
  63.     X-cxx_command)
  64.             CC_NAME=$2
  65.             shift 2
  66.             ;;
  67.     # Pass through
  68.     *)
  69.             OUT_ARGS="$OUT_ARGS $1"
  70.             shift
  71.             ;;
  72.     esac
  73. done
  74.  
  75. case X${OS_NAME}Y${CC_NAME} in
  76.   XOSF1Ycxx)    # Dec cxx driver
  77.     LD_DIR=/usr/lib/cmplrs/cc
  78.     CXX_DIR=/usr/lib/cmplrs/cxx
  79.     HEAD="$LD_DIR/ld -G 8 -g2 -call_shared -nocount $LD_DIR/crt0.o $CXX_DIR/_main.o -count -taso"
  80.     TAIL="-nocount $CXX_DIR/libcxx.a $CXX_DIR/libexc.a -lc"
  81.     ;;
  82.   XHP-UXYCC)    # HP CC driver
  83.     HEAD=CC -tl,cxxlink-filter
  84.     TAIL=
  85.     ;;
  86.   XIRIX5.2YCC)    # IRIX 5.2 CC driver
  87.     HEAD=CC -tl,cxxlink-filter
  88.     TAIL=
  89.     ;;
  90.   *)            # Unknown OS/Compiler
  91.     echo "Unknown OS/Compiler: '$OS_NAME/$CC_NAME'" >$2
  92.     exit 2
  93.     ;;
  94. esac
  95.  
  96. case X$VERBOSE in
  97.     XTRUE)    echo $HEAD $OUT_ARGS $TAIL
  98.             ;;
  99. esac
  100.  
  101. exec $HEAD $OUT_ARGS $TAIL 
  102.