#!/bin/sh
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/autoconf/ldstaticopt                 */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Mon Aug 10 09:05:45 1998                          */
#*    Last change :  Sun Sep  6 22:13:55 2009 (serrano)                */
#*    -------------------------------------------------------------    */
#*    This script setup the link option for static linking.            */
#*    -------------------------------------------------------------    */
#*    This script need probably to be smarter. It more cases have to   */
#*    be added I will make something more general.                     */
#*=====================================================================*/

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

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

case $HOSTOS in
  linux)
    case $HOSTCPU in
       i*86)
          echo "-Wl,-defsym,_DYNAMIC=0";;
       *)
          echo "";;
    esac;;

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

   *)
    echo "";;
esac

