* forms/Makefile.am: make the .Ch files dependent on the fdfix files.
+ * fdfix.sh: test whether "fdesign -convert file.fd" succeeds and
+ if not, exit gracefully.
+ Test whether the newly generated .h file is different from the existing
+ one and if not discard it to prevent unnecessary recompilation in the
+ xforms directory.
+
2002-06-14 Angus Leeming <leeming@lyx.org>
* FormPreferences (XYZ::build): pass "&parent_" to build_xyz, not
FormXyz class. It's unnecessary and needs patch files in addition to
the sed magic to work properly. Thus, the structs above are now
generated by routines
- FD_aboutlyx * build_aboutlyx();
- FD_aboutlyx_version * build_aboutlyx_version();
- FD_aboutlyx_credits * build_aboutlyx_credits();
- FD_aboutlyx_license * build_aboutlyx_license();
+ FD_aboutlyx * build_aboutlyx(void *);
+ FD_aboutlyx_version * build_aboutlyx_version(void *);
+ FD_aboutlyx_credits * build_aboutlyx_credits(void *);
+ FD_aboutlyx_license * build_aboutlyx_license(void *);
* forms/README: document all the above.
build_xxx that will need no further editing to make them work. For example,
form_graphics.h contains the struct declarations and build methods, so:
-extern FD_graphics * build_graphics();
-extern FD_graphics_file * build_graphics_file();
-extern FD_graphics_size * build_graphics_size();
-extern FD_graphics_bbox * build_graphics_bbox();
-extern FD_graphics_special * build_graphics_special();
-extern FD_graphics_lyxview * build_graphics_lyxview();
+extern FD_graphics * build_graphics(void *);
+extern FD_graphics_file * build_graphics_file(void *);
+extern FD_graphics_size * build_graphics_size(void *);
+extern FD_graphics_bbox * build_graphics_bbox(void *);
+extern FD_graphics_special * build_graphics_special(void *);
+extern FD_graphics_lyxview * build_graphics_lyxview(void *);
+
+where the function is to be passed a pointer to the parent dialog
+(usually "this") so that this pointer can be cast of to FormBase * and
+the appropriate method called.
FDESIGN=fdesign
FDFILE=${BASENAME}.fd
(cd ${DIRNAME}; ${FDESIGN} -convert ${FDFILE})
+if [ $? -ne 0 ]; then
+ echo "\"${FDESIGN} -convert ${FDFILE}\" failed. Please investigate."
+ exit 1
+fi
#==================================
# Modify the .h file for use by LyX
patch -s ${HOUT} < ${HPATCH}
fi
-# Clean up, to leave the finished .h file
+# Clean up, to leave the finished .h file. We can be a little tricky here
+# testing to see if the finished file exists already and if it does
+# testing whether there are any differences.
+# If there are no differences, then don't overwrite to prevent unnecessary
+# compilation in the xforms directory.
rm -f ${HIN}
-mv ${HOUT} ${BASENAME}.h
+MOVE_H_FILE=1
+if [ -r ${BASENAME}.h ]; then
+ cmp -s ${HOUT} ${BASENAME}.h
+ if [ $? -eq 0 ]; then
+ MOVE_H_FILE=0
+ fi
+fi
+if [ ${MOVE_H_FILE} -eq 1 ]; then
+ mv ${HOUT} ${BASENAME}.h
+else
+ rm -f ${HOUT}
+fi
#==================================
# Create the .C file for use by LyX