-pdu=auto support

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1191 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2006-09-17 00:20:47 +00:00
parent e44e7757e5
commit fa58cc722c
1 changed files with 16 additions and 5 deletions

View File

@ -1,9 +1,9 @@
#!/bin/sh
if [ -z "$ASN1PDU" \
if test -z "$ASN1PDU" \
-o -z "$ASN1MODULES" \
-o -z "$PROGNAME" \
]; then
; then
echo "ASN1CMDOPTS=\"$ASN1CMDOPTS\""
echo "ASN1MODULES=\"$ASN1MODULES\""
echo "ASN1PDU=\"$ASN1PDU\""
@ -12,18 +12,29 @@ if [ -z "$ASN1PDU" \
exit
fi
ASN1PDU=`echo "$ASN1PDU" | tr - _`
../../asn1c/asn1c -S ../../skeletons ${ASN1CMDOPTS} ${ASN1MODULES} || exit $?
if [ ! -f Makefile.am.sample ]; then
if test ! -f Makefile.am.sample ; then
echo "Makefile.am.sample is missing"
exit 1
fi
ASN1PDU=`echo "$ASN1PDU" | tr - _`
EXTRA_CFLAGS=""
if test -f config.h ; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_CONFIG_H"
fi
FIXEDPDU=`echo "[$ASN1PDU]" | sed -e "s/.*-pdu=auto.*//"`
if test "$FIXEDPDU" ; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DASN_PDU_COLLECTION"
fi
set -x
cat Makefile.am.sample \
| sed -e "s/^CFLAGS.*/CFLAGS += -I. -DHAVE_CONFIG_H -DPDU=${ASN1PDU}/" \
| sed -e "s/^CFLAGS.*/CFLAGS += -I. $EXTRA_CFLAGS -DPDU=${ASN1PDU}/" \
| sed -e "s/^all: /all: ${ASN1PDU}.c /" \
| sed -e "s/progname/${PROGNAME}/" \
> Makefile.$$