1999-05-07 04:52:19 +08:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# replacement for genif.pl
|
|
|
|
|
2002-03-22 18:22:41 +08:00
|
|
|
infile=$1
|
1999-05-07 04:52:19 +08:00
|
|
|
shift
|
2002-03-22 18:22:41 +08:00
|
|
|
srcdir=$1
|
1999-05-07 04:52:19 +08:00
|
|
|
shift
|
2002-03-22 18:22:41 +08:00
|
|
|
extra_module_ptrs=$1
|
2000-03-26 10:47:00 +08:00
|
|
|
shift
|
2002-03-22 18:22:41 +08:00
|
|
|
awk=$1
|
2000-12-21 00:29:07 +08:00
|
|
|
shift
|
1999-05-07 04:52:19 +08:00
|
|
|
|
2002-03-22 18:22:41 +08:00
|
|
|
if test -z "$infile" || test -z "$srcdir"; then
|
2018-10-20 15:42:56 +08:00
|
|
|
echo "please supply infile and srcdir" >&2
|
1999-05-07 04:52:19 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2002-03-22 18:22:41 +08:00
|
|
|
header_list=
|
1999-09-04 01:46:39 +08:00
|
|
|
olddir=`pwd`
|
|
|
|
cd $srcdir
|
|
|
|
|
2005-06-21 21:47:38 +08:00
|
|
|
module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
|
|
|
|
|
1999-05-09 06:00:02 +08:00
|
|
|
for ext in ${1+"$@"} ; do
|
2015-11-16 18:04:10 +08:00
|
|
|
ext_dir=`echo "$ext" | cut -d ';' -f 2`
|
|
|
|
header_list="$header_list $ext_dir/*.h*"
|
1999-05-09 05:44:12 +08:00
|
|
|
done
|
|
|
|
|
2000-12-21 01:21:37 +08:00
|
|
|
includes=`$awk -f ./build/print_include.awk $header_list`
|
2000-12-21 00:29:07 +08:00
|
|
|
|
1999-09-04 01:46:39 +08:00
|
|
|
cd $olddir
|
|
|
|
|
1999-05-09 05:44:12 +08:00
|
|
|
cat $infile | \
|
1999-05-09 06:00:02 +08:00
|
|
|
sed \
|
|
|
|
-e "s'@EXT_INCLUDE_CODE@'$includes'" \
|
|
|
|
-e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \
|
2001-03-30 22:02:20 +08:00
|
|
|
-e 's/@NEWLINE@/\
|
1999-05-09 06:00:02 +08:00
|
|
|
/g'
|