# N.B. the previous line should be blank. #+ # Name: # hds_link_adam # Purpose: # Generate linker (ld) arguments for linking against ADAM HDS. # Type of Module: # Shell script. # Description: # This script should be invoked by those building ADAM applications # which use HDS 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 may be invoked as part of a command such as: # # alink program.f -L/star/lib `hds_link_adam` # # although the ADAM "alink" command will normally link against HDS # anyway. # Copyright: # Copyright (C) 1993 Science & Engineering Research Council # Copyright (C) 2005-2006 Particle Physics and Astronomy Research Council # Licence: # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Authors: # RFWS: R.F. Warren-Smith (STARLINK, RAL) # TIMJ: Tim Jenness (JAC, Hawaii) # {enter_new_authors_here} # History: # 7-JUL-1993 (RFWS): # Original version. # 20-DEC-2005 (TIMJ): # HDS is now two libraries # 24-FEB-2006 (TIMJ): # Need starmem # {enter_changes_here} # Bugs: # {note_any_bugs_here} #- #. # Initialise the special options string. special='' # Test to see if we are on a system which requires additional # "special" ld options for correct linking. # DEC Alpha systems running OSF1: # ------------------------------ # Ensure that allocated memory addresses will fit into 32 bits to # prevent problems with storing them in Fortran integers. if test "`uname -m`" = "alpha" -a "`uname -s`" = "OSF1"; then special='-Wl,-D -Wl,40800000 -Wl,-T -Wl,30000000' fi # Echo any special options, followed by the HDS library reference, # followed by the list of options for packages on which HDS depends. # Pass the result through an awk script to remove duplicate library # references. echo "${special}" -lhdsf -lhds `one_link_adam` `chr_link_adam` `ems_link_adam` `cnf_link_adam` `starmem_link` \ | awk '{for(f=NF;f;f--)if(!w[$f]++)l=$f" "l;print l}' # End of script.