# # autoconf input for Objective Caml programs # Copyright (C) 2001 Jean-Christophe Filliātre # from a first script by Georges Mariano # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License version 2, as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU Library General Public License version 2 for more details # (enclosed in the file LGPL). # the script generated by autoconf from this input will set the following # variables: # OCAMLC "ocamlc" if present in the path, or a failure # or "ocamlc.opt" if present with same version number as ocamlc # OCAMLOPT "ocamlopt" (or "ocamlopt.opt" if present), or "no" # OCAMLBEST either "byte" if no native compiler was found, # or "opt" otherwise # OCAMLDEP "ocamldep" # OCAMLLEX "ocamllex" (or "ocamllex.opt" if present) # OCAMLYACC "ocamlyac" # OCAMLLIB the path to the ocaml standard library # OCAMLVERSION the ocaml version number # OCAMLWEB "ocamlweb" (not mandatory) # OCAMLWIN32 "yes"/"no" depending on Sys.os_type = "Win32" # EXE ".exe" if OCAMLWIN32=yes, "" otherwise # check for one particular file of the sources # ADAPT THE FOLLOWING LINE TO YOUR SOURCES! AC_INIT(src/lvrouted.ml) # Check for Ocaml compilers # then we look for ocamlopt; if not present, we issue a warning # if the version is not the same, we also discard it # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not OCAMLBEST=byte AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt,no) if test "$OCAMLOPT" = no ; then AC_MSG_ERROR(Cannot find ocamlopt.) fi OCAMLBEST=opt OCAMLVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` echo "ocaml version is $OCAMLVERSION" OCAMLLIB=`$OCAMLOPT -v | tail -1 | cut -f 4 -d " "` echo "ocaml library path is $OCAMLLIB" AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no) if test "$OCAMLDEP" = no ; then AC_MSG_ERROR(Cannot find ocamldep.) fi AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind,no) if test "$OCAMLFIND" = no ; then AC_MSG_ERROR(Cannot find ocamlfind.) fi AC_CHECK_PROG(OCAMLWEB,ocamlweb,ocamlweb,true) # Documentation checks, ignore if not found AC_CHECK_PROG(DOT,dot,dot,true) AC_CHECK_PROG(PS2PDF,ps2pdf,ps2pdf,true) AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,true) # platform AC_MSG_CHECKING(platform) if echo "let _ = Sys.os_type" | ocaml | grep -q Win32; then AC_MSG_RESULT(Win32) OCAMLWIN32=yes EXE=.exe else OCAMLWIN32=no EXE= fi XSLTPROC_FLAGS=--nonet XML_CATALOG= for i in /usr/local/share/xml/catalog \ /etc/xml/catalog \ /sw/etc/xml/catalog \ /opt/local/etc/xml/catalog; do if test -f "$i"; then XML_CATALOG=$i fi done DOCBOOK_ROOT= if test ! -n "$XML_CATALOG"; then for i in /usr/share/xml/docbook/stylesheet/nwalsh/ \ /usr/local/share/xsl/docbook/ \ /sw/share/xml/xsl/docbook-xsl \ /opt/local/share/xsl/docbook-xsl/; do if test -d "$i"; then DOCBOOK_ROOT=$i fi done if test -x "$DOCBOOK_ROOT"; then XSLTPROC_FLAGS= fi fi AC_SUBST(XSLTPROC_FLAGS) AC_SUBST(XML_CATALOG) AC_SUBST(DOCBOOK_ROOT) # substitutions to perform AC_SUBST(OCAMLC) AC_SUBST(OCAMLOPT) AC_SUBST(OCAMLDEP) AC_SUBST(OCAMLLEX) AC_SUBST(OCAMLYACC) AC_SUBST(OCAMLBEST) AC_SUBST(OCAMLVERSION) AC_SUBST(OCAMLLIB) AC_SUBST(OCAMLWEB) AC_SUBST(OCAMLWIN32) AC_SUBST(OCAMLFIND) AC_SUBST(XSLTPROC) AC_SUBST(EXE) AC_CONFIG_HEADERS(src/config.h) AC_CHECK_HEADERS([ net/if_dl.h net/if_ieee80211.h net80211/ieee80211.h sys/param.h netinet/ether.h dev/wi/if_wavelan_ieee.h ]) AC_CHECK_TYPE(struct rt_msghdr, [ AC_DEFINE(HAVE_RTMSG,, [struct rt_msghdr]) ],, [ #include #include #include ]) # Finally create the Makefile from Makefile.in AC_OUTPUT([ Makefile src/Makefile docs/Makefile ])