Skip to content
  • Alexandre Rostovtsev's avatar
    Fix implicit function declarations, bug 660531 · 75e6aac1
    Alexandre Rostovtsev authored and David King's avatar David King committed
    Fix numerous vinagre_utils_* and vinagre_dirs_* implicit function
    declarations by generating a header (vinagre/vinagre-vala.h) from the
    vala source and including it in half the .c files in the source tree.
    
    Add the vinagre-vala.h to dist_noinst_DATA to make sure it goes in the
    release tarballs, and to BUILT_SOURCES to ensure that it is generated
    before the C sources that #include it are compiled. Add
    -I$(top_srcdir)/vinagre to CPPFLAGS so that vinagre-vala.h is picked up
    in out-of-tree builds.
    
    Unfortunately, automake does not support per-target VALAFLAGS. We cannot
    simply add a "--header vinagre/vinagre-vala.h" option to AM_VALAFLAGS
    or VALAFLAGS because if we ever use a .vala file in another target (such
    as one of the vinagre plugins), vinagre-vala.h will get clobbered.
    
    The only way to prevent valac from running multiple times and safely
    support parallel make without adding a ticking time bomb that could
    clobber vinagre-vala.h is to manually write a stamp target for the vala
    sources used in libvinagre, and manually pass a --header argument to
    valac in the rule for the stamp.
    
    Pick "vinagre_vala.stamp" as the name for it to avoid potential
    collisions with automake's vala stamp naming conventions, and make sure
    to add the stamp to dist_noinst_DATA so that people who download the
    source tarball are not forced to use vala to build vinagre.
    
    Also, add an explicit rule for generating vinagre-vala.h for those who
    do not have it and are building from git (otherwise, make will fail due
    to the presense of vinagre-vala.h in dist_noinst_DATA).
    
    Since vala sources are not in vinagre_vinagre_SOURCES any more, we have
    to add them to dist_noinst_DATA so that they are added to release
    tarballs.
    75e6aac1