Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis12/config/check_smlnj.m4
ViewVC logotype

Annotation of /branches/vis12/config/check_smlnj.m4

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (view) (download)
Original Path: trunk/config/check_smlnj.m4

1 : jhr 123 dnl check_smlnj.m4
2 :     dnl
3 :     dnl COPYRIGHT (c) 2007 The Manticore Project (http://manticore.cs.uchicago.edu/)
4 :     dnl All rights reserved.
5 :     dnl
6 :     dnl @synopsis CHECK_SMLNJ(ACTION-IF-UNKNOWN)
7 :     dnl
8 :     dnl This macro figures out the location of SML/NJ and its major, minor,
9 :     dnl and patch version numbers. The shell variables SMLNJ_CMD, SMLNJ_PATH,
10 :     dnl SMLNJ_VERSION, SMLNJ_MAJOR_VERSION, SMLNJ_MINOR_VERSION, and
11 :     dnl SMLNJ_PATCH_VERSION are set by this macro when it executes successfully.
12 :     dnl This macro also does an AC_SUBST for SMLNJ_CMD and SMLNJ_PATH.
13 :     dnl You can override the version of SML/NJ used by defining the SMLNJ_CMD
14 :     dnl variable in the environment.
15 :     dnl
16 :     dnl @version $Id: check_smlnj.m4,v 1.1.1.1 2006/04/11 05:17:06 jhr Exp $
17 :     dnl @author John Reppy <jhr@cs.uchicago.edu>
18 :     dnl
19 :     AC_DEFUN(CHECK_SMLNJ, [
20 :     dnl
21 :     dnl first we check for the existence of SML/NJ
22 :     dnl
23 :     if test z$SMLNJ_CMD = z ; then
24 :     AC_PATH_PROGS(SMLNJ_CMD, sml-cm sml, none)
25 :     fi
26 :     if test $SMLNJ_CMD = none; then
27 :     $1
28 :     else
29 :     dnl
30 :     dnl SML/NJ is installed, so determine its location
31 :     dnl
32 :     SMLNJ_PATH=`dirname $SMLNJ_CMD`
33 :     dnl
34 :     dnl Determine the version numbers
35 :     dnl
36 :     AC_MSG_CHECKING([version of SML/NJ])
37 :     ac_check_smlnj_version=`$SMLNJ_CMD @SMLversion`
38 :     if test $? -eq 0 ; then
39 :     dnl
40 :     dnl normalize the ac_check_smlnj_version variable
41 :     dnl
42 :     case $ac_check_smlnj_version in
43 :     sml-cm*) ac_check_smlnj_version=`echo $ac_check_smlnj_version | sed -e 's/sml-cm //'` ;;
44 :     sml*) ac_check_smlnj_version=`echo $ac_check_smlnj_version | sed -e 's/sml //'` ;;
45 :     *) AC_MSG_ERROR([bogus SML/NJ version ($ac_check_smlnj_version) reported]);;
46 :     esac
47 :     SMLNJ_VERSION=$ac_check_smlnj_version
48 :     case $ac_check_smlnj_version in
49 :     110)
50 :     dnl
51 :     dnl Versions 110.0.x report "sml 110" for the @SMLversion flag, so we need to
52 :     dnl do some more work.
53 :     dnl
54 :     banner=`echo "" | $SMLNJ_CMD | head -1`
55 :     [ac_check_smlnj_version=`echo $banner \
56 :     | sed -e 's/.*Version \([0-9.]*\).*/\1/'`]
57 :     SMLNJ_VERSION=$ac_check_smlnj_version
58 :     ;;
59 :     *.*.*) ;;
60 :     *.*) ac_check_smlnj_version="$ac_check_smlnj_version".0 ;;
61 :     *) ac_check_smlnj_version="$ac_check_smlnj_version".0.0 ;;
62 :     esac
63 :     [SMLNJ_MAJOR_VERSION=`echo $ac_check_smlnj_version \
64 :     | sed -e 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`]
65 :     [SMLNJ_MINOR_VERSION=`echo $ac_check_smlnj_version \
66 :     | sed -e 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`]
67 :     [SMLNJ_PATCH_VERSION=`echo $ac_check_smlnj_version \
68 :     | sed -e 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`]
69 :     AC_MSG_RESULT([$SMLNJ_VERSION])
70 :     AC_SUBST(SMLNJ_CMD)
71 :     AC_SUBST(SMLNJ_PATH)
72 :     else
73 :     $1
74 :     fi
75 :     fi
76 :     ])dnl

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0