components/samba/Solaris/krb5-config
changeset 5222 8298df727253
parent 4371 29fdb14099eb
equal deleted inserted replaced
5221:e63c8f63ac44 5222:8298df727253
       
     1 #!/bin/sh
       
     2 
       
     3 #
       
     4 # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
       
     5 #
       
     6 #
       
     7 # This is the local copy of krb5-config to build the Samba4 in comp. dir.
       
     8 #
       
     9 # Copyright 2001, 2002, 2003 by the Massachusetts Institute of Technology.
       
    10 # All Rights Reserved.
       
    11 #
       
    12 # Export of this software from the United States of America may
       
    13 #   require a specific license from the United States Government.
       
    14 #   It is the responsibility of any person or organization contemplating
       
    15 #   export to obtain such a license before exporting.
       
    16 # 
       
    17 # WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
       
    18 # distribute this software and its documentation for any purpose and
       
    19 # without fee is hereby granted, provided that the above copyright
       
    20 # notice appear in all copies and that both that copyright notice and
       
    21 # this permission notice appear in supporting documentation, and that
       
    22 # the name of M.I.T. not be used in advertising or publicity pertaining
       
    23 # to distribution of the software without specific, written prior
       
    24 # permission.  Furthermore if you modify this software you must label
       
    25 # your software as modified software and not distribute it in such a
       
    26 # fashion that it might be confused with the original M.I.T. software.
       
    27 # M.I.T. makes no representations about the suitability of
       
    28 # this software for any purpose.  It is provided "as is" without express
       
    29 # or implied warranty.
       
    30 # 
       
    31 
       
    32 # Configurable parameters set by autoconf
       
    33 version_string="Solaris Kerberos (based on MIT Kerberos 5 release 1.8.3) extended by gss_krb5_import_cred() partially to MIT Kerberos 5 release 1.9.0"
       
    34 
       
    35 prefix=/usr
       
    36 exec_prefix=${prefix}
       
    37 includedir=${prefix}/include/kerberosv5
       
    38 gssapiincludedir=${prefix}/include
       
    39 libdir=${exec_prefix}/lib
       
    40 CC_LINK='$(PURE) $(CC) $(CFLAGS) $(LDFLAGS)'
       
    41 #KRB4_LIB=-lkrb4
       
    42 #DES425_LIB=-ldes425
       
    43 KDB5_DB_LIB=
       
    44 LDFLAGS=''
       
    45 PTHREAD_CFLAGS=''
       
    46 
       
    47 #LIBS='-lresolv -lsocket -lnsl '
       
    48 GEN_LIB=
       
    49 
       
    50 # Defaults for program
       
    51 library=krb5
       
    52 
       
    53 # Some constants
       
    54 vendor_string="Oracle"
       
    55 
       
    56 # Process arguments
       
    57 # Yes, we are sloppy, library specifications can come before options
       
    58 while test $# != 0; do
       
    59     case $1 in
       
    60 	--all)
       
    61 	    do_all=1
       
    62 	    ;;
       
    63 	--cflags)
       
    64 	    do_cflags=1
       
    65 	    ;;
       
    66 	--deps)
       
    67 	    do_deps=1
       
    68 	    ;;
       
    69 	--exec-prefix)
       
    70 	    do_exec_prefix=1
       
    71 	    ;;
       
    72 	--help)
       
    73 	    do_help=1
       
    74 	    ;;
       
    75 	--libs)
       
    76 	    do_libs=1
       
    77 	    ;;
       
    78 	--prefix)
       
    79 	    do_prefix=1
       
    80 	    ;;
       
    81 	--vendor)
       
    82 	    do_vendor=1
       
    83 	    ;;
       
    84 	--version)
       
    85 	    do_version=1
       
    86 	    ;;
       
    87 	krb5)
       
    88 	    library=krb5
       
    89 	    ;;
       
    90 	gssapi)
       
    91 	    library=gssapi
       
    92 	    ;;
       
    93 	*)
       
    94 	    echo "$0: Unknown option \`$1' -- use \`--help' for usage"
       
    95 	    exit 1
       
    96     esac
       
    97     shift
       
    98 done
       
    99 
       
   100 # If required options - provide help
       
   101 if test -z "$do_all" -a -z "$do_version" -a -z "$do_vendor" -a -z "$do_prefix" -a -z "$do_vendor" -a -z "$do_exec_prefix" -a -z "$do_cflags" -a -z "$do_libs"; then
       
   102     do_help=1
       
   103 fi
       
   104 
       
   105 if test -n "$do_help"; then
       
   106     echo "Usage: $0 [OPTIONS] [LIBRARIES]"
       
   107     echo "Options:"
       
   108     echo "        [--help]          Help"
       
   109     echo "        [--all]           Display version, vendor, and various values"
       
   110     echo "        [--version]       Version information"
       
   111     echo "        [--vendor]        Vendor information"
       
   112     echo "        [--prefix]        Kerberos installed prefix"
       
   113     echo "        [--exec-prefix]   Kerberos installed exec_prefix"
       
   114     echo "        [--cflags]        Compile time CFLAGS"
       
   115     echo "        [--libs]          List libraries required to link [LIBRARIES]"
       
   116     echo "Libraries:"
       
   117     echo "        krb5              Kerberos 5 application"
       
   118     echo "        gssapi            GSSAPI application"
       
   119  
       
   120     exit 0
       
   121 fi
       
   122 
       
   123 if test -n "$do_all"; then
       
   124     all_exit=
       
   125     do_version=1
       
   126     do_prefix=1
       
   127     do_exec_prefix=1
       
   128     do_vendor=1
       
   129     title_version="Version:     "
       
   130     title_prefix="Prefix:      "
       
   131     title_exec_prefix="Exec_prefix: "
       
   132     title_vendor="Vendor:      "
       
   133 else
       
   134     all_exit="exit 0"
       
   135 fi
       
   136 
       
   137 if test -n "$do_version"; then
       
   138     echo "$title_version$version_string"
       
   139     $all_exit
       
   140 fi
       
   141 
       
   142 if test -n "$do_vendor"; then
       
   143     echo "$title_vendor$vendor_string"
       
   144     $all_exit
       
   145 fi
       
   146 
       
   147 if test -n "$do_prefix"; then
       
   148     echo "$title_prefix$prefix"
       
   149     $all_exit
       
   150 fi
       
   151 
       
   152 if test -n "$do_exec_prefix"; then
       
   153     echo "$title_exec_prefix$exec_prefix"
       
   154     $all_exit
       
   155 fi
       
   156 
       
   157 if test -n "$do_cflags"; then
       
   158     if test $library = 'gssapi'; then
       
   159 	echo "-I${gssapiincludedir} -I_SAMBA_BUILD_PROTO_/usr/include"
       
   160     else
       
   161 	echo "-I${includedir}"
       
   162     fi
       
   163 fi
       
   164 
       
   165 if test -n "$do_libs"; then
       
   166     # Ugly gross hack for our build tree
       
   167     lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \
       
   168 	    -e 's/\$(PURE)//' \
       
   169 	    -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \
       
   170 	    -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \
       
   171 	    -e 's#\$(CFLAGS)#'"$CFLAGS"'#'`
       
   172 
       
   173     if test $library = 'gssapi'; then
       
   174 	if test -n "$MACH64"; then
       
   175 	  lib_flags="-L_SAMBA_BUILD_PROTO_/usr/lib/samba/$MACH64 -R/usr/lib/samba/$MACH64 -R/usr/lib/gss/$MACH64 $lib_flags"
       
   176 	else
       
   177 	  lib_flags="-L_SAMBA_BUILD_PROTO_/usr/lib/samba -R/usr/lib/samba -R/usr/lib/gss $lib_flags"
       
   178 	fi
       
   179 	lib_flags="$lib_flags -lgss -lgssapi_krb5"
       
   180     fi
       
   181 
       
   182     if test $library = 'krb5'; then
       
   183 	lib_flags="$lib_flags -lkrb5 $LIBS $GEN_LIB"
       
   184     fi
       
   185 
       
   186     echo $lib_flags
       
   187 fi
       
   188 
       
   189 exit 0