annotate src/libsndfile-1.0.25/M4/octave.m4 @ 0:c7265573341e

Import initial set of sources
author Chris Cannam
date Mon, 18 Mar 2013 14:12:14 +0000
parents
children
rev   line source
Chris@0 1 dnl Evaluate an expression in octave
Chris@0 2 dnl
Chris@0 3 dnl OCTAVE_EVAL(expr,var) -> var=expr
Chris@0 4 dnl
Chris@0 5 dnl Stolen from octave-forge
Chris@0 6
Chris@0 7 AC_DEFUN([OCTAVE_EVAL],
Chris@0 8 [
Chris@0 9 AC_MSG_CHECKING([for $1 in $OCTAVE])
Chris@0 10 $2=`TERM=;$OCTAVE -qfH --eval "disp($1)"`
Chris@0 11 AC_MSG_RESULT($$2)
Chris@0 12 AC_SUBST($2)
Chris@0 13 ]) # OCTAVE_EVAL
Chris@0 14
Chris@0 15 dnl @synopsis AC_OCTAVE_VERSION
Chris@0 16 dnl
Chris@0 17 dnl Find the version of Octave.
Chris@0 18 dnl @version 1.0 Aug 23 2007
Chris@0 19 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
Chris@0 20 dnl
Chris@0 21 dnl Permission to use, copy, modify, distribute, and sell this file for any
Chris@0 22 dnl purpose is hereby granted without fee, provided that the above copyright
Chris@0 23 dnl and this permission notice appear in all copies. No representations are
Chris@0 24 dnl made about the suitability of this software for any purpose. It is
Chris@0 25 dnl provided "as is" without express or implied warranty.
Chris@0 26 dnl
Chris@0 27
Chris@0 28 AC_DEFUN([AC_OCTAVE_VERSION],
Chris@0 29 [
Chris@0 30
Chris@0 31 AC_ARG_WITH(octave,
Chris@0 32 AC_HELP_STRING([--with-octave], [choose the octave version]),
Chris@0 33 [ with_octave=$withval ])
Chris@0 34
Chris@0 35 test -z "$with_octave" && with_octave=octave
Chris@0 36
Chris@0 37 AC_CHECK_PROG(HAVE_OCTAVE,$with_octave,yes,no)
Chris@0 38
Chris@0 39 if test "x$ac_cv_prog_HAVE_OCTAVE" = "xyes" ; then
Chris@0 40 OCTAVE=$with_octave
Chris@0 41 OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION)
Chris@0 42 fi
Chris@0 43
Chris@0 44 AC_SUBST(OCTAVE)
Chris@0 45 AC_SUBST(OCTAVE_VERSION)
Chris@0 46
Chris@0 47 ])# AC_OCTAVE_VERSION
Chris@0 48
Chris@0 49 dnl @synopsis AC_OCTAVE_CONFIG_VERSION
Chris@0 50 dnl
Chris@0 51 dnl Find the version of Octave.
Chris@0 52 dnl @version 1.0 Aug 23 2007
Chris@0 53 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
Chris@0 54 dnl
Chris@0 55 dnl Permission to use, copy, modify, distribute, and sell this file for any
Chris@0 56 dnl purpose is hereby granted without fee, provided that the above copyright
Chris@0 57 dnl and this permission notice appear in all copies. No representations are
Chris@0 58 dnl made about the suitability of this software for any purpose. It is
Chris@0 59 dnl provided "as is" without express or implied warranty.
Chris@0 60 dnl
Chris@0 61
Chris@0 62 AC_DEFUN([AC_OCTAVE_CONFIG_VERSION],
Chris@0 63 [
Chris@0 64
Chris@0 65 AC_ARG_WITH(octave-config,
Chris@0 66 AC_HELP_STRING([--with-octave-config], [choose the octave-config version]),
Chris@0 67 [ with_octave_config=$withval ])
Chris@0 68
Chris@0 69 test -z "$with_octave_config" && with_octave_config=octave-config
Chris@0 70
Chris@0 71 AC_CHECK_PROG(HAVE_OCTAVE_CONFIG,$with_octave_config,yes,no)
Chris@0 72
Chris@0 73 if test "x$ac_cv_prog_HAVE_OCTAVE_CONFIG" = "xyes" ; then
Chris@0 74 OCTAVE_CONFIG=$with_octave_config
Chris@0 75 AC_MSG_CHECKING([for version of $OCTAVE_CONFIG])
Chris@0 76 OCTAVE_CONFIG_VERSION=`$OCTAVE_CONFIG --version`
Chris@0 77 AC_MSG_RESULT($OCTAVE_CONFIG_VERSION)
Chris@0 78 fi
Chris@0 79
Chris@0 80 AC_SUBST(OCTAVE_CONFIG)
Chris@0 81 AC_SUBST(OCTAVE_CONFIG_VERSION)
Chris@0 82
Chris@0 83 ])# AC_OCTAVE_CONFIG_VERSION
Chris@0 84
Chris@0 85 dnl @synopsis AC_OCTAVE_BUILD
Chris@0 86 dnl
Chris@0 87 dnl Check programs and headers required for building octave plugins.
Chris@0 88 dnl @version 1.0 Aug 23 2007
Chris@0 89 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
Chris@0 90 dnl
Chris@0 91 dnl Permission to use, copy, modify, distribute, and sell this file for any
Chris@0 92 dnl purpose is hereby granted without fee, provided that the above copyright
Chris@0 93 dnl and this permission notice appear in all copies. No representations are
Chris@0 94 dnl made about the suitability of this software for any purpose. It is
Chris@0 95 dnl provided "as is" without express or implied warranty.
Chris@0 96
Chris@0 97
Chris@0 98 AC_DEFUN([AC_OCTAVE_BUILD],
Chris@0 99 [
Chris@0 100
Chris@0 101 dnl Default to no.
Chris@0 102 OCTAVE_BUILD=no
Chris@0 103
Chris@0 104 AC_OCTAVE_VERSION
Chris@0 105 OCTAVE_MKOCTFILE_VERSION
Chris@0 106 AC_OCTAVE_CONFIG_VERSION
Chris@0 107
Chris@0 108 prog_concat="$ac_cv_prog_HAVE_OCTAVE$ac_cv_prog_HAVE_OCTAVE_CONFIG$ac_cv_prog_HAVE_MKOCTFILE"
Chris@0 109
Chris@0 110 if test "x$prog_concat" = "xyesyesyes" ; then
Chris@0 111 if test "x$OCTAVE_VERSION" != "x$MKOCTFILE_VERSION" ; then
Chris@0 112 AC_MSG_WARN([** Mismatch between versions of octave and mkoctfile. **])
Chris@0 113 AC_MSG_WARN([** Octave libsndfile modules will not be built. **])
Chris@0 114 elif test "x$OCTAVE_VERSION" != "x$OCTAVE_CONFIG_VERSION" ; then
Chris@0 115 AC_MSG_WARN([** Mismatch between versions of octave and octave-config. **])
Chris@0 116 AC_MSG_WARN([** Octave libsndfile modules will not be built. **])
Chris@0 117 else
Chris@0 118 case "$MKOCTFILE_VERSION" in
Chris@0 119 2.*)
Chris@0 120 AC_MSG_WARN([Octave version 2.X is not supported.])
Chris@0 121 ;;
Chris@0 122 3.0.*)
Chris@0 123 OCTAVE_DEST_ODIR=`$OCTAVE_CONFIG --oct-site-dir | sed 's%^/usr%${prefix}%'`
Chris@0 124 OCTAVE_DEST_MDIR=`$OCTAVE_CONFIG --m-site-dir | sed 's%^/usr%${prefix}%'`
Chris@0 125
Chris@0 126 OCTAVE_BUILD=yes
Chris@0 127 ;;
Chris@0 128 *)
Chris@0 129 AC_MSG_WARN([Octave version $MKOCTFILE_VERSION is not supported.])
Chris@0 130 ;;
Chris@0 131 esac
Chris@0 132 fi
Chris@0 133 AC_MSG_RESULT([building octave libsndfile module... $OCTAVE_BUILD])
Chris@0 134 fi
Chris@0 135
Chris@0 136 AC_SUBST(OCTAVE_DEST_ODIR)
Chris@0 137 AC_SUBST(OCTAVE_DEST_MDIR)
Chris@0 138
Chris@0 139 AC_SUBST(MKOCTFILE)
Chris@0 140
Chris@0 141 AM_CONDITIONAL(BUILD_OCTAVE_MOD, test "x$OCTAVE_BUILD" = xyes)
Chris@0 142
Chris@0 143 ])# AC_OCTAVE_BUILD