--- nono/configure 2026/04/29 17:04:33 1.1.1.3 +++ nono/configure 2026/04/29 17:04:48 1.1.1.6 @@ -621,16 +621,23 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +MSGFMT WXWIDGETS_LIBS WXWIDGETS_CPPFLAGS -LIBKQUEUE_LIBS -LIBEDIT_LIBS -LIBBSD_LIBS NETDRIVER KEVENT_UDATA_T CXXCPP WARNFLAGS_CXX WARNFLAGS_C +COMPILER +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build EGREP GREP CPP @@ -1298,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 @@ -2162,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 @@ -3210,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: @@ -3955,6 +3966,99 @@ $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 +$as_echo_n "checking for compiler... " >&6; } +if test -n "`${CC} -v 2>&1 | grep clang`" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: clang" >&5 +$as_echo "clang" >&6; } + COMPILER=CLANG +elif test -n "`${CC} -v 2>&1 | grep GCC`"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: gcc" >&5 +$as_echo "gcc" >&6; } + COMPILER=GCC +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +$as_echo "unknown" >&6; } + COMPILER= +fi + + # C++ のバージョンをチェック CXX_STD=-std=c++14 ac_ext=cpp @@ -4686,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 @@ -5324,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; } @@ -5342,6 +5489,51 @@ NETDRIVER=$netdriver # libbsd on Linux +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getprogname in -lc" >&5 +$as_echo_n "checking for getprogname in -lc... " >&6; } +if ${ac_cv_lib_c_getprogname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getprogname (); +int +main () +{ +return getprogname (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_c_getprogname=yes +else + ac_cv_lib_c_getprogname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_getprogname" >&5 +$as_echo "$ac_cv_lib_c_getprogname" >&6; } +if test "x$ac_cv_lib_c_getprogname" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBC 1 +_ACEOF + + LIBS="-lc $LIBS" + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getprogname in -lbsd" >&5 $as_echo_n "checking for getprogname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_getprogname+:} false; then : @@ -5379,15 +5571,44 @@ 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 +# なければ停止する +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include "confdefs.h" + #if defined(HAVE_BSD_BSD_H) + #include + #endif + +int +main () +{ + + getprogname() + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + # nothing to do on success + +else + as_fn_error $? "*** getprogname is not found. + On Ubuntu, sudo apt install libbsd-dev" "$LINENO" 5 + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # libedit (editline) if test x"$ac_cv_header_histedit_h" = xyes; then - LIBEDIT_LIBS="-ledit -ltermcap" - + LIBS="${LIBS} -ledit -ltermcap" fi # libkqueue on Linux @@ -5428,7 +5649,52 @@ 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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzclose in -lz" >&5 +$as_echo_n "checking for gzclose in -lz... " >&6; } +if ${ac_cv_lib_z_gzclose+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzclose (); +int +main () +{ +return gzclose (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_z_gzclose=yes +else + ac_cv_lib_z_gzclose=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +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 : + LIBS="${LIBS} -lz" +else + as_fn_error $? "*** zlib is not found. + On Ubuntu, sudo apt install zlib1g-dev" "$LINENO" 5 fi @@ -5460,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 @@ -5476,6 +5744,104 @@ $as_echo "$wxversion" >&6; } fi +# gettext +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}msgfmt", so it can be a program name with args. +set dummy ${ac_tool_prefix}msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MSGFMT"; then + ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MSGFMT="${ac_tool_prefix}msgfmt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MSGFMT=$ac_cv_prog_MSGFMT +if test -n "$MSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MSGFMT"; then + ac_ct_MSGFMT=$MSGFMT + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MSGFMT"; then + ac_cv_prog_ac_ct_MSGFMT="$ac_ct_MSGFMT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MSGFMT="msgfmt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MSGFMT=$ac_cv_prog_ac_ct_MSGFMT +if test -n "$ac_ct_MSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MSGFMT" >&5 +$as_echo "$ac_ct_MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MSGFMT" = x; then + MSGFMT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MSGFMT=$ac_ct_MSGFMT + fi +else + MSGFMT="$ac_cv_prog_MSGFMT" +fi + +if test $MSGFMT = :; then + as_fn_error $? "*** msgfmt not found. + On 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" ac_config_headers="$ac_config_headers config-nono.h"