
#  N.B. the previous line should be blank.
#+
#  Name:
#     subpar_link_adam

#  Purpose:
#     Generate linker (ld) arguments for linking against adam SUBPAR.

#  Type of Module:
#     Shell script.

#  Description:
#     This script should be invoked by those building ADAM applications
#     which use SUBPAR in order to generate the correct arguments for the 
#     compiler (or ld) command. The arguments generated are written to 
#     the standard output.

#  Invocation:
#     The script is normally invoked as part of a compiler command line,
#     such as:
#
#        alink program.f -L/star/lib `subpar_link_adam`

#     although the ADAM "alink" command will normally link against SUBPAR
#     anyway.

#  Copyright:
#     Copyright (C) 1995 Rutherford Appleton Laboratory

#  Authors:
#     RFWS: R.F. Warren-Smith (STARLINK, RAL)
#     BLY:  M.J. Bly (Starlink, RAL)
#     AJC:  A.J. Chipperfield (Starlink, RAL)
#     {enter_new_authors_here}

#  History:
#     7-JUL-1993 (RFWS):
#        Original version.
#     21-JUN-1995 (RFWS):
#        Added new awk script to permit larger numbers of libraries.
#     22-JUN-1995 (BLY):
#        Generic version.
#     14-SEP-1995 (AJC):
#        Modified for SUBPAR
#     21-MAY-1998 (AJC):
#        Add curses library for MISC
#     16-AUG-2001 (AJC):
#        Remove -ladam_adam -lmessys_adam 
#     {enter_further_changes_here}

#  Bugs:
#     {note_any_bugs_here}

#-

      echo -lsubpar_adam \
           -lparsecon_adam \
           -llex_adam \
           -lams_adam \
           -lmsp \
           -lsock \
           -latimer \
           -lmisc_adam \
           -lcurses \
           -lstring_adam \
           `hds_link_adam` \
           `hlp_link_adam` \
           `psx_link_adam` \
           | awk 'BEGIN{RS=" ";FS="\n"}
                  {f[i++]=$1}
                  END{for(;i--;)if(!w[f[i]]++)l=f[i]" "l;print l}'

#  End of script.
