[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cross-Compiling fails due to man-page generation

From: Assaf Gordon
Subject: Cross-Compiling fails due to man-page generation
Date: Thu, 17 Jul 2014 08:58:16 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0


I've encountered a problem where GNU Hello build fails with a cross compiler, 
after the switch to non-recursive make
(of course there's no reason to need GNU hello cross-compiled, but my project 
is based on GNU hello's build system).

If I use:
    ./configure --host=arm-linux-gnueabi

Then 'make' fails in the man-page step:
    make[2]: Entering directory 
    : --include=./man/hello.x ./hello -o hello.1-t
    chmod a=r hello.1-t
    chmod: cannot access 'hello.1-t': No such file or directory
    Makefile:2605: recipe for target 'hello.1' failed
    make[2]: *** [hello.1] Error 1
    make[2]: Leaving directory 
    Makefile:1872: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory 
    Makefile:1407: recipe for target 'all' failed
    make: *** [all] Error 2
If I trace it back correctly, then "configure" has this statement:
    if test $cross_compiling = no; then :

Which makes HELP2MAN a no-op in a cross-compile, but the rule in "Makefile.am" 
    hello.1: hello
            $(HELP2MAN) --include=$(top_srcdir)/man/hello.x 
$(top_builddir)/hello -o address@hidden
            chmod a=r address@hidden
            mv -f address@hidden $@

Which assumes "HELP2MAN" will always run, and re-generate "hello.1".

I suspect this rule needs to be a bit more complicated, to accommodate few 
1. Native compiling from GIT repository, where "hello.1" doesn't exist (yet) and "hello" 
can be executed - then "hello.1" can be generated.
2. Native compiling from tarball, where "hello.1" already exists (due to 'make dist') and 
"hello" can be executed - then either re-generate "hello.1" or not ?
3. Cross-compiling from GIT repository, "hello.1" doesn't exist but "hello" *can not* be 
executed - ignore and use empty "hello.1" ?
4. Cross-compiling from tarball, where "hello.1" exists but "hello" *can not* be executed - use 
existing "hello.1" (despite it being older than "hello", which might confuse the make target?) .

The following hack "works for me", thought I haven't thoroughly tested:

    hello.1: hello
            $(HELP2MAN) --include=$(top_srcdir)/man/hello.x 
$(top_builddir)/hello -o address@hidden
            if test -e address@hidden ; then \
              chmod a=r address@hidden ;\
              mv -f address@hidden $@ ;\
            elif ! test -e $@ ; then \
              touch $@ ; \

(If the new temp man-page was created, override any existing man page. If not 
created, and no existing man page, create an empty one).

For comparison, the last tarball release of GNU Hello version 2.9 which still 
uses recursive makefiles compiles fine under cross-compiler.

Thanks for reading so far,
 - Assaf.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]