annotate src/libsndfile-1.0.27/M4/octave.m4 @ 84:08ae793730bd

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