]> granicus.if.org Git - apache/commitdiff
Speed up the generation of exports.c by using an awk script to process
authorBrian Havard <bjh@apache.org>
Tue, 5 Dec 2000 14:36:31 +0000 (14:36 +0000)
committerBrian Havard <bjh@apache.org>
Tue, 5 Dec 2000 14:36:31 +0000 (14:36 +0000)
apr.exports instead of shell script.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87208 13f79535-47bb-0310-9956-ffa450edef68

build/buildexports.awk [new file with mode: 0644]
build/buildexports.sh

diff --git a/build/buildexports.awk b/build/buildexports.awk
new file mode 100644 (file)
index 0000000..3341034
--- /dev/null
@@ -0,0 +1,8 @@
+{
+    if ($1 ~ /^APR_/)
+        print "#if", $1;
+    if ($1 ~ /^apr_/)
+        print "const void *ap_hack_" $1 " = (const void *)" $1 ";";
+    if ($1 ~ /^\/APR_/)
+        print "#endif /*", substr($1,2), "*/";
+}
index 487f60653dbee910f755f5c0743e692e70d707e0..40b04355ed76bce1f3313135868655a12f6a2a45 100755 (executable)
@@ -17,27 +17,7 @@ done
 cd ../../../
 echo ""
 
-while read LINE
-do
-    if [ "x`echo $LINE | egrep  '^[:space:]*APR_'`" != "x" ]; then
-        ifline=`echo "$LINE" |\
-            sed -e 's%^\(.*\)%\#if \1%'`
-        echo $ifline
-    fi
-    if [ "x`echo $LINE | egrep  '^[:space:]*apr_'`" != "x" ]; then
-#        newline=`echo "$LINE" |\
-#            sed -e 's%^\(.*\)%extern const void *\1\\(void\);%'`
-#        echo $newline
-        newline=`echo "$LINE" |\
-            sed -e 's%^\(.*\)%const void *ap_hack_\1 = \(const void *\)\1\;%'`
-        echo $newline
-    fi
-    if [ "x`echo $LINE | egrep  '^[:space:]*\/APR_'`" != "x" ]; then
-        endline=`echo "$LINE" |\
-            sed -e 's%^\/\(.*\)%\#endif \/\*\1\*\/%'`
-        echo "$endline"
-    fi
-done
+awk -f build/buildexports.awk
 
 echo ""
 echo "void *ap_ugly_hack;"