From bda31a204240b3268f0c57fdc9c6e5e5d226bdc0 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 2 Aug 2020 13:02:03 +0200 Subject: [PATCH] update to enable compiling for Linus and Cygwin --- README.wavsim | 6 +++++- configure.ac | 11 +++++++++++ src/frontend/sndprint.c | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.wavsim b/README.wavsim index 0b342dfc7..6240de801 100644 --- a/README.wavsim +++ b/README.wavsim @@ -26,6 +26,10 @@ http://gareus.org/oss/spicesound/start A complete package for Windows is available at http://ngspice.sourceforge.net/download.html#wav . -Test on Linux and macOS will follow. + +For Linux you have to install libsamplerate and libsndfile and their development headers. +./compile_linux.sh will then compile and install ngspice with *.wav capability. + +Test on macOS will follow. diff --git a/configure.ac b/configure.ac index 2419e69f1..202902206 100644 --- a/configure.ac +++ b/configure.ac @@ -822,6 +822,17 @@ if test "x$with_fftw3" != xno; then LIBS="$LIBS -lfftw3"]) fi +AC_CHECK_HEADERS([sndfile.h]) +AC_CHECK_LIB([sndfile], [sf_command], + [AC_DEFINE([HAVE_LIBSNDFILE], [], [Have libsndfile]) + LIBS="$LIBS -lsndfile"]) + +AC_CHECK_HEADERS([samplerate.h]) +AC_CHECK_LIB([samplerate], [src_process], + [AC_DEFINE([HAVE_LIBSAMPLERATE], [], [Have libsamplerate]) + LIBS="$LIBS -lsamplerate"]) + + # Check for a few mathematical functions: AC_CHECK_FUNCS([erfc logb scalb scalbn asinh acosh atanh finite]) # According POSIX we should look for macros first diff --git a/src/frontend/sndprint.c b/src/frontend/sndprint.c index 6cd10d39b..594a45fa2 100644 --- a/src/frontend/sndprint.c +++ b/src/frontend/sndprint.c @@ -1,6 +1,6 @@ #include #include -#include "..\src\misc\getopt_bsd.h" +#include "../misc/getopt_bsd.h" #include #include #include