libepoxy icon indicating copy to clipboard operation
libepoxy copied to clipboard

change hardcoded library names to less hardcoded names.

Open bramoosterhuis opened this issue 6 years ago • 2 comments

Sharing is caring, after an upgrade of WebKit I needed to use libepoxy on several platforms that are not based on Android, which didn't have e.g. libEGL.so.1 and I wasn't allowed to introduce extra symbolic links. So I thought there must be a way to specify the graphics library names from a build system level. This is maybe not the cleanest way, but this way you can add the names using defines at build time. e.g. in my buildroot makefile:

ifeq ($(BR2_PACKAGE_PLATFORM_X),y) LIBEPOXY_CONF_OPTS +=
CFLAGS='$(TARGET_CFLAGS)
-DGLX_LIB_NAME="libGLESv2.so"
-DEGL_LIB_NAME="libEGL.so"
-DGLES1_LIB_NAME="libGLESv1_CM.so"
-DGLES2_LIB_NAME="libGLESv2.so"' else LIBEPOXY_MAKE_OPTS +=
CFLAGS='$(TARGET_CFLAGS)
-DGLX_LIB_NAME="libGL.so.1"
-DEGL_LIB_NAME="libEGL.so.1"
-DGLES1_LIB_NAME="libGLESv1_CM.so.1"
-DGLES2_LIB_NAME="libGLESv2.so.2"' endif

bramoosterhuis avatar Oct 20 '17 11:10 bramoosterhuis

Not having fallbacks in place is clearly not going to work — as the CI shows.

Additionally, this has to work with both Autotools (on their way out) and Meson/Ninja.

ebassi avatar Oct 20 '17 11:10 ebassi

This is still not going to work for Meson builds.

Ideally, I'd rather have a configure-time option instead of adding random #define pre-processor directives to the compiler flags.

Something like:

$ ./configure --with-opengl-lib=/some/weird/prefix/lib/libGL.so.42

or:

$ meson -Dopengl_lib=/some/weird/prefix/lib/libGL.so.42 _build

ebassi avatar Oct 20 '17 12:10 ebassi