Skip to content

Commit e9b8660

Browse files
committed
Add COQBIN to configure.ac
- A COQBIN variable, if set and non-null is prepended to the PATH in configure.ac. The variables COQC, COQDOC and COQTOP now contain an absolute path. - In this case, if the OCAMLPATH variable is not set, a warning is emitted during ./configure (because the user probably wants the coq ml libs to be those corresponding to its current coq build) - Other cleaning made in Makefile.in, using variables COQC COQTOP and COQDOC rather than fixed commands. - `make archi_clean` now cleans more - small addition in .gitignore (swap files for vim)
1 parent 7ac1461 commit e9b8660

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config.status
2828
*.vo
2929
*.vok
3030
*.vos
31+
.*.swp
3132

3233
coqthmdep
3334
dpd2dot

Makefile.in

+12-9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ OCAMLFLAGS += $(OCAML_EXTRA_OPTS)
6262
OCAMLOPTFLAGS = -c
6363

6464
COQ_MAKEFILE=@COQ_MAKEFILE@
65+
COQTOP=@COQTOP@
66+
COQC=@COQC@
67+
COQDOC=@COQDOC@
6568
# COQDEP=$(OCAMLDEP)
6669

6770
COQEXTFILES=searchdepend.mlg graphdepend.mlg
@@ -190,38 +193,38 @@ $(TESTDIR)/%.err.log: $(TESTDIR)/%.err.dpd $(DPD2DOT)
190193
cp $< $@
191194

192195
%.vo : %.v
193-
coqc -q -R . dpdgraph $<
196+
$(COQC) -q -R . dpdgraph $<
194197

195198
%.html : %.v
196-
coqdoc $<
199+
$(COQDOC) $<
197200

198201
%.svg : %.dot
199202
dot -Tsvg -o$@ $<
200203

201204
$(TESTDIR)/Morph%.dpd : $(TESTDIR)/Morph.vo $(TESTDIR)/Morph.cmd $(DPDPLUGIN)
202205
# cd to tests to generate .dpd file there.
203-
cd $(TESTDIR); coqtop -R .. dpdgraph -I .. < Morph.cmd > /dev/null 2>&1
206+
cd $(TESTDIR); $(COQTOP) -R .. dpdgraph -I .. < Morph.cmd > /dev/null 2>&1
204207

205208
$(TESTDIR)/Polymorph%.dpd : $(TESTDIR)/Polymorph.vo $(TESTDIR)/Polymorph.cmd \
206209
$(DPDPLUGIN)
207-
cd $(TESTDIR); coqtop -R .. dpdgraph -I .. < Polymorph.cmd
210+
cd $(TESTDIR); $(COQTOP) -R .. dpdgraph -I .. < Polymorph.cmd
208211

209212
$(TESTDIR)/graph.dpd $(TESTDIR)/graph2.dpd: \
210213
$(TESTDIR)/Test.vo $(TESTDIR)/Test.cmd $(DPDPLUGIN)
211214
# cd to tests to generate .dpd file there.
212-
cd $(TESTDIR); coqtop -R .. dpdgraph -I .. < Test.cmd > /dev/null 2>&1
215+
cd $(TESTDIR); $(COQTOP) -R .. dpdgraph -I .. < Test.cmd > /dev/null 2>&1
213216

214217
$(TESTDIR)/PrimitiveProjections.dpd $(TESTDIR)/PrimitiveProjections2.dpd: \
215218
$(TESTDIR)/PrimitiveProjections.vo $(TESTDIR)/PrimitiveProjections.cmd $(DPDPLUGIN)
216219
# cd to tests to generate .dpd file there.
217-
cd $(TESTDIR); coqtop -R .. dpdgraph -I .. < PrimitiveProjections.cmd > /dev/null 2>&1
220+
cd $(TESTDIR); $(COQTOP) -R .. dpdgraph -I .. < PrimitiveProjections.cmd > /dev/null 2>&1
218221

219222
%.dpd : %.vo %.cmd
220223
# cd to tests to generate .dpd file there.
221-
cd $(TESTDIR); coqtop -R .. dpdgraph -I .. < $(*F).cmd > /dev/null 2>&1
224+
cd $(TESTDIR); $(COQTOP) -R .. dpdgraph -I .. < $(*F).cmd > /dev/null 2>&1
222225

