[Openmcl-devel] buglet in h-to-ffi.sh

rm at fabula.de rm at fabula.de
Tue Dec 7 05:51:07 PST 2004


Just stumnled over a small bug in h-to-ffi.sh - the following
lines will create unexpected results when the header file
is in the curren directory:

 mkdir -p .`dirname ${1}`
 OFILE=.`dirname ${1}`/`basename ${1} .h`.ffi
 IFILE=.`dirname ${1}`/`basename ${1} .h`.i

A call like 'h-to-ffi.sh ./gtk2-wrapper.h' will result in
interface files generated in the parent directory, probably
not what should happen.

Here's a quick patch:

--- h-to-ffi.sh_orig    2004-12-07 15:34:52.105323552 +0100
+++ h-to-ffi.sh 2004-12-07 15:37:35.212527488 +0100
@@ -10,9 +10,13 @@
 done
 
 echo +++ ${1}
-mkdir -p .`dirname ${1}`
-OFILE=.`dirname ${1}`/`basename ${1} .h`.ffi
-IFILE=.`dirname ${1}`/`basename ${1} .h`.i
+
+DIR=`dirname i${1}`
+BASE=`basename ${1} .h`
+
+mkdir -p ./${DIR}
+OFILE=./${DIR}/${BASE}.ffi
+IFILE=./${DIR}/${BASE}.i
 
 ((${PREPROCESS} ${CFLAGS}  ${1} -o ${IFILE}) && (${GEN} < ${IFILE} > ${OFILE})) || rm -f ${OFILE}
 rm -f ${IFILE}


HTH Ralf Mattes



More information about the Openmcl-devel mailing list