Skip to content

Commit 060e647

Browse files
author
Sascha Schumann
committed
Speed up the genif.sh script a little bit. Whereas it took three seconds
previously, it takes now about 100ms on a P233.
1 parent 73c0f4b commit 060e647

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

build/print_include.awk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/phpext_/ {
2+
if (old_filename != FILENAME) {
3+
printf "#include \"" FILENAME "\"\\\\n"
4+
old_filename = FILENAME
5+
}
6+
}

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ if test -n "\$REDO_ALL"; then
865865
echo "creating main/internal_functions.c"
866866
extensions=\`grep '^s.@EXT_STATIC@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\`
867867
dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null
868-
sh $srcdir/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" \$extensions > main/internal_functions.c
868+
sh $srcdir/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c
869869
dnl if cmp main/internal_functions.c.old main/internal_functions.c > /dev/null 2>&1; then
870870
dnl echo "main/internal_functions.c is unchanged"
871871
dnl mv main/internal_functions.c.old main/internal_functions.c

genif.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22

3-
# $Id: genif.sh,v 1.9 2000-06-27 16:22:26 sas Exp $
3+
# $Id: genif.sh,v 1.10 2000-12-20 16:29:07 sas Exp $
44
# replacement for genif.pl
55

66
infile="$1"
@@ -9,27 +9,26 @@ srcdir="$1"
99
shift
1010
extra_module_ptrs="$1"
1111
shift
12+
awk="$1"
13+
shift
1214

1315
if test "$infile" = "" -o "$srcdir" = ""; then
1416
echo "please supply infile and srcdir"
1517
exit 1
1618
fi
1719

1820
module_ptrs="$extra_module_ptrs"
19-
includes=""
20-
21+
header_list=""
2122
olddir=`pwd`
2223
cd $srcdir
2324

2425
for ext in ${1+"$@"} ; do
2526
module_ptrs=" phpext_${ext}_ptr,\\\n$module_ptrs"
26-
for header in ext/$ext/*.h ; do
27-
if grep phpext_ $header >/dev/null 2>&1 ; then
28-
includes="#include \"$header\"\\\n$includes"
29-
fi
30-
done
27+
header_list="$header_list ext/$ext/*.h"
3128
done
3229

30+
includes=`$awk -f $srcdir/build/print_include.awk $header_list`
31+
3332
cd $olddir
3433

3534
cat $infile | \

0 commit comments

Comments
 (0)