The build framework of zip adds -DNO_DIR to CFLAGS after
failing to link this piece of test code:
int main() { return closedir(opendir(".")); }
However, zip does not take a case into account when it does not
need to link to an extra library for these functions.
When -DNO_DIR is used, the code in unix.c defines custom
opendir()/readdir()/closedir() functions in a way that GCC 14
chokes on.
GLIBC has both <dirent.h> and <sys/dir.h> and apps don't need
any extra library to link with.
Add a patch to remove the definition of NO_DIR.
Instead, use -DHAVE_DIRENT_H in the recipe.
Remove 0002-unix.c-Do-not-redefine-DIR-as-FILE.patch which
is now unnecessary.
This fixes the compiler error observed with GCC 14.
Change-Id: I6695873024d64bf610562e615cdcf42fa953b7ff
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>