--- libaitcfg/configure 2024/03/18 09:13:12 1.30.2.1 +++ libaitcfg/configure 2024/10/29 00:55:43 1.30.2.4 @@ -616,7 +616,40 @@ PACKAGE_BUGREPORT='misho@elwix.org' PACKAGE_URL='' ac_unique_file="src/aitcfg.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= ac_subst_vars='LTLIBOBJS +DEBIAN_ARCH LIBOBJS MKDEP target_os @@ -1495,6 +1528,39 @@ fi } # ac_fn_c_try_link +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + 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" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { 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_c_check_header_compile + # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that @@ -2202,6 +2268,15 @@ main (int argc, char **argv) } " +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub install-sh" @@ -3795,9 +3870,25 @@ fi -CFLAGS="-Wall -O2 -fPIC ${CFLAGS}" -LDFLAGS="${LDFLAGS}" +if test x"${prefix}" = x"NONE"; then + prefix="/usr/local" +fi +if test x"${exec_prefix}" = x"NONE"; then + exec_prefix=${prefix} +fi +if test "${ac_cv_env_CFLAGS_set}" != "set"; then + CFLAGS="-Wall -O2 -I${includedir}" +else + CFLAGS="${ac_cv_env_CFLAGS_value}" +fi +if test "${ac_cv_env_LDFLAGS_set}" = "set"; then + LDFLAGS="${ac_cv_env_LDFLAGS_value}" +else + LDFLAGS="-L$(eval echo ${libdir})" +fi + + # Checks for libraries. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5 @@ -3888,7 +3979,68 @@ fi # Checks for header files. +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "bsd/string.h" "ac_cv_header_bsd_string_h" "$ac_includes_default" +if test "x$ac_cv_header_bsd_string_h" = xyes +then : + printf "%s\n" "#define HAVE_BSD_STRING_H 1" >>confdefs.h + +fi + + # Checks for typedefs, structures, and compiler characteristics. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } @@ -4149,12 +4301,6 @@ printf "%s\n" "#define realloc rpl_realloc" >>confdefs fi -ac_fn_c_check_func "$LINENO" "bzero" "ac_cv_func_bzero" -if test "x$ac_cv_func_bzero" = xyes -then : - printf "%s\n" "#define HAVE_BZERO 1" >>confdefs.h - -fi ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes then : @@ -4201,13 +4347,36 @@ printf "%s\n" "#define NDEBUG /**/" >>confdefs.h ;; esac +else $as_nop + +printf "%s\n" "#define NDEBUG /**/" >>confdefs.h + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DEBUG" >&5 printf "%s\n" "$DEBUG" >&6; } -ac_config_files="$ac_config_files Makefile inc/Makefile lib/Makefile debian/Makefile src/Makefile" +DEBIAN_ARCH=$target_cpu +if test "x$target_cpu" = "xarm6l" -o "x$target_cpu" = "xarm7l" +then : + DEBIAN_ARCH="armhf" +fi +if test "x$target_cpu" = "xaarch64" +then : + DEBIAN_ARCH="arm64" +fi +if test "x$target_cpu" = "xi686" +then : + DEBIAN_ARCH="i386" +fi +if test "x$target_cpu" = "xx86_64" +then : + DEBIAN_ARCH="amd64" +fi + +ac_config_files="$ac_config_files Makefile inc/Makefile lib/Makefile debian/Makefile debian/control src/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -4898,6 +5067,7 @@ do "inc/Makefile") CONFIG_FILES="$CONFIG_FILES inc/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "debian/Makefile") CONFIG_FILES="$CONFIG_FILES debian/Makefile" ;; + "debian/control") CONFIG_FILES="$CONFIG_FILES debian/control" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;