#!/bin/sh
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/autoconf/ldsharedopt                 */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Mon Aug 10 09:05:45 1998                          */
#*    Last change :  Wed Mar  8 18:19:45 2017 (serrano)                */
#*    -------------------------------------------------------------    */
#*    This script setup the link option for dynamic linking.           */
#*    -------------------------------------------------------------    */
#*    This script need probably to be smarter. It more cases have to   */
#*    be added I will make something more general.                     */
#*=====================================================================*/

#*---------------------------------------------------------------------*/
#*    flags                                                            */
#*---------------------------------------------------------------------*/
lib=$1

#*---------------------------------------------------------------------*/
#*    We parse the arguments                                           */
#*---------------------------------------------------------------------*/
while : ; do
  case $1 in
    "")
      break;;

    -*)
      echo "Unknown option \"$1\", ignored" >&2;;
  esac
  shift
done


case $HOSTOS in
  osf)
    case $HOSTCPU in
      alpha)
        echo "-rpath $lib -expect_unresolved '*'";;
      *)
        echo "";;
     esac
    ;;

  aix)
    if [ "$CC" = "gcc" ]; then
      echo "-Xlinker -bbigtoc"
    else
      #echo "-bbigtoc"
      echo "-bdynamic -brtl"
    fi
    ;;

  *)
    echo "";;

esac
