--- nono/configure 2026/04/29 17:04:43 1.1.1.5 +++ nono/configure 2026/04/29 17:04:48 1.1.1.6 @@ -624,17 +624,20 @@ LIBOBJS MSGFMT WXWIDGETS_LIBS WXWIDGETS_CPPFLAGS -LIBZ_LIBS -LIBKQUEUE_LIBS -LIBEDIT_LIBS -LIBBSD_LIBS NETDRIVER KEVENT_UDATA_T 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 +1305,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 +2173,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 +3250,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 +3966,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 +4059,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 @@ -4717,11 +4790,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. + On 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 @@ -5355,17 +5431,57 @@ $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 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 + # 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 +case "${host_os}" in + linux*) + if test x"$ac_cv_header_linux_if_tun_h" = xyes; then + netdriver=tap + fi + ;; + openbsd*) + # OpenBSD has no but supports tap(4). netdriver=tap -elif test x"$ac_cv_header_net_bpf_h" = xyes; then - netdriver=bpf -else - netdriver=none + ;; +esac +if test -z "$netdriver"; then + if test x"$ac_cv_header_net_if_tap_h" = xyes; then + netdriver=tap + elif test x"$ac_cv_header_net_bpf_h" = xyes; then + netdriver=bpf + else + netdriver=none + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $netdriver" >&5 $as_echo "$netdriver" >&6; } @@ -5455,7 +5571,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 @@ -5492,8 +5608,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 +5649,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,8 +5691,7 @@ 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 @@ -5612,15 +5726,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