--- nono/configure 2026/04/29 17:05:11 1.1.1.11 +++ nono/configure 2026/04/29 17:05:22 1.1.1.14 @@ -647,13 +647,19 @@ ac_includes_default="\ ac_header_cxx_list= ac_subst_vars='LTLIBOBJS LIBOBJS +ICONV_LIBS +ICONV_CPPFLAGS +NONO_LIBS +NONO_CPPFLAGS MSGFMT WXWIDGETS_LIBS WXWIDGETS_CPPFLAGS WITH_GUI +WX_MAJORMINOR HOSTNET_BPF HOSTNET_TAP HOSTNET_AFPACKET +HOST_HAS_AVX2 WARNFLAGS_CXX WARNFLAGS_C COMPILER @@ -720,6 +726,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_avx2 with_gui ' ac_precious_vars='build_alias @@ -1351,6 +1358,12 @@ if test -n "$ac_init_help"; then esac cat <<\_ACEOF +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-avx2 disable avx2 support + Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) @@ -1616,6 +1629,66 @@ printf "%s\n" "$ac_res" >&6; } } # ac_fn_cxx_check_type +# ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES +# ------------------------------------------------------ +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_cxx_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$4=yes" +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$4=yes" +else $as_nop + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_member + # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -4767,6 +4840,35 @@ rm -f core conftest.err conftest.$ac_obj fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether c++ accepts -Wsuggest-override" >&5 +printf %s "checking whether c++ accepts -Wsuggest-override... " >&6; } + old_CXXFLAGS="${CXXFLAGS}" + CXXFLAGS="${CXXFLAGS} -Werror -Wsuggest-override" + 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-Wsuggest-override=yes | sed -e 's/-/_/g'` + WARNFLAGS_CXX="${WARNFLAGS_CXX} -Wsuggest-override" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +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 -Wvla-extension" >&5 printf %s "checking whether c++ accepts -Wvla-extension... " >&6; } old_CXXFLAGS="${CXXFLAGS}" @@ -4797,6 +4899,68 @@ rm -f core conftest.err conftest.$ac_obj +# CPU が AVX2 をサポートしているか。 +# (OS がレジスタの退避などをサポートしているかとかはたぶん知る方法がない) +# Check whether --enable-avx2 was given. +if test ${enable_avx2+y} +then : + enableval=$enable_avx2; +else $as_nop + enable_avx2=yes +fi + + +if test x"${enable_avx2}" != x"no" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX2" >&5 +printf %s "checking for AVX2... " >&6; } + if test x"${host_cpu}" = x"x86_64"; then + if test x"${host_cpu}" = x"${build_cpu}"; then + old_CXXFLAGS="${CXXFLAGS}" + CXXFLAGS="${CXXFLAGS} -mavx2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + #if !defined(__AVX2__) + #error __AVX2__ is not defined by the compiler. + #endif + __m256i v; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + have_avx2=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS="${old_CXXFLAGS}" + fi + fi + if test x"${have_avx2}" = x"yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + printf "%s\n" "#define HAVE_AVX2 1" >>confdefs.h + + HOST_HAS_AVX2=yes + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + +fi + # Checks for libraries. # Checks for header files. @@ -4857,13 +5021,6 @@ then : fi -ac_fn_cxx_check_header_compile "$LINENO" "histedit.h" "ac_cv_header_histedit_h" "$ac_includes_default" -if test "x$ac_cv_header_histedit_h" = xyes -then : - printf "%s\n" "#define HAVE_HISTEDIT_H 1" >>confdefs.h - -fi - ac_fn_cxx_check_header_compile "$LINENO" "kqueue/sys/event.h" "ac_cv_header_kqueue_sys_event_h" "$ac_includes_default" if test "x$ac_cv_header_kqueue_sys_event_h" = xyes then : @@ -5811,6 +5968,131 @@ printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for statfs" >&5 +printf %s "checking for statfs... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + struct statfs buf; + statfs("", &buf); + + ; + 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_STATFS 1" >>confdefs.h + + have_statxxfs=statfs + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for statvfs" >&5 +printf %s "checking for statvfs... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + struct statvfs buf; + statvfs("", &buf); + + ; + 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_STATVFS 1" >>confdefs.h + + have_statxxfs=statvfs + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +if test -z "${have_statxxfs}"; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "*** No statfs() nor statvfs() found +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_fn_cxx_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" " + #include + +" +if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes +then : + + printf "%s\n" "#define HAVE_STAT_ST_TIMESPEC 1" >>confdefs.h + + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timegm" >&5 +printf %s "checking for timegm... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + timegm(NULL); + + ; + 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; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "*** No timegm() found +See \`config.log' for more details" "$LINENO" 5; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_getname_np" >&5 printf %s "checking for pthread_getname_np... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6029,40 +6311,6 @@ printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv const" >&5 -printf %s "checking for iconv const... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main (void) -{ - - const char **a; - iconv(0, a, 0, 0, 0); - - ; - 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_ICONV_CONST 1" >>confdefs.h - - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # # Network # @@ -6145,6 +6393,15 @@ else printf "%s\n" "no" >&6; } fi +# +# Other libraries +# + +# CHECK_LIB($1=name, $2=libs, $3=include, $4=src) + + +PATHS="none /usr/pkg /usr/local" + # libbsd on Linux { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getprogname in -lc" >&5 printf %s "checking for getprogname in -lc... " >&6; } @@ -6262,11 +6519,6 @@ else $as_nop fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -# libedit (editline) -if test x"$ac_cv_header_histedit_h" = xyes; then - LIBS="${LIBS} -ledit -ltermcap" -fi - # libkqueue on Linux { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for kqueue in -lkqueue" >&5 printf %s "checking for kqueue in -lkqueue... " >&6; } @@ -6369,7 +6621,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wx-config" >&5 printf %s "checking for wx-config... " >&6; } - wxconfig_paths="${WX_CONFIG} wx-config-3.0 wx-config" + wxconfig_paths="${WX_CONFIG} wx-config-3.2 wx-config-3.0 wx-config" wxconfig="" for c in ${wxconfig_paths}; do ver=`$c --version 2>&1 | cut -f 1 -d .` @@ -6379,8 +6631,8 @@ printf %s "checking for wx-config... " > fi done if test -z "$wxconfig"; then - as_fn_error $? "*** wxWidgets-3.0 not found in ${wxconfig_paths} -*** If you use pkgsrc, install x11/wxGTK30. + as_fn_error $? "*** wxWidgets-3.2 nor -3.0 not found in ${wxconfig_paths} +*** If you use pkgsrc, install x11/wxGTK32. *** If you use Ubuntu, sudo apt install libwxgtk3.0-gtk3-dev" "$LINENO" 5 else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wxconfig" >&5 @@ -6391,6 +6643,9 @@ printf %s "checking for wxWidgets versio wxversion=`$wxconfig --version` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wxversion" >&5 printf "%s\n" "$wxversion" >&6; } + wxmajorminor=`echo $wxversion | awk -F . '{print $1 $2}'` + WX_MAJORMINOR=${wxmajorminor} + wxcppflags=`$wxconfig --cppflags` wxlibs=`$wxconfig --libs` @@ -6531,6 +6786,118 @@ else $as_nop fi +# nono 本体のチェックはここまで。 +nono_CPPFLAGS=${CPPFLAGS} +nono_LIBS=${LIBS} +NONO_CPPFLAGS=${nono_CPPFLAGS} + +NONO_LIBS=${nono_LIBS} + + +# iconv は util/ でのみ必要。 +CPPFLAGS= +LIBS= + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } + for path in ${PATHS}; do + old_CPPFLAGS=${CPPFLAGS} + old_LIBS=${LIBS} + case ${path} in + none) + LIBS="${LIBS} -liconv" + ;; + *) + CPPFLAGS="${CPPFLAGS} -I${path}/include" + LIBS="${LIBS} -L${path}/lib -liconv" + ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + iconv_open("", ""); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + has_iconv=yes + break + +else $as_nop + + has_iconv=no + +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_iconv}" = 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_iconv}" = x"yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iconv needs const" >&5 +printf %s "checking whether iconv needs const... " >&6; } + old_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + const char **a; + iconv(0, a, 0, 0, 0); + + ; + 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_ICONV_CONST 1" >>confdefs.h + + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CPPFLAGS="${old_CPPFLAGS}" +fi + +iconv_CPPFLAGS=${CPPFLAGS} +iconv_LIBS=${LIBS} +ICONV_CPPFLAGS=${iconv_CPPFLAGS} + +ICONV_LIBS=${iconv_LIBS} + + 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"