3 # NOTE: This is NOT the same fdfix.sh as in ${top_srcdir}/forms
4 # It is a modified version to suit use for gui-indep.
8 echo "Input file does not exist. Cannot continue"
13 base=`basename $1 .fd`
15 if [ $1 = $base ]; then
16 echo "Input file is not a .fd file. Cannot continue"
25 classname=`echo $base | cut -c6-`
26 firstchar=`echo $classname | cut -c1 | tr a-z A-Z`
27 rest=`echo $classname | cut -c2-`
28 classname=Form$firstchar$rest
30 # Create .c and .h files
33 # Modify .h file for use by LyX
34 echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $hout
35 sed -f fdfixh.sed < $hin >> $hout
37 # Patch the .h file if a patch exists
38 if [ -f "$hout.patch" ] ; then
39 echo "Patching $hout with $hout.patch"
40 patch -s $hout < $hout.patch
43 # Modify .c file for use by LyX
44 echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $cout
45 echo "#include <config.h>" >> $cout
46 echo "#include \"lyx_gui_misc.h\"" >> $cout
47 echo "#include \"gettext.h\"" >> $cout
50 sed -f fdfixc.sed < $cin | sed -e "s/CLASSNAME/$classname/" >> $cout
52 # Patch the .C file if a patch exists
53 if [ -f "$cout.patch" ] ; then
54 echo "Patching $cout with $cout.patch"
55 patch -s $cout < $cout.patch
58 # Clean up, to leave .C and .h files