File: athstatic

package info (click to toggle)
owl 2.2.2-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,208 kB
  • ctags: 3,600
  • sloc: ansic: 36,373; perl: 242; makefile: 93; sh: 43
file content (32 lines) | stat: -rwxr-xr-x 686 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# $Id: athstatic,v 1.2 2003/05/31 19:33:43 kretch Exp $

# 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

echo "$progname" $options
exec "$progname" $options