File: build.sh

package info (click to toggle)
di 6.2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 896 kB
  • sloc: ansic: 9,364; sh: 5,211; perl: 1,749; awk: 463; makefile: 398
file content (53 lines) | stat: -rwxr-xr-x 841 bytes parent folder | download
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

set -x

dilibd=""
pcarg="di"
if [ $# -gt 0 ]; then
  dilibd=$1
  if [ -d ${dilibd}/lib ]; then
    dilibd=${dilibd}/lib
  fi
  if [ -d ${dilibd}/lib64 ]; then
    dilibd=${dilibd}/lib64
  fi
  if [ -d ${dilibd}/pkgconfig ]; then
    pcpath=${dilibd}/pkgconfig
    pcarg=${pcpath}/di.pc
  fi
fi
if [ "$CC" = "" ]; then
  CC=cc
fi

diinc=`pkg-config --cflags ${pcarg}`
rc=$?
if [ $rc -ne 0 ]; then
  exit 2
fi

if [ "$dilibd" = "" ]; then
  dilibd=`pkg-config --libs-only-L ${pcarg}`
  dilibd=`echo ${dilibd} | sed -e 's,^-L,,'`
fi
dilibs=`pkg-config --libs ${pcarg}`
rc=$?
if [ $rc -ne 0 ]; then
  exit 2
fi

systype=`uname -s`
case ${systype} in
  SunOS|NetBSD)
    libargs="-Wl,-R${dilibd}"
    ;;
  Darwin|Linux)
    libargs="-Wl,-rpath,${dilibd}"
    ;;
esac

${CC} -o diex ${diinc} diex.c ${libargs} ${dilibs}
rc=$?

exit $rc