Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add COQBIN to configure.ac #128

Open
wants to merge 1 commit into
base: coq-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ config.status
*.vo
*.vok
*.vos
.*.swp

coqthmdep
dpd2dot
Expand Down
21 changes: 12 additions & 9 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ OCAMLFLAGS += $(OCAML_EXTRA_OPTS)
OCAMLOPTFLAGS = -c

COQ_MAKEFILE=@COQ_MAKEFILE@
COQTOP=@COQTOP@
COQC=@COQC@
COQDOC=@COQDOC@
# COQDEP=$(OCAMLDEP)

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

%.vo : %.v
coqc -q -R . dpdgraph $<
$(COQC) -q -R . dpdgraph $<

%.html : %.v
coqdoc $<
$(COQDOC) $<

%.svg : %.dot
dot -Tsvg -o$@ $<

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

$(TESTDIR)/Polymorph%.dpd : $(TESTDIR)/Polymorph.vo $(TESTDIR)/Polymorph.cmd \
$(DPDPLUGIN)
cd $(TESTDIR); coqtop -R .. dpdgraph -I .. < Polymorph.cmd
cd $(TESTDIR); $(COQTOP) -R .. dpdgraph -I .. < Polymorph.cmd

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

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

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

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

%.dot : %.dpd $(DPD2DOT)
Expand Down Expand Up @@ -292,7 +295,7 @@ clean_test :
clean_config:
rm -rf autom4te.cache
rm -f configure config.log config.status
rm -r Makefile
rm -rf Makefile Make_coq.conf .Make_coq.d Make_coq

clean : clean_coq clean_test
rm -f $(GENERATED)
Expand Down
37 changes: 31 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# will set several variables: (see AC_SUBST at the end of this file)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

AC_INIT(coq-dpdgraph,1.0)
AC_INIT([coq-dpdgraph],[1.0])
AC_MSG_NOTICE(AC_PACKAGE_NAME version AC_PACKAGE_VERSION)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -174,7 +174,20 @@ fi
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new_section "Coq"

AC_CHECK_PROG(COQC,coqc,coqc,no)
#AC_ARG_VAR(COQBIN, [path to Coq executables [empty]])
#if test ${COQBIN##*/}; then COQBIN=$COQBIN/; fi
#AC_MSG_RESULT($COQBIN)

if test "a$COQBIN" != "a"; then
PATH="$COQBIN:$PATH";
if test "a$OCAMLPATH" = "a"; then
AC_MSG_WARN(You set COQBIN but not OCAMLPATH.)
AC_MSG_WARN(You may want to consider adding:)
AC_MSG_WARN(export OCAMLPATH='${COQBIN%/*/}/lib')
fi
fi

AC_PATH_PROG(COQC,coqc,[no], [$PATH])
if test "$COQC" = no ; then
AC_MSG_ERROR(Cannot find coqc.)
fi
Expand All @@ -183,19 +196,28 @@ AC_MSG_CHECKING(coq version)
COQVERSION=$($COQC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' )
AC_MSG_RESULT($COQVERSION)

AC_PATH_PROG(COQTOP,coqtop,[no], [$PATH])
if test "$COQTOP" = no ; then
AC_MSG_ERROR(Cannot find coqtop.)
fi

AC_PATH_PROG(COQDOC,coqdoc,[no], [$PATH])
if test "$COQDOC" = no ; then
AC_MSG_ERROR(Cannot find coqdoc.)
fi

case $COQVERSION in
8.[[0-9]][[^0-9]]*|8.10*)
AC_MSG_ERROR(AC_PACKAGE_NAME needs Coq version 8.11 or higher)
;;
esac

AC_CHECK_PROG(COQ_MAKEFILE,coq_makefile,coq_makefile,no)
AC_PATH_PROG(COQ_MAKEFILE,coq_makefile,no, [$PATH])
if test "$COQ_MAKEFILE" = no ; then
AC_MSG_ERROR(cannot find coq_makefile.)
fi

BINDIR_PRE=$(which coqc)
BINDIR=$(dirname $BINDIR_PRE)
BINDIR=$(dirname $COQC)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new_section "creating Makefile"
Expand All @@ -216,13 +238,16 @@ AC_SUBST(OCAMLYACC)
AC_SUBST(OCAML_EXTRA_OPTS)

AC_SUBST(COQC)
AC_SUBST(COQTOP)
AC_SUBST(COQDOC)
AC_SUBST(COQ_MAKEFILE)

AC_SUBST(BINDIR)
AC_SUBST(OCAMLGRAPH_PATH)

# Finally create the Makefile from Makefile.in
AC_OUTPUT(Makefile)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
chmod a-w Makefile

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Loading