File: runxmkmf

package info (click to toggle)
vflib3 3.6.14.dfsg-3%2Bnmu3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 11,536 kB
  • ctags: 3,710
  • sloc: ansic: 35,811; sh: 10,357; asm: 3,290; makefile: 962; lisp: 123; perl: 109; awk: 43
file content (53 lines) | stat: -rwxr-xr-x 1,084 bytes parent folder | download | duplicates (8)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

# Run "xmkmf"
# Since invocation of Sun OpenWindow's "xmkmf" is different from 
# X11R* "xmkmf", we need to check how to invoke it.

XMKMF=''

# Find xmkmf
X=`echo $PATH | sed 's/:/ /g'`
for d in $X ; do
  if test -x $d/xmkmf; then
    XMKMF=$d/xmkmf
    break
  fi
done

# Check if we have OpenWindow.
NO_OPENWIN=1
if test -d /usr/openwin; then 
  NO_OPENWIN=0
  # If OPENWINHOME is not set, we do not use OpenWindow
  if test X-${OPENWINHOME+set} != X-set; then  
    NO_OPENWIN=1
  fi
fi

# In case we have OpenWindow but an "xmkmf" to be executed is not 
# an OpenWindow's "xmkmf", we do not use OpenWindow. 
if test ${NO_OPENWIN} = 0; then 
  if [ X-$XMKMF != X-${OPENWINHOME}/bin/xmkmf ] ; then
    NO_OPENWIN=1
  fi
fi

# Run "xmkmf" accroding to the check result.
case ${NO_OPENWIN} in
0)
  echo Use OpenWindow
  echo "Running 'xmkmf $OPENWINHOME/lib .'"
  xmkmf $OPENWINHOME/lib .
  ;;
1)
  if [ X-$XMKMF != X- ] ; then
    echo Use X11.
    echo "Running 'xmkmf -a'"
    xmkmf -a
  else
    echo Not found: xmkmf. No X11.
    touch Makefile x11.mk
  fi
  ;;
esac