* build-package.sh: add possibility for debug patches and TERMUX_PKG_HAS_DEBUG
Setting TERMUX_PKG_HAS_DEBUG=no disables attempt to build debug build of
package.
Useful for example if a debug build doesn't make sense, as for python-packages
and texlive.
* aapt: skip D_FORTIFY_SOURCE=2 for libandroid-cutils when doing debug build
* lftp: skip D_FORTIFY_SOURCE=2 for debug build
* libflac: don't use -g3 for debug build
Configure script removes it otherwise.
* nano: skip -D_FORTIFY_SOURCE=2 for debug build
* vifm: skip -D_FORTIFY_SOURCE=2 for debug build
* mc: skip -D_FORTIFY_SOURCE=2 for debug build
* dropbear: add __attribute__((overloadable)) to XMEMSET and XMEMCPY if debug
* gdb: add __attribute__((overloadable)) to strchr if debug
* gnuit: add __attribute__((overloadable)) to strchr and strcpy if debug
* gperf: add __attribute__((overloadable)) to strlen if debug
* inetutils: add __attribute__((overloadable)) to strrchr and strchr if debug
* readline: add __attribute__((overloadable)) to strchr if debug
* tsocks: add __attribute__((overloadable)) to poll if debug
* units: add __attribute__((overloadable)) to strchr if debug
* liblua: fix bug in loslib.c that emerged in debug build
Use strncpy instead of strcpy.
Original error message:
loslib.c:169:3: error: 'strcpy' called with string bigger than buffer
lua_tmpnam(buff, err);
^
loslib.c:122:37: note: expanded from macro 'lua_tmpnam'
strcpy(b, LUA_TMPNAMTEMPLATE); \
^
* alpine: include our getpass.h in imap's mtest.c to declare getpass
Debug build complained about the previous implicit declaration.
* nginx: use --with-debug instead of --debug
* cboard: skip -D_FORTIFY_SOURCE=2 for debug build
* gettext: add __attribute__((overloadable)) to getcwd if debug
* oathtool: skip -D_FORTIFY_SOURCE=2 for debug build
* php: add __attribute__((overloadable)) to strlcpy and strlcat if debug
* expect: add __attribute__((overloadable)) to strchr if debug
* texlive: set TERMUX_PKG_HAS_DEBUG=no
* asciinema: set TERMUX_PKG_HAS_DEBUG=no
* libllvm: set TERMUX_PKG_HAS_DEBUG=no
Debug build fails with:
home/builder/.termux-build/libllvm/src/lib/Support/Unix/Path.inc:740:19: error: no matching function for call to 'RetryAfterSignal' if ((ResultFD = sys::RetryAfterSignal(-1, open, P.begin(), OpenFlags)) < 0)
* build-package.sh: set TERMUX_PKG_REPLACES=package if debug build
Hopefully allows us to install debug packages without breaking dependecies.
Should be looked over and be made more similar to how debian does this in any case
* Update build.sh
Work around rpl_malloc being used, see
http://wiki.buici.com/xwiki/bin/view/Programing+C+and+C%2B%2B/Autoconf+and+RPL_MALLOC
for more information:
"The AC_FUNC_MALLOC macro makes sure that the malloc function when passed a zero
argument returns a valid memory block instead of a NULL pointer. This behaviour
conforms to the GNU C library. Normally, this is a reasonable test that autoconf
makes at build-time. In the case of cross-compilation, however, autoconf cannot
execute a program to verify proper behavior. It makes the conservative assumption
that the target library will produce non-conforming code.
Failure of this test causes autconf to replace malloc() calls with rpl_malloc()
calls. At link time, if there is no rpl_malloc() function, the linker will fail
with an error describing the missing symbol. The autoconf documentation recommends
adding this harmless code to the application to implement the function."
In Termux the rpl_malloc() usage is useless at best, and may also prevent building
some packages as well as giving runtime crashes for libgc-using packages or others
expecting to intercept malloc.
Previously some packages specified worked around this themselves, but the configure
arguments are now moved into build-package.sh.