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

Build issue while cross-compiling #9

Open
ErwanGa opened this issue Nov 7, 2017 · 2 comments
Open

Build issue while cross-compiling #9

ErwanGa opened this issue Nov 7, 2017 · 2 comments

Comments

@ErwanGa
Copy link

ErwanGa commented Nov 7, 2017

Hello
I'm currently trying to properly cross compile your library, but I'm facing an issue.

I notice the following in your README

- Edit the three variables at the beginning of the Makefile to reflect
  the location where Zlib is installed on your system.  The defaults
  are OK for Linux.

But I really prefer using environment variable instead of modifying the sources.
It's easiest for the integration in a complete cross compilation build system
Could I suggest the following patch to avoid such issue ?
Thanks
Erwan

--- Makefile.ori	2017-11-07 11:41:26.375257045 +0100
+++ Makefile	2017-11-07 11:41:38.719314251 +0100
@@ -5,12 +5,12 @@
 
 # The directory containing the Zlib library (libz.a or libz.so)
 # Leave empty if libz is in a standard linker directory
-ZLIB_LIBDIR=
+ZLIB_LIBDIR?=
 # ZLIB_LIBDIR=/usr/local/lib
 
 # The directory containing the Zlib header file (zlib.h)
 # Leave empty if zlib.h is in a standard compiler directory
-ZLIB_INCLUDE=
+ZLIB_INCLUDE?=
 # ZLIB_INCLUDE=/usr/local/include
 
 # Where to install the library.  By default: sub-directory 'zip' of

@xavierleroy
Copy link
Owner

Apologies for leaving this report unanswered for so long.

You can definitely override the ZLIB_LIBDIR and ZLIB_INCLUDE variables from the command-line that invokes make:

    make ZLIB_LIBDIR=/opt/lib ZLIB_INCLUDE=/opt/include

I am not a fan of environment variables that silently affect Makefile variables...

Stepping back, everyone is unhappy with this "edit the Makefile" configuration procedure for this library, which should be replaced by a proper configure script. For your cross-compilation purposes, what would be a good interface for this configure script?

@ErwanGa
Copy link
Author

ErwanGa commented Jan 17, 2018

Hi
Thanks for your reply. I'm using a local patch for the moment, so it's not really urgent.

I fully agree with silent environment variables problem, but I've unfortunately to use opam (It's not really the best way for cross-compiling purpose but It's a not chosen constraint). In this context , env. variables is the easiest way I found for overriding the default configuration.

In my great world for cross-compiling (ie without opam), a 'configure' shell script with some options as --zlib-include --zlib-libdir, --ocaml-bin etc in charge of generating the makefile is enough.

BR
Erwan

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