--- linuxsampler/trunk/configure.in 2011/07/11 17:52:01 2205 +++ linuxsampler/trunk/configure.ac 2021/01/05 20:42:32 3845 @@ -1,11 +1,13 @@ -AC_INIT(configure.in) - #------------------------------------------------------------------------------------ # LinuxSampler's / liblinuxsampler's "official" release version: -LINUXSAMPLER_RELEASE_MAJOR=1 -LINUXSAMPLER_RELEASE_MINOR=0 -LINUXSAMPLER_RELEASE_BUILD=0.cvs11 +m4_define(linuxsampler_release_major, 2) +m4_define(linuxsampler_release_minor, 1) +m4_define(linuxsampler_release_build, 1.svn68) + + +AC_INIT([linuxsampler],[linuxsampler_release_major.linuxsampler_release_minor.linuxsampler_release_build]) +AC_CONFIG_SRCDIR([configure.ac]) #------------------------------------------------------------------------------------ # The following is the libtool / shared library version. This doesn't have to @@ -24,7 +26,7 @@ # 6. If any interfaces have been removed since the last public release, then set age # to 0. -LIBLINUXSAMPLER_LT_CURRENT=3 +LIBLINUXSAMPLER_LT_CURRENT=5 LIBLINUXSAMPLER_LT_REVISION=0 LIBLINUXSAMPLER_LT_AGE=0 SHARED_VERSION_INFO="$LIBLINUXSAMPLER_LT_CURRENT:$LIBLINUXSAMPLER_LT_REVISION:$LIBLINUXSAMPLER_LT_AGE" @@ -33,18 +35,25 @@ # the LSCP specification version this LinuSampler release complies with: LSCP_RELEASE_MAJOR=1 -LSCP_RELEASE_MINOR=5 +LSCP_RELEASE_MINOR=7 AC_DEFINE_UNQUOTED(LSCP_RELEASE_MAJOR, ${LSCP_RELEASE_MAJOR}, [LSCP spec major version this release complies with.]) AC_DEFINE_UNQUOTED(LSCP_RELEASE_MINOR, ${LSCP_RELEASE_MINOR}, [LSCP spec minor version this release complies with.]) +AM_INIT_AUTOMAKE([subdir-objects]) +AC_PROG_CC AC_PROG_CXX AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL +AC_PROG_LIBTOOL +AC_PROG_LEX +AC_PROG_YACC AC_SUBST(SHLIB_VERSION_ARG) AC_SUBST(SHARED_VERSION_INFO) +module=yes eval LIB_EXT=$shrext_cmds +AC_SUBST(LIB_EXT) + AC_C_BIGENDIAN AC_CANONICAL_HOST @@ -55,6 +64,12 @@ AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes) +# make sure C++14 is supported by compiler +# (add CXXFLAGS if required [e.g. -std=c++14]) +m4_ifdef([m4_include(m4/ax_cxx_compile_stdcxx.m4)],, + [sinclude([m4/ax_cxx_compile_stdcxx.m4])]) +AX_CXX_COMPILE_STDCXX(14, [], mandatory) + AC_MSG_CHECKING([whether x86 architecture]) def_arch_x86=0 case $host_cpu in @@ -101,9 +116,8 @@ AM_CONDITIONAL(HAVE_WINDOWS, test $have_windows = "1") AC_MSG_CHECKING([whether UNIX98 compatible]) -AC_LANG_SAVE -AC_LANG_C -AC_TRY_RUN([ +AC_LANG_PUSH([C]) +AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif @@ -115,18 +129,18 @@ exit(-1); /* not UNIX98 compatible */ #endif } -], +]])], have_unix98="yes", have_unix98="no", have_unix98="no" ) -AC_LANG_RESTORE +AC_LANG_POP([C]) AC_MSG_RESULT([$have_unix98]) -if test "$have_unix98" = "no" -a "have_windows" = "0"; then +if test "$have_unix98" = "no" -a "$have_windows" = "0" -a "$mac" = "no" ; then if test "x$HAVE_UNIX98" = "x"; then echo "LinuxSampler only runs on UNIX98 compatible systems, which is mandatory for" - echo "pthread_mutexattr_settype() call in Mutex.cpp. You may want to run - echo "./configure with environment variable HAVE_UNIX98=1 in case you think you + echo "pthread_mutexattr_settype() call in Mutex.cpp. You may want to run" + echo "./configure with environment variable HAVE_UNIX98=1 in case you think you" echo "have a UNIX98 compatible system." exit -1; fi @@ -144,6 +158,13 @@ CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" + +# check for compiler's pragma diagnostic capabilities +m4_ifdef([m4_include(m4/pragma_diagnostics.m4)],, + [sinclude([m4/pragma_diagnostics.m4])]) +ACX_CXX_PRAGMA_DIAGNOSTICS + + # check for a bug in NPTL-enabled glibc # (see Gentoo bug report #194076) AC_ARG_ENABLE(nptl-bug-check, @@ -173,10 +194,114 @@ echo "NPTL glibc bug check disabled" fi -# FIXME: this is actually a dependency of libgig, not of LS directly, why -# isn't it hidden by libgig? -AC_CHECK_HEADERS(uuid/uuid.h) -AC_SEARCH_LIBS(uuid_generate, uuid) + +# check whether C++ compiler supports "designated initializers" +echo -n "Checking whether C++ compiler supports designated initializers (partly)... " +AC_LANG_PUSH([C++]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #include + struct Foo { + int a; + float b; + bool c; + char d; + }; + static void bar(Foo o) { + } + int main() { + bar({ + .a = 2, + .b = 4.3f, + .c = true, + .d = 'z' + }); + return 0; + } + ]])], + [cxx_designated_init_partly="yes"], + [cxx_designated_init_partly="no"] +) +AC_LANG_POP([C++]) +if test $cxx_designated_init_partly = "yes"; then + echo "yes" +else + echo "NO" + echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' + echo '! !' + echo '! ERROR: Selected C++ compiler does not support designated !' + echo '! initializers at all, not even partly! !' + echo '! !' + echo '! Please either update your C++ compiler or select a !' + echo '! different compiler (e.g. GCC >= 8 or clang >= 5). If you !' + echo '! have several C++ compilers installed on your machine, you !' + echo '! can easily select a different compiler by environment !' + echo '! variable, e.g. to compile with clang instead: !' + echo '! !' + echo '! CXX=clang++ CC=clang ./configure && make !' + echo '! !' + echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' + exit -1 +fi +echo -n "Checking whether C++ compiler fully supports designated initializers... " +AC_LANG_PUSH([C++]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #include + struct Foo { + int a; + float b; + bool c; + char d; + }; + static void bar(Foo o) { + } + int main() { + bar({ + .d = 'z', + .a = 2 + }); + return 0; + } + ]])], + [cxx_designated_init_fully="yes"], + [cxx_designated_init_fully="no"] +) +AC_LANG_POP([C++]) +if test $cxx_designated_init_fully = "yes"; then + echo "yes" +else + echo 'NO' + echo '***************************************************************' + echo '* *' + echo '* WARNING: Selected C++ compiler does not fully support *' + echo '* designated initializers (only partly)! *' + echo '* *' + echo '* You will be able to compile LinuxSampler, but you will not *' + echo '* be able to compile the test cases. Consider updating your *' + echo '* C++ compiler or switching to a different compiler. Chances *' + echo '* are that LinuxSampler will soon no longer support your *' + echo '* compiler. *' + echo '* *' + echo '* If you have several C++ compilers installed on your machine,*' + echo '* you can easily select a different compiler by environment *' + echo '* variable, e.g. to compile with clang instead: *' + echo '* *' + echo '* CXX=clang++ CC=clang ./configure && make *' + echo '* *' + echo '***************************************************************' +fi + + +# In case Bison is available, determine the exact version, since we need to +# use different custom parser code for Bison 2.x vs. Bison 3.x generated +# parser yacc tables. +if echo "$YACC" | grep -q bison; then + # NOTE: m4 removes [], that's why it needs to be escaped + bison_version=[`$YACC --version | head -n 1 | sed -e 's/[^0-9.]*\([-0-9.]\+\)$/\1/'`] + bison_version_major=`echo $bison_version | cut -d. -f1` + bison_version_minor=`echo $bison_version | cut -d. -f2` + AC_DEFINE_UNQUOTED(HAVE_BISON_MAJ,$bison_version_major,[Define to the major version of the GNU Bison program installed.]) + AC_DEFINE_UNQUOTED(HAVE_BISON_MIN,$bison_version_minor,[Define to the minor version of the GNU Bison program installed.]) +fi @@ -212,9 +337,8 @@ fi echo -n "checking Alsa version... " - AC_LANG_SAVE - AC_LANG_C - AC_TRY_RUN([ + AC_LANG_PUSH([C]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include void main(void) { /* ensure backward compatibility */ @@ -223,12 +347,12 @@ #endif exit(SND_LIB_MAJOR); } - ], + ]])], alsa_major=0, alsa_major=$?, alsa_major=0 ) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include void main(void) { /* ensure backward compatibility */ @@ -237,12 +361,12 @@ #endif exit(SND_LIB_MINOR); } - ], + ]])], alsa_minor=0, alsa_minor=$?, alsa_minor=0 ) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include void main(void) { /* ensure backward compatibility */ @@ -251,12 +375,12 @@ #endif exit(SND_LIB_SUBMINOR); } - ], + ]])], alsa_subminor=0, alsa_subminor=$?, alsa_subminor=0 ) - AC_LANG_RESTORE + AC_LANG_POP([C]) echo "$alsa_major.$alsa_minor.$alsa_subminor"; AC_DEFINE_UNQUOTED(ALSA_MAJOR,$alsa_major,[Define to the major version number of your Alsa installation.]) AC_DEFINE_UNQUOTED(ALSA_MINOR,$alsa_minor,[Define to the minor version number of your Alsa installation.]) @@ -287,7 +411,8 @@ AC_SUBST(JACK_CFLAGS) linuxsampler_save_LIBS=$LIBS LIBS="$JACK_LIBS $LIBS" - AC_CHECK_FUNCS(jack_client_name_size jack_client_open) + AC_CHECK_FUNCS(jack_client_name_size jack_client_open \ + jack_on_info_shutdown) LIBS=$linuxsampler_save_LIBS have_audio_output_driver="true"; fi @@ -512,10 +637,12 @@ AM_CONDITIONAL(HAVE_DSSI, test $config_have_dssi = "yes") # LV2 -PKG_CHECK_MODULES(LV2, lv2core, config_have_lv2="yes", config_have_lv2="no") -if test $config_have_lv2 = "no"; then - AC_CHECK_HEADER(lv2.h, config_have_lv2="yes", config_have_lv2="no") +PKG_CHECK_MODULES(LV2, lv2 >= 1.0.0, config_have_lv2="yes", config_have_lv2="no") +if test "$config_have_lv2" != "yes"; then + PKG_CHECK_MODULES(LV2, lv2core >= 1.0.0, config_have_lv2="yes", config_have_lv2="no") fi +AC_SUBST(LV2_CFLAGS) +AC_SUBST(LV2_LIBS) AM_CONDITIONAL(HAVE_LV2, test $config_have_lv2 = "yes") # VST @@ -579,7 +706,7 @@ # Checks for various DLL libraries # Check presence of libgig -libgig_version="3.3.0" +libgig_version="4.2.0" PKG_CHECK_MODULES(GIG, gig >= $libgig_version, HAVE_GIG=true, HAVE_GIG=false) if test "$HAVE_GIG" = "false"; then echo "Required libgig version not found!" @@ -625,10 +752,10 @@ AC_SUBST(SNDFILE_CFLAGS) AC_SUBST(SNDFILE_LIBS) -# Check for Vorbis support in libsndfile +# Check for Vorbis and FLAC support in libsndfile linuxsampler_save_CFLAGS=$CFLAGS CFLAGS="$SNDFILE_CFLAGS $CFLAGS" -AC_CHECK_DECLS([SF_FORMAT_VORBIS], [], [] ,[[#include ]]) +AC_CHECK_DECLS([SF_FORMAT_VORBIS, SF_FORMAT_FLAC], [], [], [[#include ]]) # Check for loop functionality in libsndfile AC_CHECK_MEMBERS([SF_INSTRUMENT.loops],, @@ -733,17 +860,12 @@ AC_DEFINE_UNQUOTED(CONFIG_RT_EXCEPTIONS, 1, [Define to 1 to allow exceptions in the realtime context.]) fi -config_pthread_testcancel="$mac" -AC_ARG_ENABLE(pthread-testcancel, - [ --enable-pthread-testcancel - Enable pthread_testcancel() calls and avoid - asynchronous cancel of pthreads (default=yes - for Mac targets, no otherwise).], - [config_pthread_testcancel="$enableval"], - [] +AC_CHECK_FUNC(pthread_testcancel, + [config_pthread_testcancel="yes"], + [config_pthread_testcancel="no"] ) if test "$config_pthread_testcancel" = "yes"; then - AC_DEFINE_UNQUOTED(CONFIG_PTHREAD_TESTCANCEL, 1, [Define to 1 to enable pthread_testcancel() calls.]) + AC_DEFINE_UNQUOTED(CONFIG_PTHREAD_TESTCANCEL, 1, [Define to 1 if pthread_testcancel() is available.]) fi AC_ARG_ENABLE(preload-samples, @@ -1221,20 +1343,19 @@ ########################################################################### # Automatic Benchmarks (to detect the best algorithms for the system) -AC_LANG_SAVE - if test "$config_signed_triang_algo" = "benchmark"; then echo -n "benchmarking for the best (signed) triangular oscillator algorithm... " - AC_LANG_CPLUSPLUS - AC_TRY_RUN([ + AC_LANG_PUSH([C++]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #define SIGNED 1 #define SILENT 1 #include "${srcdir}/benchmarks/triang.cpp" - ], + ]])], triang_signed=0, triang_signed=$?, triang_signed=0 ) + AC_LANG_POP([C++]) if test "$triang_signed" = "2"; then config_signed_triang_algo="intmath" echo "integer math" @@ -1265,16 +1386,17 @@ if test "$config_unsigned_triang_algo" = "benchmark"; then echo -n "benchmarking for the best (unsigned) triangular oscillator algorithm... " - AC_LANG_CPLUSPLUS - AC_TRY_RUN([ + AC_LANG_PUSH([C++]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #define SIGNED 0 #define SILENT 1 #include "${srcdir}/benchmarks/triang.cpp" - ], + ]])], triang_unsigned=0, triang_unsigned=$?, triang_unsigned=0 ) + AC_LANG_POP([C++]) if test "$triang_unsigned" = "2"; then config_unsigned_triang_algo="intmath" echo "integer math" @@ -1303,25 +1425,23 @@ fi AC_DEFINE_UNQUOTED(CONFIG_UNSIGNED_TRIANG_ALGO, ${triang_unsigned}, [Define unsigned triangular wave algorithm to be used.]) -AC_LANG_RESTORE - ########################################################################### # Create Build Files -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(linuxsampler, "$LINUXSAMPLER_RELEASE_MAJOR.$LINUXSAMPLER_RELEASE_MINOR.$LINUXSAMPLER_RELEASE_BUILD") +AC_CONFIG_HEADERS([config.h]) -AC_LANG_CPLUSPLUS +AC_LANG([C++]) # autoconf 2.59/libtool 1.5.12 bug? work-around. Without a check like # this, the dlfcn.h check in am_prog_libtool may fail. AC_CHECK_HEADER(stdlib.h) -AC_OUTPUT( \ +AC_CONFIG_FILES([\ Makefile \ man/Makefile \ man/linuxsampler.1 \ + man/lscp.1 \ src/Makefile \ src/db/Makefile \ src/network/Makefile \ @@ -1340,8 +1460,12 @@ src/hostplugins/Makefile \ src/hostplugins/dssi/Makefile \ src/hostplugins/lv2/Makefile \ + src/hostplugins/lv2/manifest.ttl \ src/hostplugins/vst/Makefile \ src/hostplugins/au/Makefile \ + src/scriptvm/Makefile \ + src/scriptvm/editor/Makefile \ + src/shell/Makefile \ linuxsampler.spec \ debian/Makefile \ Artwork/Makefile \ @@ -1353,7 +1477,8 @@ Documentation/Engines/gig/Makefile \ linuxsampler.pc \ Doxyfile \ -) +]) +AC_OUTPUT # resolve all nested variables in '${config_plugin_dir}' # (merely for providing a human readable summary below) @@ -1369,7 +1494,7 @@ echo "#####################################################################" echo "# LinuxSampler Configuration #" echo "#-------------------------------------------------------------------#" -echo "# Release Version: ${LINUXSAMPLER_RELEASE_MAJOR}.${LINUXSAMPLER_RELEASE_MINOR}.${LINUXSAMPLER_RELEASE_BUILD}" +echo "# Release Version: ${VERSION}" echo "# LSCP Version: ${LSCP_RELEASE_MAJOR}.${LSCP_RELEASE_MINOR}" echo "#-------------------------------------------------------------------" echo "# Assembly Optimizations: ${config_asm}"