dnl Check for msgfmt tool.
AC_CHECK_PROG(MSGFMT,msgfmt,msgfmt)
+dnl Substitute CFLAGS and LDFLAGS if set.
+AC_SUBST([CFLAGS])
+AC_SUBST([LDFLAGS])
+
dnl Write gettext modules for the programs.
dnl http://www.le-gall.net/sylvain+violaine/documentation/ocaml-gettext/html/reference-manual/ch03s04.html
AC_MSG_NOTICE([creating src/opt_gettext.ml])
XOBJS := $(OBJS:.cmo=.cmx)
-OCAMLCFLAGS := -g -warn-error CDEFLMPSUVYZX-3
-OCAMLCLIBS := -linkpkg
+OCAMLCFLAGS := -g -warn-error CDEFLMPSUVYZX-3 -ccopt '@CFLAGS@'
+OCAMLCLIBS := -linkpkg -runtime-variant _pic -cclib '@LDFLAGS@'
OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
OCAMLOPTFLAGS := $(OCAMLCFLAGS)
virt-top: $(OBJS)
ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
- -runtime-variant _pic \
-o $@ $^
virt-top.opt: $(XOBJS)
ocamlfind ocamlopt \
$(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
- -runtime-variant _pic \
-o $@ $^
# Manual page.