summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Garry Zacheiss <zacheiss@mit.edu>2003-02-06 15:10:03 +0000
committerGravatar Garry Zacheiss <zacheiss@mit.edu>2003-02-06 15:10:03 +0000
commitb301d02888261181b044e4a300521948b2fb122d (patch)
tree23a4e252c455cd4d487ed7f63eae91d194831301
parent4396a85eda8de76c37201263fbfe3409876a1e5b (diff)
Link zhm statically.
-rwxr-xr-xathstatic31
1 files changed, 31 insertions, 0 deletions
diff --git a/athstatic b/athstatic
new file mode 100755
index 0000000..051697f
--- /dev/null
+++ b/athstatic
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $Id$
+
+# Usage: athstatic progname options ...
+
+# Replaces -lfoo options with /usr/athena/lib/libfoo.a if it exists,
+# thus preferring static libraries to shared libraries for stuff in
+# /usr/athena/lib.
+
+progname=$1
+shift
+
+options=
+for arg do
+ case $arg in
+ -l*)
+ # Chop off the first two characters to get the library name.
+ lib=`expr "$arg" : '..\(.*\)$'`
+ if [ -f /usr/athena/lib/lib${lib}.a ]; then
+ options="$options /usr/athena/lib/lib${lib}.a"
+ else
+ options="$options $arg"
+ fi
+ ;;
+ *)
+ options="$options $arg"
+ ;;
+ esac
+done
+
+exec "$progname" $options