libndr: EXT_NSL doesn't exist anymore, but it wasn't needed anyway
[jelmer/samba4-debian.git] / source / heimdal_build / asn1_compile_wrapper.sh
1 #!/bin/sh
2 #
3
4 SELF=$0
5 SELFDIR=`dirname ${SELF}`
6
7 SRCDIR=$1
8 BUILDDIR=$2
9 DESTDIR=$3
10
11 CMD=$4
12 FILE=$5
13 NAME=$6
14 shift 6
15 OPTIONS="$@"
16
17 test -z "${SRCDIR}" && {
18         echo "${SELF}:SRCDIR: '${SRCDIR}'" >&2;
19         exit 1;
20 }
21
22 test -z "${BUILDDIR}" && {
23         echo "${SELF}:BUILDDIR: '${BUILDDIR}'" >&2;
24         exit 1;
25 }
26
27 test -z "${DESTDIR}" && {
28         echo "${SELF}:DESTDIR: '${DESTDIR}'" >&2;
29         exit 1;
30 }
31
32 test -z "${CMD}" && {
33         echo "${SELF}:CMD: '${CMD}'" >&2;
34         exit 1;
35 }
36
37 test -z "${FILE}" && {
38         echo "${SELF}:FILE: '${FILE}'" >&2;
39         exit 1;
40 }
41
42 test -z "${NAME}" && {
43         echo "${SELF}:NAME: '${NAME}'" >&2;
44         exit 1;
45 }
46
47 CURDIR=`pwd`
48
49 cd ${SRCDIR} && {
50         ABS_SRCDIR=`pwd`
51         cd ${CURDIR}
52 } || {
53         echo "${SELF}:cannot cd into '${SRCDIR}'" >&2;
54         exit 1;
55 }
56
57 cd ${BUILDDIR} && {
58         ABS_BUILDDIR=`pwd`
59         cd ${CURDIR}
60 } || {
61         echo "${SELF}:cannot cd into '${BUILDDIR}'" >&2;
62         exit 1;
63 }
64
65 cd ${DESTDIR} && {
66         ${ABS_BUILDDIR}/${CMD} ${OPTIONS} ${ABS_SRCDIR}/${FILE} ${NAME} >&2 || exit 1;
67         cd ${CURDIR}
68 } || {
69         echo "${SELF}:cannot cd into '${BUILDDIR}'" >&2;
70         exit 1;
71 }
72
73 exit 0;