# N.B. the previous line should be blank. #+ # Name: # nbs_link # Purpose: # Generate linker (ld) arguments for linking against standalone NBS. # Language: # {routine_language} # Type Of Module: # Shell script. # Invocation: # The script is normally invoked as part of a compiler command line, # such as: # # f77 -o program -L/star/lib `nbs_link` program.f # Description: # This script should be invoked by those building standalone # applications which use NBS in order to generate the correct # arguments for the compiler (or ld) command. The arguments # generated are written to the standard output. # Copyright: # Copyright (C) 1993 Science & Engineering 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: # DJA: D.J. Allan (Jet-X, University of Birmingham) # TIMJ: Tim Jenness (JAC, Hawaii) # {enter_new_authors_here} # History: # 7-FEB-1995 (DJA): # Original version. # 15-AUG-2005 (TIMJ): # chr isn't required # Only need C interface to EMS # {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 NBS library reference, # followed by the list of options for packages on which NBS depends. # Pass the result through an awk script to remove duplicate library # references. echo "${special}" -lnbs `ems_link Conly` `cnf_link` \ | awk '{for(f=NF;f;f--)if(!w[$f]++)l=$f" "l;print l}' # End of script.