lablgtk-extras (1.0-1) 0002-Fix-compilation-on-bytecode-only-architectures.patch

Summary

 src/Makefile |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

    
download this patch

Patch contents

From: Stephane Glondu <steph@glondu.net>
Date: Sat, 10 Sep 2011 17:04:34 +0200
Subject: Fix compilation on bytecode-only architectures

Forwarded: no
Signed-off-by: Stephane Glondu <steph@glondu.net>
---
 src/Makefile |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 17d37d8..90d6d1e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -25,6 +25,7 @@
 #################################################################################
 
 include ../master.Makefile
+include /usr/share/ocaml/ocamlvars.mk
 
 MY_INCLUDES=
 SYSTEM_INCLUDES= $(LABLGTK2_INCLUDES)
@@ -57,7 +58,15 @@ CWLIB_CMOFILES=configwin_keys.cmo \
 CWLIB_CMIFILES=$(CWLIB_CMOFILES:.cmo=.cmi)
 CWLIB_CMXFILES=$(CWLIB_CMOFILES:.cmo=.cmx)
 
-all: byte opt
+ALL_TARGETS := byte
+LIB_FILES_TO_INSTALL := $(GELIB_BYTE) $(GELIB_CMIFILES) $(GELIB_CMOFILES) $(GELIB_CMIFILES:.cmi=.mli) $(CWLIB_BYTE) $(CWLIB:.cmxa=.cmi) $(CWLIB:.cmxa=.mli)
+
+ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
+  ALL_TARGETS += opt
+  LIB_FILES_TO_INSTALL += $(GELIB) $(GELIB:.cmxa=.a) $(GELIB_CMXFILES) $(GELIB_CMXFILES:.cmx=.o) $(CWLIB) $(CWLIB:.cmxa=.a)
+endif
+
+all: $(ALL_TARGETS)
 opt: $(GELIB) $(CWLIB)
 byte:  $(GELIB_BYTE) $(CWLIB_BYTE)
 
@@ -102,10 +111,7 @@ dummy:
 
 install:
 	$(MKDIR) $(BINDIR) $(LIBDIR) $(DATADIR)
-	$(CP) $(GELIB) $(GELIB_BYTE) $(GELIB:.cmxa=.a) $(GELIB_CMIFILES) \
-	$(GELIB_CMOFILES) $(GELIB_CMXFILES) \
-	$(GELIB_CMXFILES:.cmx=.o) $(GELIB_CMIFILES:.cmi=.mli) $(LIBDIR)/
-	$(CP) $(CWLIB) $(CWLIB_BYTE) $(CWLIB:.cmxa=.a) $(CWLIB:.cmxa=.cmi) $(CWLIB:.cmxa=.mli) $(LIBDIR)/
+	$(CP) $(LIB_FILES_TO_INSTALL) $(LIBDIR)/
 
 #	$(CP) gtk/ge.glade $(DATADIR)/
 #	$(CP) $(TOOLS) $(TOOLS_BYTE) $(BINDIR)/
--