[gtkada] Patch: Fully honor --disable-static.

Emmanuel Briot briot at adacore.com
Tue Jul 21 17:33:44 CEST 2015


> GTKada's new build system builds static libraries even if the user
> specifies --disable-static. Here's a patch to rectify this. By not
> overriding LIBRARY_TYPE it allows tools.gpr and testgtk.gpr to link to
> the shared libraries when the static libraries are disabled.

Hello Bjorn,

I agree there is a bug there when we systematically recompile the static
libraries.
I am not completely good with your patch: when the static libraries are built,
we want the tools to link with the static libraries, since that makes running the
tool potentially easier (no need to set LD_LIBRARY_PATH).

Therefore, I suggest a small variant on your patch. What do you think ?

Thanks
Emmanuel



diff --git a/Makefile.in b/Makefile.in
index 89d9197..efc94e3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -43,14 +43,16 @@ exampledir=${DESTDIR}${prefix}/share/examples/gtkada/testgtk

 all:

-ifeq (${BUILD_STATIC}, yes)
-all: static
-install: install/static
-endif
-
 ifeq (${BUILD_SHARED},yes)
-all: relocatable
+all tools tests: relocatable
 install: install/relocatable
+LIBRARY_TYPE_FOR_TOOLS=relocatable
+endif
+
+ifeq (${BUILD_STATIC}, yes)
+all tools tests: static
+install: install/static
+LIBRARY_TYPE_FOR_TOOLS=static
 endif

 all: tools tests
@@ -59,7 +61,7 @@ relocatable: build_library_type/relocatable

 tools:
        @echo "====== Building tools ====="
-       ${GPRBUILD_FULL} -XLIBRARY_TYPE=static -Psrc/tools/tools.gpr
+       ${GPRBUILD_FULL} -XLIBRARY_TYPE=$(LIBRARY_TYPE_FOR_TOOLS) -Psrc/tools/tools.gpr

 build_library_type/%:  src/gtkada-intl.adb
        @echo "====== Building $(@F) libraries ====="
@@ -74,9 +76,9 @@ src/gtkada-intl.adb: src/gtkada-intl.gpb Makefile
 testgtk/opengl/view_gl.adb: testgtk/opengl/view_gl.gpb Makefile
        gnatprep -r -c -DHAVE_GL=${HAVE_OPENGL} -DWIN32=False testgtk/opengl/view_gl.gpb $@

-tests: testgtk/opengl/view_gl.adb static
+tests: testgtk/opengl/view_gl.adb
        @echo "====== Building tests ====="
-       ${GPRBUILD_FULL} -XLIBRARY_TYPE=static -Ptestgtk/testgtk.gpr
+       ${GPRBUILD_FULL} -XLIBRARY_TYPE=$(LIBRARY_TYPE_FOR_TOOLS) -Ptestgtk/testgtk.gpr

 install/%: force
        ${GPRINSTALL_FULL} -XLIBRARY_TYPE=$(@F) --build-name=$(@F) \
@@ -97,9 +99,9 @@ ifneq (,$(wildcard $(prefix)/lib/gnat/manifests/gtkada))
 endif

 install: install-clean
-       ${GPRINSTALL_FULL} -XLIBRARY_TYPE=static \
+       ${GPRINSTALL_FULL} -XLIBRARY_TYPE=$(LIBRARY_TYPE_FOR_TOOLS) \
                --mode=usage -Psrc/tools/tools.gpr
-       ${GPRINSTALL_FULL} -XLIBRARY_TYPE=static \
+       ${GPRINSTALL_FULL} -XLIBRARY_TYPE=$(LIBRARY_TYPE_FOR_TOOLS) \
                --mode=usage --exec-subdir=${exampledir} \
                -Ptestgtk/testgtk.gpr



More information about the gtkada mailing list