From 00520ebf68ba6bdfe44af9fc8647250ca47f1bba Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 7 Jul 2017 09:02:55 +0200 Subject: [PATCH] zip: -Werror=implicit-function-declaration --- packages/unzip/build.sh | 6 +- packages/unzip/unix-configure.patch | 87 +++++++++++++++++++++++------ packages/zip/build.sh | 6 +- packages/zip/unix-configure.patch | 87 +++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+), 27 deletions(-) create mode 100644 packages/zip/unix-configure.patch diff --git a/packages/unzip/build.sh b/packages/unzip/build.sh index 4c1ffedee..7457c0de6 100644 --- a/packages/unzip/build.sh +++ b/packages/unzip/build.sh @@ -12,9 +12,5 @@ termux_step_configure () { } termux_step_make () { - LD="$CC $LDFLAGS" CC="$CC $CFLAGS $CPPFLAGS $LDFLAGS" make -j $TERMUX_MAKE_PROCESSES generic -} - -termux_step_make_install () { - prefix=$TERMUX_PREFIX make install + LD="$CC $LDFLAGS" CC="$CC $CFLAGS $CPPFLAGS $LDFLAGS -DNO_LCHMOD" make -j $TERMUX_MAKE_PROCESSES generic } diff --git a/packages/unzip/unix-configure.patch b/packages/unzip/unix-configure.patch index b4e78adba..6edc35eee 100644 --- a/packages/unzip/unix-configure.patch +++ b/packages/unzip/unix-configure.patch @@ -1,23 +1,76 @@ diff -u -r ../unzip60/unix/configure ./unix/configure --- ../unzip60/unix/configure 2009-04-16 21:25:12.000000000 +0200 -+++ ./unix/configure 2017-07-07 08:46:56.815279304 +0200 -@@ -401,8 +401,8 @@ - rm -f "${temp_file}" ++++ ./unix/configure 2017-07-07 08:56:05.197092127 +0200 +@@ -379,72 +379,6 @@ - echo Check for memset + # Check for missing functions + # add NO_'function_name' to flags if missing +-for func in fchmod fchown lchown nl_langinfo +-do +- echo Check for $func +- echo "int main(){ $func(); return 0; }" > conftest.c +- $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null +- [ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`" +-done +- +-# Check (seriously) for a working lchmod. +-echo 'Check for lchmod' +-temp_file="/tmp/unzip_test_$$" +-temp_link="link_$$" +-( echo '#include ' ; \ +- echo "int main() { lchmod(\"${temp_file}\", 0666); }" \ +-) > conftest.c +-ln -s "${temp_link}" "${temp_file}" && \ +- $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null && \ +- ./conftest +-[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_LCHMOD" +-rm -f "${temp_file}" +- +-echo Check for memset -echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c -$CC -o conftest conftest.c >/dev/null 2>/dev/null -+printf "#include \nint main(){ char k; memset(&k,0,0); return 0; }" > conftest.c -+$CC -o conftest conftest.c >/dev/null - [ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DZMEM" - - echo Check for errno declaration -@@ -419,6 +419,8 @@ - - echo Check for directory libraries - cat > conftest.c << _EOF_ -+#include -+#include - int main() { return closedir(opendir(".")); } - _EOF_ +-[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DZMEM" +- +-echo Check for errno declaration +-cat > conftest.c << _EOF_ +-#include +-main() +-{ +- errno = 0; +- return 0; +-} +-_EOF_ +-$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null +-[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_ERRNO" +- +-echo Check for directory libraries +-cat > conftest.c << _EOF_ +-int main() { return closedir(opendir(".")); } +-_EOF_ +- +-$CC -o conftest conftest.c >/dev/null 2>/dev/null +-if [ $? -ne 0 ]; then +- OPT="" +- for lib in ndir dir ucb bsd BSD PW x dirent +- do +- $CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null +- [ $? -eq 0 ] && OPT=-l$lib && break +- done +- if [ ${OPT} ]; then +- LFLAGS2="${LFLAGS2} ${OPT}" +- else +- CFLAGSR="${CFLAGSR} -DNO_DIR" +- fi +-fi +- +-# Dynix/ptx 1.3 needed this +-echo Check for readlink +-echo "int main(){ return readlink(); }" > conftest.c +-$CC -o conftest conftest.c >/dev/null 2>/dev/null +-if [ $? -ne 0 ]; then +- $CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null +- [ $? -eq 0 ] && LFLAGS2="${LFLAGS2} -lseq" +-fi + echo Check for directory include file + OPT="" diff --git a/packages/zip/build.sh b/packages/zip/build.sh index be6befd8f..613ac374f 100644 --- a/packages/zip/build.sh +++ b/packages/zip/build.sh @@ -11,9 +11,5 @@ termux_step_configure () { } termux_step_make () { - prefix=$TERMUX_PREFIX LD="$CC $LDFLAGS" CC="$CC $CFLAGS $CPPFLAGS $LDFLAGS" PREFIX=$TERMUX_PREFIX make -j $TERMUX_MAKE_PROCESSES generic -} - -termux_step_make_install () { - prefix=$TERMUX_PREFIX make install + LD="$CC $LDFLAGS" CC="$CC $CFLAGS $CPPFLAGS $LDFLAGS" make -j $TERMUX_MAKE_PROCESSES generic } diff --git a/packages/zip/unix-configure.patch b/packages/zip/unix-configure.patch new file mode 100644 index 000000000..99c7ad2b2 --- /dev/null +++ b/packages/zip/unix-configure.patch @@ -0,0 +1,87 @@ +diff -u -r ../zip30/unix/configure ./unix/configure +--- ../zip30/unix/configure 2008-06-20 05:32:20.000000000 +0200 ++++ ./unix/configure 2017-07-07 08:53:36.218772657 +0200 +@@ -509,83 +509,6 @@ + # Check for missing functions + # add NO_'function_name' to flags if missing + +-for func in rmdir strchr strrchr rename mktemp mktime mkstemp +-do +- echo Check for $func +- echo "int main(){ $func(); return 0; }" > conftest.c +- $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null +- [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`" +-done +- +- +-echo Check for memset +-echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c +-$CC -o conftest conftest.c >/dev/null 2>/dev/null +-[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM" +- +- +-echo Check for memmove +-cat > conftest.c << _EOF_ +-#include +-int main() { int a; int b = 0; memmove( &a, &b, sizeof( a)); return a; } +-_EOF_ +-$CC -o conftest conftest.c >/dev/null 2>/dev/null +-[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_MEMMOVE" +- +- +-echo Check for strerror +-cat > conftest.c << _EOF_ +-#include +-int main() { strerror( 0); return 0; } +-_EOF_ +-$CC -o conftest conftest.c >/dev/null 2>/dev/null +-[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_STRERROR" +- +-echo Check for errno declaration +-cat > conftest.c << _EOF_ +-#include +-main() +-{ +- errno = 0; +- return 0; +-} +-_EOF_ +-$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null +-[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_ERRNO" +- +- +-echo Check for directory libraries +-cat > conftest.c << _EOF_ +-int main() { return closedir(opendir(".")); } +-_EOF_ +- +-$CC -o conftest conftest.c >/dev/null 2>/dev/null +-if [ $? -ne 0 ]; then +- OPT="" +- for lib in ndir dir ucb bsd BSD PW x dirent +- do +- $CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null +- [ $? -eq 0 ] && OPT=-l$lib && break +- done +- if [ ${OPT} ]; then +- LFLAGS2="${LFLAGS2} ${OPT}" +- else +- CFLAGS="${CFLAGS} -DNO_DIR" +- fi +-fi +- +- +-# Dynix/ptx 1.3 needed this +- +-echo Check for readlink +-echo "int main(){ return readlink(); }" > conftest.c +-$CC -o conftest conftest.c >/dev/null 2>/dev/null +-if [ $? -ne 0 ]; then +- $CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null +- [ $? -eq 0 ] && LFLAGS2="${LFLAGS2} -lseq" +-fi +- +- + echo Check for directory include file + OPT="" + for inc in dirent.h sys/ndir.h ndir.h sys/dir.h