Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem building library when not Windows and application code is not C #923

Closed
jimbodeman opened this issue Feb 2, 2024 · 3 comments
Closed

Comments

@jimbodeman
Copy link

If compiling with Linux and application code is not C, a #include <unistd.h> is required in gzguts.h. I think this #include is expected to be in the application code but the application code used here is Ada. The ACT Gnat Pro compiler (based on gcc) is being used so it can handle compiling the Zlib library.

When built under Linux I get warnings for write, close, read and lseek.

Where this seems to work is inserting the #include directly after line 56 in gzguts.h that starts #if defined(STDC99)...

@madler
Copy link
Owner

madler commented Feb 3, 2024

./configure tests for unistd.h, and includes it if present. zlib is built with ./configure and make. How are you building zlib?

@jimbodeman
Copy link
Author

jimbodeman commented Feb 3, 2024

I build Zlib using the Gnat toolset. I have been putting the source code into a Gnat project and using gprbuild <project name>. Then the Ada code project with's the Zlib project. If I gprbuild <Ada project>, it automatically builds the Zlib library.

If I do ./configure, then gprbuild builds fine with no warnings. It also builds fine under Windows (using the Gnat toolset) with the modified zconf.h file.

If zconf.h is modified by ./configure, do I still need to meet the requirements of FAQ number 24?

@madler
Copy link
Owner

madler commented Feb 3, 2024

If I do ./configure, then gprbuild builds fine with no warnings. It also builds fine under Windows (using the Gnat toolset) with the modified zconf.h file.

Great! I will consider this resolved then.

If zconf.h is modified by ./configure, do I still need to meet the requirements of FAQ number 24?

No, no worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants