You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.7 KiB
59 lines
1.7 KiB
From 4a69a323aee9d7ab913a8665cddbc63b98804be0 Mon Sep 17 00:00:00 2001
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
Date: Thu, 20 Sep 2018 13:47:34 +0100
|
|
Subject: [PATCH 21/23] build: Pass through CFLAGS and LDFLAGS to ocaml
|
|
compiler (RHBZ#1630636).
|
|
|
|
---
|
|
configure.ac | 4 ++++
|
|
src/Makefile.in | 6 ++----
|
|
2 files changed, 6 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index c9c7e34..a8e757c 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -76,6 +76,10 @@ AC_CHECK_PROG(OCAML_GETTEXT,ocaml-gettext,ocaml-gettext)
|
|
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])
|
|
diff --git a/src/Makefile.in b/src/Makefile.in
|
|
index 03c6362..ba4eb1d 100644
|
|
--- a/src/Makefile.in
|
|
+++ b/src/Makefile.in
|
|
@@ -64,8 +64,8 @@ OBJS += main.cmo
|
|
|
|
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)
|
|
@@ -85,13 +85,11 @@ opt: $(OPT_TARGETS)
|
|
|
|
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.
|
|
--
|
|
2.31.1
|
|
|