summaryrefslogtreecommitdiff
path: root/debian/patches/0001-Fix-camlp4of.opt-detection-in-configure.patch
blob: d4afd4aaa6df285f24e5f87ea87f776f58a5ed42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From: Sylvain Le Gall <gildor@debian.org>
Date: Sat, 4 Jul 2009 21:05:17 +0000
Subject: Fix camlp4of.opt detection in configure

Signed-off-by: Sylvain Le Gall <gildor@debian.org>
---
 configure    |   50 ++++++++++++++++++++++++++++++++++++++++++++++----
 configure.ac |    6 +++++-
 2 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 7f5fa37..9587336 100755
--- a/configure
+++ b/configure
@@ -643,6 +643,7 @@ DIFF
 TIME
 OCAML_PKG_cil
 OCAML_PKG_extlib
+CAMLP4OFOPT
 CAMLP4OF
 OCAMLFIND
 OCAMLBUILD
@@ -5295,8 +5296,8 @@ $as_echo "$as_me: error: You must have ocaml and findlib installed" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-# Extract the first word of "camlp4of.opt", so it can be a program name with args.
-set dummy camlp4of.opt; ac_word=$2
+# Extract the first word of "camlp4of", so it can be a program name with args.
+set dummy camlp4of; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CAMLP4OF+set}" = set; then
@@ -5312,7 +5313,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CAMLP4OF="camlp4of.opt"
+    ac_cv_prog_CAMLP4OF="camlp4of"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -5333,8 +5334,49 @@ $as_echo "no" >&6; }
 fi
 
 
+# Extract the first word of "camlp4of.opt", so it can be a program name with args.
+set dummy camlp4of.opt; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CAMLP4OFOPT+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CAMLP4OFOPT"; then
+  ac_cv_prog_CAMLP4OFOPT="$CAMLP4OFOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CAMLP4OFOPT="camlp4of.opt"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_CAMLP4OFOPT" && ac_cv_prog_CAMLP4OFOPT="no"
+fi
+fi
+CAMLP4OFOPT=$ac_cv_prog_CAMLP4OFOPT
+if test -n "$CAMLP4OFOPT"; then
+  { $as_echo "$as_me:$LINENO: result: $CAMLP4OFOPT" >&5
+$as_echo "$CAMLP4OFOPT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if ! test "x$CAMLP4OFOPT" = "xno"; then
+  CAMLP4OF=$CAMLP4OFOPT
+fi
 if test "x$CAMLP4OF" = "xno"; then
-    { { $as_echo "$as_me:$LINENO: error: You must have camlp4 installed" >&5
+  { { $as_echo "$as_me:$LINENO: error: You must have camlp4 installed" >&5
 $as_echo "$as_me: error: You must have camlp4 installed" >&2;}
    { (exit 1); exit 1; }; }
 fi
diff --git a/configure.ac b/configure.ac
index 174ed8c..c72bdb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,11 @@ if test "x$OCAMLFIND" = "x"; then
 fi
 
 dnl Check for camlp4
-AC_CHECK_PROG(CAMLP4OF,camlp4of.opt,camlp4of.opt,no)
+AC_CHECK_PROG(CAMLP4OF,camlp4of,camlp4of,no)
+AC_CHECK_PROG(CAMLP4OFOPT,camlp4of.opt,camlp4of.opt,no)
+if ! test "x$CAMLP4OFOPT" = "xno"; then
+  CAMLP4OF=$CAMLP4OFOPT
+fi
 if test "x$CAMLP4OF" = "xno"; then
     AC_MSG_ERROR([You must have camlp4 installed])
 fi
--