<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2005/05/d298027f22c532037195c387de551c13"
  from="Matt Gushee &lt;mgushee@h...&gt;"
  author="Matt Gushee"
  date="2005-05-30T22:50:23"
  subject="Build error w/ Findlib on Mandrake 10.1"
  prev="2005/05/7eefb30de1ae624335d93464b385be7c"
  next="2005/05/20438c0b2e980762a54275f588cde59a"
  next-in-thread="2005/05/26acbd919d9994a19cf39b010e621061"
  prev-thread="2005/05/56f407dc3d21dc1297cdb13574bdcfa5"
  next-thread="2005/05/1ca9bd6f3b9a39adfd50b76211716499"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Build error w/ Findlib on Mandrake 10.1">
<msg 
  url="2005/05/d298027f22c532037195c387de551c13"
  from="Matt Gushee &lt;mgushee@h...&gt;"
  author="Matt Gushee"
  date="2005-05-30T22:50:23"
  subject="Build error w/ Findlib on Mandrake 10.1">
<msg 
  url="2005/05/26acbd919d9994a19cf39b010e621061"
  from="Damien Bobillot &lt;damien.bobillot@m...&gt;"
  author="Damien Bobillot"
  date="2005-05-31T08:22:52"
  subject="Re: [Caml-list] Build error w/ Findlib on Mandrake 10.1">
<msg 
  url="2005/05/26ef810026c59f2797f0298a65a87a75"
  from="Matt Gushee &lt;mgushee@h...&gt;"
  author="Matt Gushee"
  date="2005-05-31T17:29:24"
  subject="Re: [Caml-list] Build error w/ Findlib on Mandrake 10.1">
</msg>
</msg>
</msg>
</thread>

<contents>
Hello, all--

A user of my Bantam file manager has reported a very strange compilation 
error:

   ocamlfind ocamlopt -package "unix str labltk" -c common.ml
   ocamlfind ocamlopt -package "unix str labltk" -c util.ml
   ocamlfind ocamlopt -package "unix str labltk" -c config.ml
   ocamlfind ocamlopt -package "unix str labltk" -c images.ml
   ocamlfind ocamlopt -package "unix str labltk" -c bantam.ml
   ocamlfind ocamlopt -package "unix str labltk" -linkpkg -o bantam.bin \
     common.cmx util.cmx config.cmx images.cmx bantam.cmx
   Cannot find file /usr/lib/ocaml//labltk/labltk.so.cmxa
   make: *** [opt] Error 2

This user is not very familiar with OCaml; he is using the Mandrake 10.1 
RPM(s).

Although I suspect there was an error on the part of whoever packaged 
OCaml (or Findlib) for Mandrake, perhaps there is an error on my part. 
Just in case, I have included my Makefiles below.

Does anyone have an idea what's wrong? I'd appreciate any suggestions.

--
Matt Gushee
Englewood, CO, USA


-- Makefile ----------------------------------------------------------
BANTAM_HOME = /usr/local
BINDIR = $(BANTAM_HOME)/bin
LIBDIR = $(BANTAM_HOME)/lib/bantam
DATADIR = $(BANTAM_HOME)/share/bantam

DEFAULT_TARGET = opt

#SRCS = bantam.ml
#BYTE_OBJS = $(SRCS:.ml=.cmo)
#NAT_OBJS = $(SRCS:.ml=.cmx)

include Makefile.build

.PHONY : all byte opt install clean test

install :
	install -d $(BINDIR)
	$$(for sub in config scripts; do \
		install -d $(DATADIR)/skeleton/$$sub; \
	done)
	install bantam.bin $(BINDIR)
	install bantam.sh $(BINDIR)/bantam
	install -m 644 skeleton/config/* $(DATADIR)/skeleton/config
	install skeleton/scripts/* $(DATADIR)/skeleton/scripts
	install -m 644 VERSION $(DATADIR)

clean :
	-rm -f *.cm? *.o *.a bantam.ml
	-rm -rf testdata

distclean : clean
	-rm -f Makefile* bantam.sh *.ml

realclean : clean
	-rm -f bantam bantam.sh bantam.bin

test :
	#export BANTAM_USER_DIR=./skeleton
	#export PATH=$$BANTAM_USER_DIR/scripts:$$PATH
	#export BANTAM_BINDIR=.
	#export BANTAM_DATA=.
	#exec bantam.bin
	cp -R skeleton testdata
	BANTAM_USER_DIR=./testdata PATH=./testdata/scripts:$$PATH \
           ./bantam.bin
-- #EOF# -------------------------------------------------------------

-- Makefile.build ----------------------------------------------------
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
OCAMLFIND = ocamlfind

BASE_SRCS = common.ml util.ml bConfig.ml images.ml
SRCS = $(BASE_SRCS) bantam_.ml
BASE_BYTE_OBJS = $(BASE_SRCS:.ml=.cmo)
BYTE_OBJS = $(BASE_BYTE_OBJS) bantam.cmo
NAT_OBJS = $(BASE_SRCS:.ml=.cmx) bantam.cmx
DEPS = "unix str labltk"

RELIEF = $(shell bash -c '\
	version=`ocamlc -version`; \
	major=$${version:0:4}; \
	minor=$${version:5}; \
	if [ $$major = "3.08" ] &amp;&amp; [ $$minor ] &amp;&amp; [ $$minor -ge 3 ]; then \
		echo "Solid"; \
	else \
		echo "Flat"; \
	fi' )

.PHONY : all byte opt install clean

all : $(DEFAULT_TARGET)

opt : $(NAT_OBJS) bantam.sh
	$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) -linkpkg -o bantam.bin 
$(NAT_OBJS)

byte : $(BYTE_OBJS) bantam.sh
	$(OCAMLFIND) $(OCAMLC) -package $(DEPS) -linkpkg -o bantam.bin $(BYTE_OBJS)

bantam.sh : bantam.sh.0 bantam.sh.2
	-rm -f bantam.sh
	cat bantam.sh.0 &gt;&gt; bantam.sh
	echo "    BANTAM_HOME=$(BANTAM_HOME)" &gt;&gt; bantam.sh
	cat bantam.sh.2 &gt;&gt; bantam.sh

bantam.cmx : bantam.ml
	#$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) \
	#	-pp "camlp4o pa_ifdef.cmo $(SOLID)" -c $&lt;
	$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) -c $&lt;

bantam.cmo : bantam.ml
	#$(OCAMLFIND) $(OCAMLC) -package $(DEPS) \
	#	-pp "camlp4o pa_ifdef.cmo $(SOLID)" -c $&lt;
	$(OCAMLFIND) $(OCAMLC) -package $(DEPS) -c $&lt;

bantam.ml : bantam_.ml
	sed "s/@RELIEF@/$(RELIEF)/" bantam_.ml &gt;bantam.ml

%.cmx : %.ml
	$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) -c $&lt;

%.cmo : %.ml
	$(OCAMLFIND) $(OCAMLC) -package $(DEPS) -c $&lt;
-- #EOF# -------------------------------------------------------------

</contents>

</message>

