usr/src/lib/curl/Solaris/curl-config-64
author Cyril Plisko <cyril.plisko@grigale.com>
Wed, 26 May 2010 22:56:24 -0700
changeset 15 24b3ef38fbcd
parent 9 502b128296a2
child 46 9c200dad5ecc
permissions -rwxr-xr-x
Import sfw build 141 Bugs Fixed ---------- 6927149 unpack-archive can not handle filenames with spaces 6934489 Update PostgreSQL 8.4 to 8.4.4 6934490 Update PostgreSQL 8.3 to 8.3.11 6934491 Update PostgreSQL 8.2 to 8.2.17 6947722 Upgrade CURL to 7.20.1 6951179 lcms update does not get along with ss12u1 6951444 Wireshark update to version 1.2.8

#! /bin/sh
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 2001 - 2010, Daniel Stenberg, <[email protected]>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# $Id: curl-config.in,v 1.25 2006-05-02 22:48:22 bagder Exp $
###########################################################################
#
# The idea to this kind of setup info script was stolen from numerous
# other packages, such as neon, libxml and gnome.
#
# Modified to conform to Solaris installation paths conventions.
#
# ident	"@(#)curl-config-64	1.6	10/04/28 SMI"
#
prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include/curl

usage()
{
    cat <<EOF
Usage: curl-config [OPTION]

Available values for OPTION include:

  --ca        ca bundle install path
  --cc        compiler
  --cflags    pre-processor and compiler flags
  --checkfor [version] check for (lib)curl of the specified version
  --features  newline separated list of enabled features
  --protocols newline separated list of enabled protocols
  --help      display this help and exit
  --libs      library linking information
  --prefix    curl install prefix
  --version   output version information
  --vernum    output the version information as a number (hexadecimal)
EOF

    exit $1
}

if test $# -eq 0; then
    usage 1
fi

while test $# -gt 0; do
    case "$1" in
    # this deals with options in the style
    # --option=value and extracts the value part
    # [not currently used]
    -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) value= ;;
    esac

    case "$1" in
    --ca)
	echo ""/etc/curl/curlCA""
	;;

    --cc)
	echo "/ws/onnv-tools/SUNWspro/SS12/bin/cc"
	;;

    --prefix)
	echo "$prefix"
	;;

    --feature|--features)
	for feature in SSL IPv6 libz IDN NTLM "" ; do
	    test -n "$feature" && echo "$feature"
	done
	;;

    --protocols)
	for protocol in DICT FILE FTP FTPS HTTP HTTPS IMAP IMAPS LDAP POP3 POP3S RTSP SMTP SMTPS TELNET TFTP ; do
	    echo "$protocol"
	done
	;;
    --version)
	echo libcurl 7.20.1
	exit 0
	;;

    --checkfor)
        checkfor=$2
        cmajor=`echo $checkfor | cut -d. -f1`
        cminor=`echo $checkfor | cut -d. -f2`
        # when extracting the patch part we strip off everything after a
	# dash as that's used for things like version 1.2.3-CVS
	cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
        checknum=`echo "$cmajor*256*256 + $cminor*256 + ${cpatch:-0}" | bc`
        numuppercase=`echo 071401 | tr 'a-f' 'A-F'`
        nownum=`echo "obase=10; ibase=16; $numuppercase" | bc`

	if test "$nownum" -ge "$checknum"; then
	  # silent success
	  exit 0
	else
	  echo "requested version $checkfor is newer than existing 7.20.1"
	  exit 1
	fi
	;;

    --vernum)
	echo 071401
	exit 0
	;;

    --help)
	usage 0
	;;

    --cflags)
        echo "-I${prefix}/include/curl"
       	;;

    --libs)
       	echo -L/usr/lib/MACH64 -lc -lcurl -lgss -lidn -lsldap -lldap -lsocket -lnsl -lz -lssl -lcrypto
       	;;

    *)
        echo "unknown option: $1"
	usage 1
	;;
    esac
    shift
done

exit 0