build-package.sh: Avoid more gnulib wrappers
authorFredrik Fornwall <fredrik@fornwall.net>
Sat, 4 Feb 2017 00:15:26 +0000 (01:15 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Sat, 4 Feb 2017 00:15:26 +0000 (01:15 +0100)
build-package.sh

index 2790f6f..8924131 100755 (executable)
@@ -661,19 +661,46 @@ termux_step_configure_autotools () {
        done
        export PATH=$TERMUX_PKG_TMPDIR/config-scripts:$PATH
 
-       # See http://wiki.buici.com/xwiki/bin/view/Programing+C+and+C%2B%2B/Autoconf+and+RPL_MALLOC
-       # about this problem which may cause linker errors in test scripts not undef:ing malloc and
-       # also cause problems with e.g. malloc interceptors such as libgc:
-       local AVOID_AUTOCONF_WRAPPERS="ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes"
-       # Similarly, disable gnulib's rpl_getcwd(). It returns the wrong value, affecting zile. See
-       # <https://github.com/termux/termux-packages/issues/76>.
-       AVOID_AUTOCONF_WRAPPERS+=" gl_cv_func_getcwd_null=yes gl_cv_func_getcwd_posix_signature=yes gl_cv_func_getcwd_path_max=yes gl_cv_func_getcwd_abort_bug=no"
-       AVOID_AUTOCONF_WRAPPERS+=" gl_cv_header_working_fcntl_h=yes gl_cv_func_fcntl_f_dupfd_cloexec=yes gl_cv_func_fcntl_f_dupfd_works=yes"
-       # Remove rpl_gettimeofday reference when building at least coreutils:
-       AVOID_AUTOCONF_WRAPPERS+=" gl_cv_func_tzset_clobber=no gl_cv_func_gettimeofday_clobber=no gl_cv_func_gettimeofday_posix_signature=yes"
-
-       # NOTE: We do not want to quote AVOID_AUTOCONF_WRAPPERS as we want word expansion.
-       env $AVOID_AUTOCONF_WRAPPERS "$TERMUX_PKG_SRCDIR/configure" \
+       # Avoid gnulib wrapping of functions when cross compiling. See
+       # http://wiki.osdev.org/Cross-Porting_Software#Gnulib
+       # https://gitlab.com/sortix/sortix/wikis/Gnulib
+       # https://github.com/termux/termux-packages/issues/76
+       local AVOID_GNULIB=""
+       AVOID_GNULIB+=" ac_cv_func_malloc_0_nonnull=yes"
+       AVOID_GNULIB+=" ac_cv_func_realloc_0_nonnull=yes"
+       AVOID_GNULIB+=" am_cv_func_working_getline=yes"
+       AVOID_GNULIB+=" gl_cv_func_dup2_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_fcntl_f_dupfd_cloexec=yes"
+       AVOID_GNULIB+=" gl_cv_func_fcntl_f_dupfd_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_getcwd_abort_bug=no"
+       AVOID_GNULIB+=" gl_cv_func_getcwd_null=yes"
+       AVOID_GNULIB+=" gl_cv_func_getcwd_path_max=yes"
+       AVOID_GNULIB+=" gl_cv_func_getcwd_posix_signature=yes"
+       AVOID_GNULIB+=" gl_cv_func_gettimeofday_clobber=no"
+       AVOID_GNULIB+=" gl_cv_func_gettimeofday_posix_signature=yes"
+       AVOID_GNULIB+=" gl_cv_func_link_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_lstat_dereferences_slashed_symlink=yes"
+       AVOID_GNULIB+=" gl_cv_func_memchr_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_mkdir_trailing_dot_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_mkdir_trailing_slash_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_select_detects_ebadf=yes"
+       AVOID_GNULIB+=" gl_cv_func_snprintf_retval_c99=yes"
+       AVOID_GNULIB+=" gl_cv_func_stat_dir_slash=yes"
+       AVOID_GNULIB+=" gl_cv_func_stat_file_slash=yes"
+       AVOID_GNULIB+=" gl_cv_func_strerror_0_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_symlink_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_tzset_clobber=no"
+       AVOID_GNULIB+=" gl_cv_func_unlink_honors_slashes=yes"
+       AVOID_GNULIB+=" gl_cv_func_unlink_honors_slashes=yes"
+       AVOID_GNULIB+=" gl_cv_func_wcwidth_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_working_getdelim=yes"
+       AVOID_GNULIB+=" gl_cv_func_working_mkstemp=yes"
+       AVOID_GNULIB+=" gl_cv_func_working_mktime=yes"
+       AVOID_GNULIB+=" gl_cv_func_working_strerror=yes"
+       AVOID_GNULIB+=" gl_cv_header_working_fcntl_h=yes"
+
+       # NOTE: We do not want to quote AVOID_GNULIB as we want word expansion.
+       env $AVOID_GNULIB "$TERMUX_PKG_SRCDIR/configure" \
                --disable-dependency-tracking \
                --prefix=$TERMUX_PREFIX \
                --disable-rpath --disable-rpath-hack \