Makefile.am,configure.ac,main.cpp : Added use of cwWEB in autoconfig.

This commit is contained in:
Gitea 2020-10-04 18:47:51 +00:00
parent 1a445015f8
commit 22caf3d448
3 changed files with 57 additions and 13 deletions

View File

@ -45,6 +45,18 @@ endif
endif endif
if cwWEB
FFT_DIR = $(HOME)/src/fftw-3.3.8/build
FFT_DIR_D = $(FFT_DIR)/d
FFT_DIR_S = $(FFT_DIR)/s
AM_CXXFLAGS += --std=c++11
AM_CPPFLAGS += -I$(FFT_DIR)/include -I$(FFT_DIR_D)/include -I$(FFT_DIR_S)/include
AM_LDFLAGS += -L$(FFT_DIR)/lib -L$(FFT_DIR_D)/lib -L$(FFT_DIR_S)/lib
else
AM_CXXFLAGS += --std=c++17
endif
include src/libcw/Makefile.am include src/libcw/Makefile.am
libcw_la_SOURCES = $(libcwSRC) $(libcwHDR) libcw_la_SOURCES = $(libcwSRC) $(libcwHDR)

View File

@ -125,24 +125,43 @@ echo "alsa=${alsa}"
# check for C++17 # check for C++17
hasCpp17=true # hasCpp17=true
AX_CHECK_COMPILE_FLAG(-std=c++17, [CXXFLAGS="$CXXFLAGS -std=c++17"],[hasCpp17=false]) # AX_CHECK_COMPILE_FLAG(-std=c++17, [CXXFLAGS="$CXXFLAGS -std=c++17"],[hasCpp17=false])
if test x"$hasCpp17" = xtrue; then # if test x"$hasCpp17" = xtrue; then
AC_DEFINE([cwCPP17], 1,[C++ 17 is available.]) # AC_DEFINE([cwCPP17], 1,[C++ 17 is available.])
else # else
# C++17 is not available check for C++11 # C++17 is not available check for C++11
hasCpp11=true # hasCpp11=true
AX_CHECK_COMPILE_FLAG([-std=c++11], [CXXFLAGS="$CXXFLAGS -std=c++11"], [hasCpp11=false]) # AX_CHECK_COMPILE_FLAG([-std=c++11], [CXXFLAGS="$CXXFLAGS -std=c++11"], [hasCpp11=false])
if test x"$hasCpp11" = xtrue; then # if test x"$hasCpp11" = xtrue; then
AC_DEFINE([cwCPP11], 1,[C++ 11 is available.]) # AC_DEFINE([cwCPP11], 1,[C++ 11 is available.])
# fi
# echo "c++11=${hasCpp11}"
#fi
#echo "c++17=${hasCpp17}"
#
# Enable ALSA
#
AC_ARG_ENABLE([web],
[ --enable-web Include WEB dependencies],
[case "${enableval}" in
yes) web=true ;;
no) web=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-web]) ;;
esac],[web=false])
if test x"$web" = xtrue; then
AC_DEFINE([cwWEB], 1,[Use libweb.])
fi fi
echo "c++11=${hasCpp11}"
fi
echo "c++17=${hasCpp17}"
AM_CONDITIONAL([cwWEB], [test x$web = xtrue])
echo "web=${web}"
# AC_ARG_ENABLE([add_lib], # AC_ARG_ENABLE([add_lib],

View File

@ -51,8 +51,11 @@
#include "cwIoTest.h" #include "cwIoTest.h"
#endif #endif
#if defined(cwWeb)
#include "cwDataSets.h" #include "cwDataSets.h"
#include "cwSvg.h" #include "cwSvg.h"
#endif
#include "cwAudioFile.h" #include "cwAudioFile.h"
#include "cwAudioFileOps.h" #include "cwAudioFileOps.h"
@ -542,6 +545,15 @@ cw::rc_t sockMgrTest( const cw::object_t* cfg, const cw::object_t* args, int arg
return rc; return rc;
} }
#if defined(cwWEB)
cw::rc_t _no_c11() { return cwLogError(cw::kResourceNotAvailableRC,"C++11 functionality not included in this build."); }
cw::rc_t mnistTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_c11(); }
cw::rc_t datasetTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_c11(); }
cw::rc_t svgTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_c11(); }
#else
cw::rc_t mnistTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) cw::rc_t mnistTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{ {
char* inDir = requiredExistingDir( args, "inDir"); char* inDir = requiredExistingDir( args, "inDir");
@ -564,6 +576,7 @@ cw::rc_t svgTest( const cw::object_t* cfg, const cw::object_t* args, int argc,
cw::mem::release(cssFn); cw::mem::release(cssFn);
return rc; return rc;
} }
#endif
cw::rc_t dirEntryTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) cw::rc_t dirEntryTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] )
{ {