Re: XForms: autoconf/automake patch

From: Angus Leeming (angus.leeming@btopenworld.com)
Date: Thu Apr 24 2003 - 05:37:13 EDT

  • Next message: Angus Leeming: "Re: XForms: Xforms updates and stuff."

    # To subscribers of the xforms list from Angus Leeming <angus.leeming@btopenworld.com> :

    On Wednesday 23 April 2003 9:58 pm, Lars Gullik Bjønnes wrote:
    > Angus Leeming <angus.leeming@btopenworld.com> writes:
    > | In order for things to work properly, I find that I had to change the
    > | forms.h target to ../forms.h. Otherwise "make dist" copies across
    > | lib/include/forms.h but not lib/forms.h and so make in the lib dir fails.
    > | Obviously, I could add appropriate -I targets to the INCLUDE directive or
    > | modify all the .c files to look for include/forms.h, but altering the
    > | target seems the cleanest solution.
    >
    > This I do not quite understand.

    I'll try and explain (took me some time to figure out what was going on).

    The original code had

    forms.h: $(noinst_HEADERS)
            @rm -f $@
            @for i in $(noinst_HEADERS); do \
                    sed "1,/crop here for forms/d" ${srcdir}/$$i >> $@; \
            done
            cmp -s $@ ../forms.h; \
            if [ $$? -ne 0 ]; then \
                    cp $@ ../.; \
                    echo created new forms.h; \
            fi

    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.
    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). 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.

    Regards,
    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:34:48 EDT