Annotation of gcc/c++, revision 1.1

1.1     ! root        1: #!/bin/sh
        !             2: # Compile programs, treating .c files as C++.
        !             3: 
        !             4: newargs=
        !             5: quote=no
        !             6: library=-lg++
        !             7: havefiles=
        !             8: 
        !             9: for arg in $*;
        !            10: do
        !            11:   if [ $quote = yes ]
        !            12:   then
        !            13:     newargs="$newargs $arg"
        !            14:     quote=no
        !            15:   else
        !            16:     quote=no
        !            17:     case $arg in
        !            18:       -nostdlib)
        !            19:        # Inhibit linking with -lg++.
        !            20:        newargs="$newargs $arg"
        !            21:        library=
        !            22:        ;;
        !            23:       -[bBVDUoeTuIYmLiA] | -Tdata)
        !            24:        newargs="$newargs $arg"
        !            25:        # these switches take following word as argument,
        !            26:        # so don't treat it as a file name.
        !            27:        quote=yes
        !            28:        ;;
        !            29:       -[cSE])
        !            30:        # Don't specify libraries if we won't link,
        !            31:        # since that would cause a warning.
        !            32:        newargs="$newargs $arg"
        !            33:        library=
        !            34:        ;;
        !            35:       -xnone)
        !            36:        newargs="$newargs $arg"
        !            37:        speclang=
        !            38:        ;;
        !            39:       -x*)
        !            40:        newargs="$newargs $arg"
        !            41:        speclang=yes
        !            42:        ;;
        !            43:       -*)
        !            44:        # Pass other options through; they don't need -x and aren't inputs.
        !            45:        newargs="$newargs $arg"
        !            46:        ;;
        !            47:       *)
        !            48:        havefiles=yes
        !            49:        # If file ends in .c or .i, put options around it.
        !            50:        # But not if a specified -x option is currently active.
        !            51:        temp=`expr $arg : '.*\.[ci]$'`
        !            52:        if [ \( x$temp != x0 \) -a \( x$speclang = x \) ]
        !            53:        then
        !            54:          newargs="$newargs -xc++ $arg -xnone"
        !            55:        else
        !            56:          newargs="$newargs $arg"
        !            57:        fi
        !            58:        ;;
        !            59:     esac
        !            60:   fi
        !            61: done
        !            62: 
        !            63: if [ x$havefiles = x ]
        !            64: then
        !            65:   echo "$0: no input files specified"
        !            66:   exit 1
        !            67: fi
        !            68: 
        !            69: progname=`echo $0 |sed -e 's|/[^/]*$|/gcc|'`
        !            70: if [ -f ${progname} ]
        !            71: then
        !            72: exec ${progname} $newargs $library
        !            73: else
        !            74: exec gcc $newargs $library
        !            75: fi

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.