1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
dnl Process this file with autoconf to produce a configure script.
dnl Copyright (C) 1996 - 2001 Tim Witham <twitham@quiknet.com>
dnl (see the files README and COPYING for more details)
AC_INIT([xoscope], [2.3])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.4)
PKG_CHECK_MODULES(GTKDATABOX, gtkdatabox >= 1.0.0)
PKG_CHECK_MODULES(FFTW3, fftw3)
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
dnl X11 checks
AC_PATH_XTRA
if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
AC_MSG_ERROR(can not find X11)
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(X_PRE_LIBS)
AC_SUBST(X_EXTRA_LIBS)
AC_SUBST(X_LIBS)
AC_SUBST(x_libraries)
dnl Checks for programs.
AC_PATH_PROG(PERL, perl, /usr/bin/perl)
AC_DEFINE_UNQUOTED(PERL, "$ac_cv_path_PERL", [Path to Perl executable])
dnl Checks for libraries.
dnl AC_CHECK_LIB(esd, esd_monitor_stream)
AC_CHECK_LIB(m, sin)
AC_ARG_WITH([comedi],
[AS_HELP_STRING([--with-comedi],
[support data acquisition hardwith with COMEDI library])],
[], [with_comedi=check])
AS_IF([test "x$with_comedi" != xno],
[AC_CHECK_LIB(comedi, comedi_open,,
[if test "x$with_comedi" != xcheck; then
AC_MSG_FAILURE(
[--with-comedi was given, but test for COMEDI failed])
fi
])])
AS_IF([test "$ac_cv_lib_comedi_comedi_open" = "yes"],
[AC_MSG_CHECKING([how many arguments comedi_get_cmd_generic_timed takes])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <comedilib.h>
int main() {
comedi_get_cmd_generic_timed(NULL, 0, NULL, 0, 0);
}])], comedi_get_cmd_generic_timed=5args, comedi_get_cmd_generic_timed=4args)
if test x"$comedi_get_cmd_generic_timed" = x5args; then
AC_DEFINE([COMEDI_GET_CMD_GENERIC_TIMED_TAKES_5_ARGS],1,[Descr])
AC_MSG_RESULT(5)
else
AC_MSG_RESULT(4)
fi
])
AC_CHECK_LIB(fftw3, fftw_execute)
AC_CHECK_LIB(asound, snd_pcm_hw_params)
dnl Check for optional features in gtkdatabox library
AC_CHECK_LIB(gtkdatabox, gtk_databox_grid_set_line_style, [AC_DEFINE([HAVE_GRID_LINESTYLE], [1],
[Define if gtkdatabox supports setting grid line styles.])])
dnl This, believe it or not, is the suggested syntax for checking the
dnl result of a previously run test - in our case, for setting an
dnl automake variable based on the result of an autoconf test. See
dnl "Defining C Preprocessor Symbols" in the autoconf info docs.
AM_CONDITIONAL(COMEDI, test "$ac_cv_lib_comedi_comedi_open" = "yes")
dnl AM_CONDITIONAL(ESD, test "$ac_cv_lib_esd_esd_monitor_stream" = "yes")
AM_CONDITIONAL(ASOUND, test "$ac_cv_lib_asound_snd_pcm_hw_params" = "yes")
AC_SUBST(XOSCOPE)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h termio.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_HEADER_MAJOR
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd putenv select strdup strstr strtol)
dnl Program defaults for the command-line options (original values)
AC_DEFINE(DEF_A, 1, [active channel])
AC_DEFINE(DEF_R, 44100, [sample rate in Hz])
AC_DEFINE(DEF_S, 10, [time scale in ms/div])
AC_DEFINE(DEF_T, "0:0:x", [trigger level])
AC_DEFINE(DEF_L, "1:1:0", [cursor lines])
AC_DEFINE(DEF_FX, "8x16", [X11 font])
AC_DEFINE(DEF_P, 2, [plot mode 2 (lines, sweep)])
AC_DEFINE(DEF_G, 2, [full graticle display])
AC_DEFINE(DEF_B, 0, [graticle in front of data])
AC_DEFINE(DEF_V, 0, [verbose display off])
AC_DEFINE(MAXWID, 1024 * 256, [maximum number of samples stored in memories])
AC_DEFINE(SAMPLESKIP, 32, [samples to discard after a reset])
AC_DEFINE(DISCARDBUF, 16384, [maximum samples to discard at each pass if we have too many])
AC_DEFINE(CHANNELS, 8, [max number of channels])
AC_DEFINE(MSECREFRESH, 30, [minimum number of milliseconds between refresh on libsx version])
AC_DEFINE(HELPCOMMAND, "man -Tutf8 xoscope 2>&1", [shell command for X11 help])
AC_DEFINE(FILENAME, "oscope.dat", [default file name])
AC_DEFINE(COMMAND, "operl '$x + $y'", [default external command pipe])
AC_DEFINE(FFT_DSP_LEN, 440, [output from fft is compressed (or streched) to that number of bands])
AC_DEFINE(DEFAULT_ALSADEVICE, ["default"], [default ALSA soundcard device])
dnl Set CALC_RMS to "1" if you deal mostly with sinusoidal signals.
dnl Might be confusing with audio signals.
AC_DEFINE(CALC_RMS, 0, [calculate RMS of captured signal])
dnl Set SC_16BIT to "1" if you want 16 bit resolution from sound card
AC_DEFINE(SC_16BIT, 0, [use 16 bit format for sound card])
AC_OUTPUT([
Makefile
xoscope.spec
])
AC_MSG_RESULT([
ALSA module: ${ac_cv_lib_asound_snd_pcm_hw_params}
COMEDI module: ${ac_cv_lib_comedi_comedi_open}
])
dnl ESD module: ${ac_cv_lib_esd_esd_monitor_stream}
|