-
Notifications
You must be signed in to change notification settings - Fork 19
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
autoconf: use API archives for pkg-config #81
Comments
The commits above show-case the approach but are not finalized yet. |
That looks very reasonable to me. By the way, the more include-specific quirks I see being added to Goa, the more I feel the urge to make use of the import-*.mk files instead. |
Alternatively, we could think about introducing conventions that API archives are expected to follow, similar to the convention of the Genode build system that incorporates include// into the include-search paths whereas the values depend on the architecture. Right now, Goa has only the single obvious convention that headers are searched in include/, which apparently doesn't cut it. In the case of OpenSSL, it is a bit strange to see the include path pointing into src/. Maybe the archive could mirror the headers at include? |
Except for a few special cases (e.g. SDL/SDL2 which required include/SDL2 being added into the include-search paths) introducing architecture-specific conventions should eliminate most quirks.
That's a common pattern if the include files don't reside in the contrib directory but at src/lib/.... |
@nfeske I just noticed that Goa indeed already has a policy in place to add architecture-specific includes paths. The point of the existing quirks is actually that, for some libraries, we need additional subdirectories in the include paths. |
Thanks @jschlatow for the clarification. So we are fine already in this respect. I'm sorry for the noise. |
If a used API contains an import-<api-name>.mk file, we evalute this in order to set the include directories appropriately. This relieves us from most quirks. genodelabs#81
For now this import file is solely there to satisfy the mechansim in Goa that collecteds an incorporates import files for used APIs. Issue genodelabs/goa#81.
@jschlatow thanks for the commit - I've cherry-picked b18045e (and the fixup commit on your branch). It works fine but I had to adapt the |
@cnuke I'm ready to merge the preparatory commits (curl, openssl) to genode staging. Please merge the following cleanup into the import-openssl.mk commit. diff --git a/repos/libports/lib/import/import-libcrypto.mk b/repos/libports/lib/import/import-libcrypto.mk
index 3878ca4a8c8..bd8a17b9d39 100644
--- a/repos/libports/lib/import/import-libcrypto.mk
+++ b/repos/libports/lib/import/import-libcrypto.mk
@@ -1,9 +1,9 @@
LIB_OPENSSL_DIR = $(call select_from_repositories,src/lib/openssl)
-ARCH = $(filter 32bit 64bit,$(SPECS))
-
OPENSSL_DIR := $(call select_from_ports,openssl)
+ARCH = $(filter 32bit 64bit,$(SPECS))
+
INC_DIR += $(OPENSSL_DIR)/include
INC_DIR += $(LIB_OPENSSL_DIR)/spec/$(ARCH)
diff --git a/repos/libports/lib/import/import-libssl.mk b/repos/libports/lib/import/import-libssl.mk
index 54ea68accec..1c50108524d 100644
--- a/repos/libports/lib/import/import-libssl.mk
+++ b/repos/libports/lib/import/import-libssl.mk
@@ -2,9 +2,9 @@ LIB_OPENSSL_DIR = $(call select_from_repositories,src/lib/openssl)
OPENSSL_DIR := $(call select_from_ports,openssl)
-LIBS += libcrypto
-
ARCH = $(filter 32bit 64bit,$(SPECS))
INC_DIR += $(OPENSSL_DIR)/include
INC_DIR += $(LIB_OPENSSL_DIR)/spec/$(ARCH)
+
+LIBS += libcrypto |
For now this import file is solely there to satisfy the mechansim in Goa that collects and incorporates import files for used APIs. Issue genodelabs/goa#81.
For now this import file is solely there to satisfy the mechansim in Goa that collects and incorporates import files for used APIs. Issue genodelabs/goa#81.
For now this import file is solely there to satisfy the mechansim in Goa that collects and incorporates import files for used APIs. Issue genodelabs/goa#81.
I want to bump this issue as I have now encountered two additional projects that would benefit from .pc file handling that is more in line with expectations, namely (Naturally there are follow-up short-comings I encountered along the way but those can be discussed afterwards.) |
@cnuke Thanks for the reminder, I must admit that I totally lost track of this issue. In the meantime, @ssumpf added meson support in #94 for which he wrote a custom script to replace pkg-config. Do you think such an approach would be practical for autoconf as well? With the changes in #99 it will be a walk in the park to replace /usr/bin/pkg-config. My intuition is that we probably still need some .pc files (e.g. if version information is needed), yet a custom script/wrapper could allow us to cover the trivial cases. Either way I'd like to prevent maintaining two paths: one for autoconf, one for meson. What do you think? |
Well, now we are already in “Naturally there are follow-up short-comings…” territory ;-) but I think the TL;DR is having .pc files around for version check is agreeable, it stands to reason how and in what capacity they should be evaluated. — I what like to apologise for the following wall of text in advance - my primary intend is to raise awareness, taking immediate action is not required.
For ❷ is a problem when ❶ is expected as the tool itself is extended on demand - with
I have the same feeling and apparently we are not far off as For
The autotools and also meson (at least I have seen it in one instance) already ask the “proper” Whether we use That brings us to another short-coming - again nothing new here - in that all dependencies, used_apis, are used when compiling and linking. In case of a program like
I agree. From my perspective pkg-config looks like the lowest common denominator and currently we rather work around than with it. ¹) That might be different when we use goa on Genode directly and --host and --build are the same. |
Considering that pkg-config is commonly used by many build systems, I believe having .pc files around will become very useful. |
Since Goa expects include files to reside at include/ or include/spec/{x86,x86_64,arm_64,64bit}, the src/lib/.../opensslconf.h is missed by Goa. This commit adds Goa compatibility for the openssl api archive. genodelabs/goa#81
@cnuke I merged the autoconf support to staging (e0d360e). With respect to the openssl quirks, I came to the conclusion that adding import-.mk support to Goa is not worthwhile when we consider that more ports are going to move to Goa and api archives created with Goa will not feature import-.mk files. Therefore, mirroring the required include files at the archive's include/ directory seems more appropriate. You'll find the corresponding api archive published on my depot. @chelmuth Can you merge genodelabs/genode@375daa3 to staging? |
@chelmuth I also noticed that curl relies on pkg-config to determine the availability of zlib. I therefore added the corresponding zlib.pc file to the api archive in genodelabs/genode@9598484. |
While porting uacme I encountered configure problems because host libraries got picked up instead of the ones provides by Genode. Since we already went down the road of providing cmake files in the API archives doing the same for pkg-config feels natural.
The text was updated successfully, but these errors were encountered: