Ticket #45: Build system does not allow cross compiling

The man2hlp program is build using the target compiler. The
resulting executable therefore does not work on the build host.
Since the man2hlp program is needed during compile time, the build
will fail.

Moved man2hlp into separate subdir

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2010-04-07 11:54:16 +03:00
parent b6d4862b63
commit 649487fac1
11 changed files with 37 additions and 30 deletions

View File

@ -589,6 +589,7 @@ misc/mc.ext
src/Makefile
src/consaver/Makefile
src/editor/Makefile
src/man2hlp/Makefile
src/viewer/Makefile
src/diffviewer/Makefile

View File

@ -6,5 +6,5 @@ pkgdata_DATA = mc.hlp
EXTRA_DIST = xnc.hlp
CLEANFILES = $(pkgdata_DATA)
mc.hlp: $(top_builddir)/doc/man/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp
- $(top_builddir)/src/man2hlp $(top_builddir)/doc/man/mc.1 $(srcdir)/xnc.hlp mc.hlp
mc.hlp: $(top_builddir)/doc/man/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp/man2hlp
- $(top_builddir)/src/man2hlp/man2hlp $(top_builddir)/doc/man/mc.1 $(srcdir)/xnc.hlp mc.hlp

View File

@ -1,8 +1,9 @@
LANG=es
MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp
pkgdata_DATA = mc.hlp.$(LANG)
EXTRA_DIST = xnc.hlp
CLEANFILES = $(pkgdata_DATA)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp
- $(top_builddir)/src/man2hlp $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP)
- $(MAN2HLP) $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)

View File

@ -1,8 +1,9 @@
LANG=hu
MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp
pkgdata_DATA = mc.hlp.$(LANG)
EXTRA_DIST = xnc.hlp
CLEANFILES = $(pkgdata_DATA)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp
- $(top_builddir)/src/man2hlp $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP)
- $(MAN2HLP) $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)

View File

@ -1,8 +1,9 @@
LANG=it
MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp
pkgdata_DATA = mc.hlp.$(LANG)
EXTRA_DIST = xnc.hlp
CLEANFILES = $(pkgdata_DATA)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp
- $(top_builddir)/src/man2hlp $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP)
- $(MAN2HLP) $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)

View File

@ -1,8 +1,9 @@
LANG=pl
MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp
pkgdata_DATA = mc.hlp.$(LANG)
EXTRA_DIST = xnc.hlp
CLEANFILES = $(pkgdata_DATA)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp
- $(top_builddir)/src/man2hlp $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP)
- $(MAN2HLP) $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)

View File

@ -1,8 +1,9 @@
LANG=ru
MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp
pkgdata_DATA = mc.hlp.$(LANG)
EXTRA_DIST = xnc.hlp
CLEANFILES = $(pkgdata_DATA)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp
- $(top_builddir)/src/man2hlp $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP)
- $(MAN2HLP) $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)

View File

@ -1,8 +1,9 @@
LANG=sr
MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp
pkgdata_DATA = mc.hlp.$(LANG)
EXTRA_DIST = xnc.hlp
CLEANFILES = $(pkgdata_DATA)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp
- $(top_builddir)/src/man2hlp $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)
mc.hlp.$(LANG): $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP)
- $(MAN2HLP) $(top_builddir)/doc/man/$(LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(LANG)

View File

@ -1,4 +1,4 @@
SUBDIRS = viewer
SUBDIRS = man2hlp viewer
if USE_EDIT
SUBDIRS += editor
@ -25,16 +25,8 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@
bin_PROGRAMS = mc mcmfmt
noinst_PROGRAMS = man2hlp
mcmfmt_SOURCES = mfmt.c
man2hlp_SOURCES = man2hlp.c
man2hlp_LDADD = \
../lib/libmc.la \
$(GLIB_LIBS) $(PCRE_LIBS)
if USE_EDIT
EDITLIB = editor/libedit.la
endif
@ -53,10 +45,9 @@ endif
mc_LDADD = \
../lib/libmc.la \
viewer/libmcviewer.la \
$(EDITLIB) \
$(DIFFLIB) \
$(INTLLIBS) $(MCLIBS) $(SLANGLIB) $(LIBICONV) \
$(GLIB_LIBS) $(PCRE_LIBS)
$(MCLIBS) $(DIFFLIB) $(EDITLIB) $(SLANGLIB) \
$(GLIB_LIBS) $(PCRE_LIBS) \
$(LIBICONV) $(INTLLIBS)
if USE_SAMBA_FS
# this is a hack for linking with own samba library in simple way
@ -115,14 +106,17 @@ mc_SOURCES = \
listmode.c listmode.h \
main.c main.h \
main-widgets.h \
mountlist.c mountlist.h \
panelize.c panelize.h \
subshell.c subshell.h \
textconf.c textconf.h \
treestore.c treestore.h \
user.c user.h
EXTRA_DIST = man2hlp.c $(SRC_maintainer) $(SRC_charset)
#if USE_MOUNTLIST
mc_SOURCES += mountlist.c mountlist.h
#endif
EXTRA_DIST = $(SRC_maintainer) $(SRC_charset)
# end of automated testing

6
src/man2hlp/Makefile.am Normal file
View File

@ -0,0 +1,6 @@
noinst_PROGRAMS = man2hlp
man2hlp_SOURCES = man2hlp.c
man2hlp_LDADD = \
../../lib/libmc.la \
$(GLIB_LIBS) $(PCRE_LIBS)

View File

@ -32,7 +32,7 @@
#include <glib.h>
#include "help.h"
#include "../help.h"
#define BUFFER_SIZE 256