The build framework of zip adds -DNO_DIR to CFLAGS after 60/311460/2
authorDongkyun Son <dongkyun.s@samsung.com>
Tue, 21 May 2024 10:39:25 +0000 (19:39 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Tue, 21 May 2024 10:59:53 +0000 (10:59 +0000)
commitd1affffac17e541a39efab2e61e9ab674db37270
tree398d3abf2234ef498117344dcc6c7470fa6c5b0d
parenta267379b76950cdfdfd3d60c419d3622de204c2a
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>
unix/configure
unix/unix.c