--- nono/configure 2026/04/29 17:04:43 1.1.1.5 +++ nono/configure 2026/04/29 17:05:04 1.1.1.9 @@ -624,17 +624,21 @@ LIBOBJS MSGFMT WXWIDGETS_LIBS WXWIDGETS_CPPFLAGS -LIBZ_LIBS -LIBKQUEUE_LIBS -LIBEDIT_LIBS -LIBBSD_LIBS -NETDRIVER -KEVENT_UDATA_T +HOSTNET_BPF +HOSTNET_TAP +HOSTNET_AFPACKET CXXCPP WARNFLAGS_CXX WARNFLAGS_C -ARCH COMPILER +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build EGREP GREP CPP @@ -1302,6 +1306,10 @@ Fine tuning of the installation director _ACEOF cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi @@ -2166,6 +2174,35 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_aux_dir= +for ac_dir in scripts "$srcdir"/scripts; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in scripts \"$srcdir\"/scripts" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + # Checks for programs. ac_ext=cpp @@ -3214,35 +3251,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS con ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -3959,6 +3967,80 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI esac +# OS +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + # コンパイラをチェック。今のところ clang/gcc のみ。 # (autoconf がやってる gcc かどうかのチェックは clang を検出できず使えない) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler" >&5 @@ -3978,14 +4060,6 @@ $as_echo "unknown" >&6; } fi -# アーキテクチャのチェック。 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for architecture" >&5 -$as_echo_n "checking for architecture... " >&6; } -ARCH=`${CC} -v 2>&1 | awk '/Target:/ {print \$2}' | sed -e 's/-.*//'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ARCH}" >&5 -$as_echo "${ARCH}" >&6; } - - # C++ のバージョンをチェック CXX_STD=-std=c++14 ac_ext=cpp @@ -4062,33 +4136,6 @@ rm -f core conftest.err conftest.$ac_obj CFLAGS="${old_CFLAGS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc accepts -Wdisabled-macro-expansion" >&5 -$as_echo_n "checking whether cc accepts -Wdisabled-macro-expansion... " >&6; } - old_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} -Werror -Wdisabled-macro-expansion" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - WARNFLAGS_C="${WARNFLAGS_C} -Wdisabled-macro-expansion" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="${old_CFLAGS}" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc accepts -Wextra-semi" >&5 $as_echo_n "checking whether cc accepts -Wextra-semi... " >&6; } old_CFLAGS="${CFLAGS}" @@ -4241,33 +4288,6 @@ rm -f core conftest.err conftest.$ac_obj CXXFLAGS="${old_CXXFLAGS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether c++ accepts -Wdisabled-macro-expansion" >&5 -$as_echo_n "checking whether c++ accepts -Wdisabled-macro-expansion... " >&6; } - old_CXXFLAGS="${CXXFLAGS}" - CXXFLAGS="${CXXFLAGS} -Werror -Wdisabled-macro-expansion" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - WARNFLAGS_CXX="${WARNFLAGS_CXX} -Wdisabled-macro-expansion" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS="${old_CXXFLAGS}" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether c++ accepts -Wextra-semi" >&5 $as_echo_n "checking whether c++ accepts -Wextra-semi... " >&6; } old_CXXFLAGS="${CXXFLAGS}" @@ -4717,11 +4737,14 @@ done # Linux で がなければここで停止したほうがいい -if test "$ac_cv_header_sys_event_h" != "yes" \ - -a "$ac_cv_header_kqueue_sys_event_h" != "yes"; then - as_fn_error $? "*** kqueue is not found. - On Ubuntu, sudo apt install libkqueue-dev" "$LINENO" 5 -fi +case "${host_os}" in + linux*) + if test "$ac_cv_header_kqueue_sys_event_h" != "yes"; then + as_fn_error $? "*** kqueue is not found. +*** If you use Ubuntu, sudo apt install libkqueue-dev" "$LINENO" 5 + fi + ;; +esac # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 @@ -4822,99 +4845,6 @@ fi #AC_TYPE_UINT64_T #AC_TYPE_UINT8_T -# struct kevent のメンバ udata の型が互換性なく違う。 -# NetBSD では intptr_t(整数) だが、OSX では void* (ポインタ) なので、 -# 同一ソースコードでは回避できない。 -# Linux(Ubuntu) はどっちもパスするので後ろの void * のほうが使われる。 -# まあパスするんならどっちでもいいか。 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kevent.udata is intptr_t" >&5 -$as_echo_n "checking whether kevent.udata is intptr_t... " >&6; } -old_CXXFLAGS="${CXXFLAGS}" -CXXFLAGS="${CXXFLAGS} -Wall -Werror" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include "confdefs.h" - #if defined(HAVE_SYS_TYPES_H) - #include - #endif - #if defined(HAVE_SYS_EVENT_H) - #include - #endif - #if defined(HAVE_KQUEUE_SYS_EVENT_H) - #include - #endif - -int -main () -{ - - struct kevent kev; - kev.udata = (intptr_t)0; - (void)kev; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - KEVENT_UDATA_T=intptr_t - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CXXFLAGS="${old_CXXFLAGS}" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kevent.udata is void *" >&5 -$as_echo_n "checking whether kevent.udata is void *... " >&6; } -old_CXXFLAGS="${CXXFLAGS}" -CXXFLAGS="${CXXFLAGS} -Wall -Werror" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include "confdefs.h" - #if defined(HAVE_SYS_TYPES_H) - #include - #endif - #if defined(HAVE_SYS_EVENT_H) - #include - #endif - #if defined(HAVE_KQUEUE_SYS_EVENT_H) - #include - #endif - -int -main () -{ - - struct kevent kev; - kev.udata = (void *)0; - (void)kev; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - KEVENT_UDATA_T='void *' - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CXXFLAGS="${old_CXXFLAGS}" - -if test -z "$KEVENT_UDATA_T" ; then - as_fn_error $? "kevent.udata is unknown type" "$LINENO" 5 -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_assume" >&5 $as_echo_n "checking for __builtin_assume... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5355,22 +5285,111 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Select host network driver. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suitable host network driver" >&5 -$as_echo_n "checking for suitable host network driver... " >&6; } -if test x"$ac_cv_header_net_if_tap_h" = xyes; then - netdriver=tap -elif test x"$ac_cv_header_linux_if_tun_h" = xyes; then - netdriver=tap -elif test x"$ac_cv_header_net_bpf_h" = xyes; then - netdriver=bpf -else - netdriver=none -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $netdriver" >&5 -$as_echo "$netdriver" >&6; } -NETDRIVER=$netdriver +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv const" >&5 +$as_echo_n "checking for iconv const... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + const char **a; + iconv(0, a, 0, 0, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + $as_echo "#define HAVE_ICONV_CONST 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +# +# Network +# +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_PACKET" >&5 +$as_echo_n "checking for AF_PACKET... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + AF_PACKET; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + $as_echo "#define HAVE_HOSTNET_AFPACKET 1" >>confdefs.h + + HOSTNET_AFPACKET=yes + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tap(4)" >&5 +$as_echo_n "checking for tap(4)... " >&6; } +case "${host_os}" in + linux*) + if test x"$ac_cv_header_linux_if_tun_h" = xyes; then + netdriver_tap=yes + fi + ;; + openbsd*) + # OpenBSD has no but supports tap(4). + netdriver_tap=yes + ;; + *) + if test x"$ac_cv_header_net_if_tap_h" = xyes; then + netdriver_tap=yes + fi + ;; +esac +if test x"$netdriver_tap" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + $as_echo "#define HAVE_HOSTNET_TAP 1" >>confdefs.h + + HOSTNET_TAP=yes + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bpf(4)" >&5 +$as_echo_n "checking for bpf(4)... " >&6; } +if test x"$ac_cv_header_net_bpf_h" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + $as_echo "#define HAVE_HOSTNET_BPF 1" >>confdefs.h + + HOSTNET_BPF=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi # libbsd on Linux { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getprogname in -lc" >&5 @@ -5455,7 +5474,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_getprogname" >&5 $as_echo "$ac_cv_lib_bsd_getprogname" >&6; } if test "x$ac_cv_lib_bsd_getprogname" = xyes; then : - LIBBSD_LIBS=-lbsd + LIBS="${LIBS} -lbsd" fi @@ -5484,7 +5503,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then else as_fn_error $? "*** getprogname is not found. - On Ubuntu, sudo apt install libbsd-dev" "$LINENO" 5 +*** If you use Ubuntu, sudo apt install libbsd-dev" "$LINENO" 5 fi @@ -5492,8 +5511,7 @@ rm -f core conftest.err conftest.$ac_obj # libedit (editline) if test x"$ac_cv_header_histedit_h" = xyes; then - LIBEDIT_LIBS="-ledit -ltermcap" - + LIBS="${LIBS} -ledit -ltermcap" fi # libkqueue on Linux @@ -5534,7 +5552,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kqueue_kqueue" >&5 $as_echo "$ac_cv_lib_kqueue_kqueue" >&6; } if test "x$ac_cv_lib_kqueue_kqueue" = xyes; then : - LIBKQUEUE_LIBS=-lkqueue + LIBS="${LIBS} -lkqueue" fi @@ -5576,11 +5594,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzclose" >&5 $as_echo "$ac_cv_lib_z_gzclose" >&6; } if test "x$ac_cv_lib_z_gzclose" = xyes; then : - LIBZ_LIBS=-lz - + LIBS="${LIBS} -lz" else as_fn_error $? "*** zlib is not found. - On Ubuntu, sudo apt install zlib1g-dev" "$LINENO" 5 +*** If use use Ubuntu, sudo apt install zlib1g-dev" "$LINENO" 5 fi @@ -5598,7 +5615,9 @@ for c in ${wxconfig_paths}; do fi done if test -z "$wxconfig"; then - as_fn_error $? "*** wxWidgets-3.0 not found in ${wxconfig_paths}" "$LINENO" 5 + as_fn_error $? "*** wxWidgets-3.0 not found in ${wxconfig_paths} +*** If you use pkgsrc, install x11/wxGTK30. +*** If you use Ubuntu, sudo apt install libwxgtk3.0-gtk3-dev" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $wxconfig" >&5 $as_echo "$wxconfig" >&6; } @@ -5612,15 +5631,17 @@ $as_echo "$wxversion" >&6; } wxcppflags=`$wxconfig --cppflags` wxlibs=`$wxconfig --libs` - # XXX NetBSD の rpath。どうしたもんだかこれ - if test "`uname -s`" = "NetBSD"; then + case "${host_os}" in + netbsd*) + # rpath。どうしたもんだかこれ wxlibs=`echo $wxlibs | sed -e 's/-L\([^ ]*\) /-L\1 -Wl,-R,\1 /'` - fi + ;; - # XXX OSX の -framework AudioToolbox が指定されているとリンカがこけるorz - if test "`uname -s`" = "Darwin"; then + darwin*) + # XXX -framework AudioToolbox が指定されているとリンカがこけるorz wxlibs=`echo $wxlibs | sed -e 's/-framework AudioToolbox//'` - fi + ;; + esac WXWIDGETS_CPPFLAGS=$wxcppflags @@ -5723,7 +5744,8 @@ fi if test $MSGFMT = :; then as_fn_error $? "*** msgfmt not found. - On Ubuntu, sudo apt install gettext" "$LINENO" 5 +*** If you use pkgsrc, install devel/gettext-tools. +*** If you use Ubuntu, sudo apt install gettext" "$LINENO" 5 fi ac_config_files="$ac_config_files Makefile.cfg host/Makefile wx/Makefile util/mkcgrom/Makefile util/viewcgrom/Makefile"