From 649487fac17bfdd0bc9ef39c6e0852802669b1e6 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Wed, 7 Apr 2010 11:54:16 +0300 Subject: [PATCH] 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 --- configure.ac | 1 + doc/hlp/Makefile.am | 4 ++-- doc/hlp/es/Makefile.am | 5 +++-- doc/hlp/hu/Makefile.am | 5 +++-- doc/hlp/it/Makefile.am | 5 +++-- doc/hlp/pl/Makefile.am | 5 +++-- doc/hlp/ru/Makefile.am | 5 +++-- doc/hlp/sr/Makefile.am | 5 +++-- src/Makefile.am | 24 +++++++++--------------- src/man2hlp/Makefile.am | 6 ++++++ src/{ => man2hlp}/man2hlp.c | 2 +- 11 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 src/man2hlp/Makefile.am rename src/{ => man2hlp}/man2hlp.c (99%) diff --git a/configure.ac b/configure.ac index ed415fbec..7175e76e5 100644 --- a/configure.ac +++ b/configure.ac @@ -589,6 +589,7 @@ misc/mc.ext src/Makefile src/consaver/Makefile src/editor/Makefile +src/man2hlp/Makefile src/viewer/Makefile src/diffviewer/Makefile diff --git a/doc/hlp/Makefile.am b/doc/hlp/Makefile.am index 2d58db7da..a84d35ab4 100644 --- a/doc/hlp/Makefile.am +++ b/doc/hlp/Makefile.am @@ -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 diff --git a/doc/hlp/es/Makefile.am b/doc/hlp/es/Makefile.am index 6aaa8ef07..d9865db3e 100644 --- a/doc/hlp/es/Makefile.am +++ b/doc/hlp/es/Makefile.am @@ -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) diff --git a/doc/hlp/hu/Makefile.am b/doc/hlp/hu/Makefile.am index efccca4f3..557fd6624 100644 --- a/doc/hlp/hu/Makefile.am +++ b/doc/hlp/hu/Makefile.am @@ -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) diff --git a/doc/hlp/it/Makefile.am b/doc/hlp/it/Makefile.am index d64b2b564..c9639a41e 100644 --- a/doc/hlp/it/Makefile.am +++ b/doc/hlp/it/Makefile.am @@ -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) diff --git a/doc/hlp/pl/Makefile.am b/doc/hlp/pl/Makefile.am index c9526c5a0..e0251a152 100644 --- a/doc/hlp/pl/Makefile.am +++ b/doc/hlp/pl/Makefile.am @@ -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) diff --git a/doc/hlp/ru/Makefile.am b/doc/hlp/ru/Makefile.am index 52e236dec..60c141dd2 100644 --- a/doc/hlp/ru/Makefile.am +++ b/doc/hlp/ru/Makefile.am @@ -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) diff --git a/doc/hlp/sr/Makefile.am b/doc/hlp/sr/Makefile.am index 4204457dc..04b4277ae 100644 --- a/doc/hlp/sr/Makefile.am +++ b/doc/hlp/sr/Makefile.am @@ -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) diff --git a/src/Makefile.am b/src/Makefile.am index 9c6657cce..3b44027f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/man2hlp/Makefile.am b/src/man2hlp/Makefile.am new file mode 100644 index 000000000..7fe483604 --- /dev/null +++ b/src/man2hlp/Makefile.am @@ -0,0 +1,6 @@ +noinst_PROGRAMS = man2hlp + +man2hlp_SOURCES = man2hlp.c +man2hlp_LDADD = \ + ../../lib/libmc.la \ + $(GLIB_LIBS) $(PCRE_LIBS) diff --git a/src/man2hlp.c b/src/man2hlp/man2hlp.c similarity index 99% rename from src/man2hlp.c rename to src/man2hlp/man2hlp.c index e7066fbc7..ab8a7ebac 100644 --- a/src/man2hlp.c +++ b/src/man2hlp/man2hlp.c @@ -32,7 +32,7 @@ #include -#include "help.h" +#include "../help.h" #define BUFFER_SIZE 256