NWChem/contrib/aix-renamer
Huub Van Dam 97f303e6f8 HvD: In the CVS era the $Id: $ tags in the source code files would
automatically be expanded to include useful information about the
checkin (including the file's revision number). With the switch over
to SVN this was lost because SVN only does this expansion if you 
explicitly ask for it (for every single file). 

I have added a script to the contrib directory that sets the appropriate
property to get SVN to do this expansion. This script will make it easy
to do this every time new source files are added. It is called
svn_expand_Id, the script contains some comments that explain the issue
and how it addresses this.  

This checkin sets this property for a subset of the relevant files
(trying to commit all files at once failed with svn crashing). 
In future the script will only affect those files for which the property
was not set before.
2010-10-29 18:04:21 +00:00

29 lines
1.1 KiB
Tcsh
Executable file

#!/bin/csh -f
# aix-renamer (for NWChem)
# Usage: make link |& aix-renamer > aix-ld-rename-switches
#
# $Id$
#
# This script extract the undefined symbol error messages from an
# attempt to link a mixed Fortran/C program compiled with -qextname and
# converts them into the appropriate -brename options to feed to ld.
#
# Recommended usage is to remove all -brename options from the link
# command, then attempt to link, piping the output into this script.
# The output can then be included into the makefile at the appropriate
# place.
#
# Caveats:
# The error message of interest appear on stderr, so the pipe must
# redirect stderr as well as stdout into this script.
#
# Works only for Aix 4 (AIX 3 doesn't format the undefined symbol
# messages the same way).
#
# Assumes that all symbols of the form .name_ are to be renamed to
# .name, without trying to detect if the target routine is actually
# present. This is obviously naieve and will not trap true errors.
set err_code = "0711-317" # AIX 4 error code for "undefined symbol"
grep $err_code | sed 's/^.*\ \.\(.*\)_$/-brename:.\1_,.\1/'