make_asn1c_includes.sh 1.36 KB
Newer Older
laurent's avatar
laurent committed
1 2 3 4 5
#!/bin/bash
GENERATED_FULL_DIR=$1
shift
ASN1_SOURCE_DIR=$1
shift
6
export ASN1C_PREFIX=$1
laurent's avatar
laurent committed
7 8 9
shift
options=$*
done_flag="$GENERATED_FULL_DIR"/done
10
if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
laurent's avatar
laurent committed
11 12 13
   rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h
   mkdir -p "$GENERATED_FULL_DIR"
   asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u
14 15 16 17 18 19 20 21
  if [ "$ASN1C_PREFIX" = "X2AP_" ] ; then
    sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReport-Item.c
    sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReport-Item.c
  fi
  if [ "$ASN1C_PREFIX" = "S1AP_" ] ; then
    sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
    sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
  fi
zhenghuangkun's avatar
zhenghuangkun committed
22 23 24 25
  if [ "$ASN1C_PREFIX" = "NGAP_" ] ; then
    sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}VolumeTimedReport-Item.c
    sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}VolumeTimedReport-Item.c
  fi
26

laurent's avatar
laurent committed
27
fi
28
touch $done_flag