# To subscribers of the xforms list from Angus Leeming <angus.leeming@btopenworld.com> :
On Thursday 24 April 2003 8:46 am, Lars Gullik Bjønnes wrote:
> | The way BUILT_SOURCES works, it is invoked on "make all". Thus all is
> | fine when performing a "normal" make. The file is generated and a copy is
> | moved to ../. It is this copy (in the lib dir) that is #included by the
> | .c files.
>
> Ok, I belive this to be a mistake if all the other c files in the lib
> includes forms.h and not the individual .h files. IMHO forms.h should
> only be used by non-lib code.
Possibly. Probably even. But let's do one thing at a time.
> | However, things screw up if we first "make distdir". The code above is
> | invoked _first_, then the directory is created and stuff copied across.
> | forms.h is copied across fine, but ../forms.h is not (automake knows
> | nothing about that file).
>
> EXTRA_DIST?
Can you use that for generated files?
> | Hence, when we perform the subsequent build, things fail
> | when we try and #include "forms.h" because we look only in lib, not
> | lib/include.
> |
> | Changing the target from form.h to ../forms.h therefore resolves the
> | problem cleanly.
>
> In a dirty way.
I'm not so sure that it is dirty. Currently we generate lib/include/forms.h
and lib/forms.h. I don't see the point in two identical copies.
If we keep forms.h in lib/include, then we need to tell the .c files where to
find it. Something like:
for file in */*.c; do
grep "^#include \"forms\.h\"" > /dev/null $file || continue
sed 's/^\(#include \"\)\(forms\.h\"\)/\1include/\2/' $file > tmp
cmp -s $file tmp && continue
diff -u $file tmp
mv -i tmp $file
done
rm -f tmp
This seems like the cleanest solution. We can think about #including only the
relevant bits thereafter.
Angus
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/
Development: http://savannah.nongnu.org/files/?group=xforms
This archive was generated by hypermail 2b29 : Thu Apr 24 2003 - 04:58:25 EDT