223226
$(TESTDIR)/search.log : $(TESTDIR)/Test.vo $(TESTDIR)/search.cmd $(DPDPLUGIN)
224-
cat $(TESTDIR)/search.cmd | coqtop -R . dpdgraph -I . 2> /dev/null \
227+
cat $(TESTDIR)/search.cmd | $(COQTOP) -R . dpdgraph -I . 2> /dev/null \
225228
| sed -e 's/Welcome to Coq.*/Welcome to Coq/' > $@
226229

227230
%.dot : %.dpd $(DPD2DOT)
@@ -292,7 +295,7 @@ clean_test :
292295
clean_config:
293296
rm -rf autom4te.cache
294297
rm -f configure config.log config.status
295-
rm -r Makefile
298+
rm -rf Makefile Make_coq.conf .Make_coq.d Make_coq
296299

297300
clean : clean_coq clean_test
298301
rm -f $(GENERATED)

configure.ac

+31-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# will set several variables: (see AC_SUBST at the end of this file)
1111
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1212

13-
AC_INIT(coq-dpdgraph,1.0)
13+
AC_INIT([coq-dpdgraph],[1.0])
1414
AC_MSG_NOTICE(AC_PACKAGE_NAME version AC_PACKAGE_VERSION)
1515

1616
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -174,7 +174,20 @@ fi
174174
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175175
new_section "Coq"
176176

177-
AC_CHECK_PROG(COQC,coqc,coqc,no)
177+
#AC_ARG_VAR(COQBIN, [path to Coq executables [empty]])
178+
#if test ${COQBIN##*/}; then COQBIN=$COQBIN/; fi
179+
#AC_MSG_RESULT($COQBIN)
180+
181+
if test "a$COQBIN" != "a"; then
182+
PATH="$COQBIN:$PATH";
183+
if test "a$OCAMLPATH" = "a"; then
184+
AC_MSG_WARN(You set COQBIN but not OCAMLPATH.)
185+
AC_MSG_WARN(You may want to consider adding:)
186+
AC_MSG_WARN(export OCAMLPATH='${COQBIN%/*/}/lib')
187+
fi
188+
fi
189+
190+
AC_PATH_PROG(COQC,coqc,[no], [$PATH])
178191
if test "$COQC" = no ; then
179192
AC_MSG_ERROR(Cannot find coqc.)
180193
fi
@@ -183,19 +196,28 @@ AC_MSG_CHECKING(coq version)
183196
COQVERSION=$($COQC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' )
184197
AC_MSG_RESULT($COQVERSION)
185198

199+
AC_PATH_PROG(COQTOP,coqtop,[no], [$PATH])
200+
if test "$COQTOP" = no ; then
201+
AC_MSG_ERROR(Cannot find coqtop.)
202+
fi
203+
204+
AC_PATH_PROG(COQDOC,coqdoc,[no], [$PATH])
205+
if test "$COQDOC" = no ; then
206+
AC_MSG_ERROR(Cannot find coqdoc.)
207+
fi
208+
186209
case $COQVERSION in
187210
8.[[0-9]][[^0-9]]*|8.10*)
188211
AC_MSG_ERROR(AC_PACKAGE_NAME needs Coq version 8.11 or higher)
189212
;;
190213
esac
191214

192-
AC_CHECK_PROG(COQ_MAKEFILE,coq_makefile,coq_makefile,no)
215+
AC_PATH_PROG(COQ_MAKEFILE,coq_makefile,no, [$PATH])
193216
if test "$COQ_MAKEFILE" = no ; then
194217
AC_MSG_ERROR(cannot find coq_makefile.)
195218
fi
196219

197-
BINDIR_PRE=$(which coqc)
198-
BINDIR=$(dirname $BINDIR_PRE)
220+
BINDIR=$(dirname $COQC)
199221

200222
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201223
new_section "creating Makefile"
@@ -216,13 +238,16 @@ AC_SUBST(OCAMLYACC)
216238
AC_SUBST(OCAML_EXTRA_OPTS)
217239

218240
AC_SUBST(COQC)
241+
AC_SUBST(COQTOP)
242+
AC_SUBST(COQDOC)
219243
AC_SUBST(COQ_MAKEFILE)
220244

221245
AC_SUBST(BINDIR)
222246
AC_SUBST(OCAMLGRAPH_PATH)
223247

224248
# Finally create the Makefile from Makefile.in
225-
AC_OUTPUT(Makefile)
249+
AC_CONFIG_FILES([Makefile])
250+
AC_OUTPUT
226251
chmod a-w Makefile
227252

228253
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)