--- nono/configure 2026/04/29 17:05:26 1.1.1.15 +++ nono/configure 2026/04/29 17:05:34 1.1.1.16 @@ -649,6 +649,7 @@ WXWIDGETS_LIBS WXWIDGETS_CPPFLAGS WITH_GUI WX_MAJORMINOR +HOSTNET_SLIRP HOSTNET_BPF HOSTNET_TAP HOSTNET_AFPACKET @@ -722,6 +723,7 @@ ac_user_opts=' enable_option_checking enable_avx2 enable_neon +with_libslirp with_gui ' ac_precious_vars='build_alias @@ -1363,6 +1365,7 @@ Optional Features: 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) --without-gui disable GUI support Some influential environment variables: @@ -5694,6 +5697,70 @@ 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 __builtin_bitreverse16" >&5 +printf %s "checking for __builtin_bitreverse16... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + return __builtin_bitreverse16(1); + + ; + 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___BUILTIN_BITREVERSE16 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 __builtin_bitreverse32" >&5 +printf %s "checking for __builtin_bitreverse32... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + return __builtin_bitreverse32(1); + + ; + 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___BUILTIN_BITREVERSE32 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 __builtin_bswap16" >&5 printf %s "checking for __builtin_bswap16... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7479,6 +7546,96 @@ esac fi +# libslirp + +# Check whether --with-libslirp was given. +if test ${with_libslirp+y} +then : + withval=$with_libslirp; +else case e in #( + e) with_libslirp=yes ;; +esac +fi + + +if test "x$with_libslirp" != "xno" +then : + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libslirp" >&5 +printf %s "checking for libslirp... " >&6; } + for path in ${PATHS}; do + old_CPPFLAGS=${CPPFLAGS} + old_LIBS=${LIBS} + case ${path} in + none) + LIBS="${LIBS} -lslirp" + ;; + *) + CPPFLAGS="${CPPFLAGS} -I${path}/include" + LIBS="${LIBS} -L${path}/lib -lslirp" + ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + slirp_version_string(); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + has_libslirp=yes + break + +else case e in #( + e) + has_libslirp=no + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=${old_CPPFLAGS} + LIBS=${old_LIBS} + done + if test x"${has_libslirp}" = x"yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + if test x"${has_libslirp}" = x"yes"; then + printf "%s\n" "#define HAVE_HOSTNET_SLIRP 1" >>confdefs.h + + HOSTNET_SLIRP=yes + + else + as_fn_error $? "*** libslirp is not found. +*** If use use pkgsrc, install net/libslirp. +*** If you use Ubuntu, sudo apt install libslirp-dev. +*** Or specify --without-libslirp (it disables hostnet-driver=usermode)." "$LINENO" 5 + fi + +else case e in #( + e) + HOSTNET_SLIRP=no + + ;; +esac +fi + # wxWidgets # Check whether --with-gui was given. @@ -7666,7 +7823,15 @@ fi # nono 本体のチェックはここまで。 nono_CPPFLAGS=${CPPFLAGS} -nono_LIBS=${LIBS} +case "${host_os}" in + netbsd*) + # どうしたもんかこれ。 + nono_LIBS=`echo ${LIBS} | sed -e 's/-L\([^ ]*\) /-L\1 -Wl,-R,\1 /'` + ;; + *) + nono_LIBS=${LIBS} + ;; +esac NONO_CPPFLAGS=${nono_CPPFLAGS} NONO_LIBS=${nono_LIBS}