summaryrefslogtreecommitdiffstats
path: root/ksvg/scripts/gen.sh
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit47d455dd55be855e4cc691c32f687f723d9247ee (patch)
tree52e236aaa2576bdb3840ebede26619692fed6d7d /ksvg/scripts/gen.sh
downloadtdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz
tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksvg/scripts/gen.sh')
-rwxr-xr-xksvg/scripts/gen.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/ksvg/scripts/gen.sh b/ksvg/scripts/gen.sh
new file mode 100755
index 00000000..d608385b
--- /dev/null
+++ b/ksvg/scripts/gen.sh
@@ -0,0 +1,51 @@
+# try to find an appropriate awk interpreter
+if which mawk > /dev/null 2>&1; then
+ cmd_awk=`which mawk`;
+else
+ if which awk > /dev/null 2>&1; then
+ cmd_awk=`which awk`;
+ else
+ echo "No suitable AWK interpreter found. Aborting."
+ exit 1
+ fi
+fi
+
+# make them
+touch $1.h
+touch $1.cc
+
+#start with copyright notices
+cat ../COPYRIGHTS > $1.h
+cat ../COPYRIGHTS > $1.cc
+
+# add define for multiple include problem
+echo "" >> $1.h
+echo "#ifndef $1_H" >> $1.h
+echo "#define $1_H" >> $1.h
+echo "" >> $1.h
+echo "namespace KSVG" >> $1.h
+echo "{" >> $1.h
+echo "" >> $1.h
+
+#include in .cc + namespace
+echo "" >> $1.cc
+echo "#include \"$1.h\"" >> $1.cc
+echo "#include \"$1Impl.h\"" >> $1.cc
+echo "" >> $1.cc
+echo "using namespace KSVG;" >> $1.cc
+echo "" >> $1.cc
+
+#go go go
+$cmd_awk -f ../makeheader $1
+$cmd_awk -f ../makecc $1
+
+#add end of define
+echo "};" >> $1.h
+echo "" >> $1.h
+echo "#endif" >> $1.h
+echo "" >> $1.h
+
+echo "// vim:ts=4:noet" >> $1.h
+echo "// vim:ts=4:noet" >> $1.cc
+
+#done I hope