summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2015-03-25 12:44:05 +1300
committerOlly Betts <olly@survex.com>2015-03-25 12:44:05 +1300
commit226b4dec5b47e93bf4cf216a532e14de4f0c7cab (patch)
tree064e7a4468089754c7aaaf270f2b1fd07cdd28c2
parent4c6f29b778ded95b0f9b37983ff2a315e0673986 (diff)
downloadswig-226b4dec5b47e93bf4cf216a532e14de4f0c7cab.tar.gz
Probe for camlp4 in configure
See issue #364.
-rw-r--r--Examples/Makefile.in2
-rw-r--r--configure.ac7
2 files changed, 8 insertions, 1 deletions
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index ee7d5f431..6a29e9087 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -883,7 +883,7 @@ OCAMLFIND=@OCAMLFIND@
OCAMLMKTOP=@OCAMLMKTOP@ $(SWIGWHERE)
NOLINK ?= false
OCAMLPP= -pp "camlp4o ./swigp4.cmo"
-OCAMLP4WHERE=`$(COMPILETOOL) camlp4 -where`
+OCAMLP4WHERE=`$(COMPILETOOL) @CAMLP4@ -where`
OCAMLCORE=\
rm -rf swig.mli swig.ml swigp4.ml && \
$(SWIG) -ocaml -co swig.mli 2>/dev/null && \
diff --git a/configure.ac b/configure.ac
index 31815411f..dfd874b75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1750,6 +1750,7 @@ AC_ARG_WITH(ocamlc,[ --with-ocamlc=path Set location of ocamlc executable]
AC_ARG_WITH(ocamldlgen,[ --with-ocamldlgen=path Set location of ocamldlgen],[ OCAMLDLGEN="$withval" ], [OCAMLDLGEN=])
AC_ARG_WITH(ocamlfind,[ --with-ocamlfind=path Set location of ocamlfind],[OCAMLFIND="$withval"],[OCAMLFIND=])
AC_ARG_WITH(ocamlmktop,[ --with-ocamlmktop=path Set location of ocamlmktop executable],[ OCAMLMKTOP="$withval"], [OCAMLMKTOP=])
+AC_ARG_WITH(camlp4,[ --with-camlp4=path Set location of camlp4 executable],[ CAMLP4="$withval"], [CAMLP4=])
# First, check for "--without-ocaml" or "--with-ocaml=no".
if test x"${with_ocaml}" = xno -o x"${with_alllang}" = xno ; then
@@ -1775,12 +1776,18 @@ else
if test -z "$OCAMLMKTOP"; then
AC_CHECK_PROGS(OCAMLMKTOP, ocamlmktop, :)
fi
+
+ AC_MSG_CHECKING(for Ocaml Pre-Processor-Pretty-Printer)
+ if test -z "$CAMLP4"; then
+ AC_CHECK_PROGS(CAMLP4, camlp4, :)
+ fi
fi # Disabling ocaml
AC_SUBST(OCAMLC)
AC_SUBST(OCAMLDLGEN)
AC_SUBST(OCAMLFIND)
AC_SUBST(OCAMLMKTOP)
+AC_SUBST(CAMLP4)
#----------------------------------------------------------------
# Look for Pike