--- nono/configure 2026/04/29 17:05:47 1.1.1.18 +++ nono/configure 2026/04/29 17:05:56 1.1.1.20 @@ -647,6 +647,10 @@ LIBS_WXWIDGETS CPPFLAGS_WXWIDGETS WITH_GUI WX_MAJORMINOR +LIBS_SOUND +HOSTSOUND_SNDIO +HOSTSOUND_NETBSD +HOSTSOUND_ALSA LIBS_SLIRP CPPFLAGS_SLIRP HOSTNET_SLIRP @@ -724,6 +728,7 @@ enable_option_checking enable_avx2 enable_neon with_libslirp +with_alsa with_gui ' ac_precious_vars='build_alias @@ -1366,6 +1371,8 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-libslirp disable usermode network (using SLIRP) + --with-alsa enable ALSA support (default:yes on Linux, otherwise + no) --without-gui disable GUI support Some influential environment variables: @@ -4887,6 +4894,42 @@ rm -f core conftest.err conftest.$ac_obj CXXFLAGS="${old_CXXFLAGS}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether c++ accepts -Wimplicit-fallthrough" >&5 +printf %s "checking whether c++ accepts -Wimplicit-fallthrough... " >&6; } + old_CXXFLAGS="${CXXFLAGS}" + CXXFLAGS="${CXXFLAGS} -Werror -Wimplicit-fallthrough" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + eval `echo cxx_has-Wimplicit-fallthrough=yes | sed -e 's/-/_/g'` + WARNFLAGS_CXX="${WARNFLAGS_CXX} -Wimplicit-fallthrough" + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS="${old_CXXFLAGS}" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether c++ accepts -Winconsistent-missing-destructor-override" >&5 printf %s "checking whether c++ accepts -Winconsistent-missing-destructor-override... " >&6; } old_CXXFLAGS="${CXXFLAGS}" @@ -5249,6 +5292,43 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS="${old_CXXFLAGS}" +# gcc14 が C++14 に対しても C++20 のエラーを出そうとする。は?? + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether c++ accepts -Wno-template-id-cdtor" >&5 +printf %s "checking whether c++ accepts -Wno-template-id-cdtor... " >&6; } + old_CXXFLAGS="${CXXFLAGS}" + CXXFLAGS="${CXXFLAGS} -Werror -Wno-template-id-cdtor" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + eval `echo cxx_has-Wno-template-id-cdtor=yes | sed -e 's/-/_/g'` + WARNFLAGS_CXX="${WARNFLAGS_CXX} -Wno-template-id-cdtor" + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS="${old_CXXFLAGS}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether c++ accepts -Wtype-limits" >&5 printf %s "checking whether c++ accepts -Wtype-limits... " >&6; } @@ -5475,6 +5555,13 @@ then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi +ac_fn_cxx_check_header_compile "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" +if test "x$ac_cv_header_alsa_asoundlib_h" = xyes +then : + printf "%s\n" "#define HAVE_ALSA_ASOUNDLIB_H 1" >>confdefs.h + +fi + ac_fn_cxx_check_header_compile "$LINENO" "bsd/bsd.h" "ac_cv_header_bsd_bsd_h" "$ac_includes_default" if test "x$ac_cv_header_bsd_bsd_h" = xyes then : @@ -5524,6 +5611,20 @@ then : fi +ac_fn_cxx_check_header_compile "$LINENO" "sndio.h" "ac_cv_header_sndio_h" "$ac_includes_default" +if test "x$ac_cv_header_sndio_h" = xyes +then : + printf "%s\n" "#define HAVE_SNDIO_H 1" >>confdefs.h + +fi + +ac_fn_cxx_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audioio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_AUDIOIO_H 1" >>confdefs.h + +fi + ac_fn_cxx_check_header_compile "$LINENO" "sys/cpuset.h" "ac_cv_header_sys_cpuset_h" "$ac_includes_default" if test "x$ac_cv_header_sys_cpuset_h" = xyes then : @@ -6721,6 +6822,49 @@ esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HTOBE16" >&5 +printf %s "checking for HTOBE16... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined(HAVE_ENDIAN_H) + #include + #endif + #if defined(HAVE_SYS_ENDIAN_H) + #include + #endif + #if defined(HAVE_MACHINE_ENDIAN_H) + #include + #endif + +int +main (void) +{ + + uint16_t x = 0; + HTOBE16(x); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + printf "%s\n" "#define HAVE_INPLACE_HTOBE16 1" >>confdefs.h + + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CPU_COUNT" >&5 printf %s "checking for CPU_COUNT... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7452,11 +7596,13 @@ printf "%s\n" "yes" >&6; } HOSTNET_AFPACKET=yes + netdriver_afpacket=yes else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } + netdriver_afpacket=no ;; esac fi @@ -7501,9 +7647,11 @@ printf "%s\n" "yes" >&6; } HOSTNET_BPF=yes + netdriver_bpf=yes else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } + netdriver_bpf=no fi # @@ -7861,6 +8009,146 @@ else case e in #( esac fi +# ALSA +case "${host_os}" in + linux*) + default_alsa=yes + ;; + *) + default_alsa=no + ;; +esac + +# Check whether --with-alsa was given. +if test ${with_alsa+y} +then : + withval=$with_alsa; with_alsa=${withval} +else case e in #( + e) with_alsa=${default_alsa} ;; +esac +fi + +sounddriver_alsa=no +if test x"${with_alsa}" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 +printf %s "checking for snd_pcm_open in -lasound... " >&6; } +if test ${ac_cv_lib_asound_snd_pcm_open+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int snd_pcm_open (); +} +int +main (void) +{ +return conftest::snd_pcm_open (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_asound_snd_pcm_open=yes +else case e in #( + e) ac_cv_lib_asound_snd_pcm_open=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5 +printf "%s\n" "$ac_cv_lib_asound_snd_pcm_open" >&6; } +if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes +then : + has_asound=yes +else case e in #( + e) has_asound=no ;; +esac +fi + + if test x"${ac_cv_header_alsa_asoundlib_h}" = xyes -a \ + x"${ac_cv_lib_asound_snd_pcm_open}" = xyes; then + printf "%s\n" "#define HAVE_HOSTSOUND_ALSA 1" >>confdefs.h + + HOSTSOUND_ALSA=yes + + LIBS_SOUND="${LIBS_SOUND} -lasound" + sounddriver_alsa=yes + else + as_fn_error $? "*** or libasound not found. +*** If you use Ubuntu, sudo apt install libasound2-dev. +*** Or specify --without-alsa (it disables hostsound-driver=alsa)." "$LINENO" 5 + fi +fi + +# NetBSD audio +if test x"${ac_cv_header_sys_audioio_h}" = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AUDIO_GETINFO" >&5 +printf %s "checking for AUDIO_GETINFO... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + struct audio_info info; + AUDIO_INITINFO(&info); + ioctl(0, AUDIO_GETINFO, &info); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + printf "%s\n" "#define HAVE_HOSTSOUND_NETBSD 1" >>confdefs.h + + HOSTSOUND_NETBSD=yes + + sounddriver_netbsd=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + sounddriver_netbsd=no + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +# OpenBSD sndio +if test x"${ac_cv_header_sndio_h}" = xyes; then + printf "%s\n" "#define HAVE_HOSTSOUND_SNDIO 1" >>confdefs.h + + HOSTSOUND_SNDIO=yes + + LIBS_SOUND="${LIBS_SOUND} -lsndio" + sounddriver_sndio=yes +else + sounddriver_sndio=no +fi + +LIBS_SOUND=${LIBS_SOUND} + + # wxWidgets # Check whether --with-gui was given. @@ -9508,3 +9796,32 @@ printf "%s\n" "$as_me: WARNING: unrecogn fi +# サマリを表示 +echo "" +echo "Configuration summary:" +echo -n "HostNet supports: " +if test x"$netdriver_afpacket" = xyes; then + echo -n " afpacket" +fi +if test x"$netdriver_bpf" = xyes; then + echo -n " bpf" +fi +if test x"$has_libslirp" = xyes; then + echo -n " slirp" +fi +if test x"$netdriver_tap" = xyes; then + echo -n " tap" +fi +echo "" +echo -n "HostSound supports: " +if test x"$sounddriver_alsa" = xyes; then + echo -n " alsa" +fi +if test x"$sounddriver_netbsd" = xyes; then + echo -n " netbsd" +fi +if test x"$sounddriver_sndio" = xyes; then + echo -n " sndio" +fi +echo "" +