diff options
Diffstat (limited to 'move-asn1-header-files.sh')
-rwxr-xr-x | move-asn1-header-files.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/move-asn1-header-files.sh b/move-asn1-header-files.sh index b968323..7c996b2 100755 --- a/move-asn1-header-files.sh +++ b/move-asn1-header-files.sh @@ -12,6 +12,22 @@ base_dir="$(dirname "$0")" include_subdir="$1" shift +# Abort if any of the header files are missing +for i in "$@"; do + if ! [ -e "$i" ]; then + echo + echo "ERROR: file '$i' has not been generated by asn1c!" + echo + echo "Are you using the Osmocom asn1c fork with the" \ + "ASN1C_PREFIX feature?" + echo + echo "More information:" + echo "https://osmocom.org/projects/osmohnbgw/wiki/Generate_sources_from_ASN1_files" + echo + exit 1 + fi +done + include_dir="$base_dir/include/$include_subdir" mkdir -p "$include_dir" echo "$PWD/*.h --> $include_dir" @@ -22,6 +38,7 @@ collect_sed_commands() { shift echo "s,^#include \"$fname\"$,#include <$include_subdir/$fname>," + echo "s, \* \tfound in \"${base_dir}, * \tfound in \"../..," done } |