summaryrefslogtreecommitdiffstats
path: root/src/extension/script/wrap_swig_module.sh
blob: 8c6236f2d5c478898c632bff7100bb7f2e14d4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

inf=$1
outf=$2
datestr=`date`

echo "" > ${outf}
echo "/* ###################################################" >> ${outf}
echo "## This file generated by wrap_swig_module.sh from" >> ${outf}
echo "## ${inf} on ${datestr}" >> ${outf}
echo "## DO NOT EDIT" >> ${outf}
echo "################################################### */" >> ${outf}
echo "" >> ${outf}

echo "static char *inkscape_module_script =" >> ${outf}
echo "\"\n\"" >> ${outf}

cat ${inf} | \
sed -e 's/\"/\\"/g' -e 's/^/\"/g' -e 's/$/\\n\"/g' >> ${outf}

echo "\"\n\";" >> ${outf}