Source: xnec2c Version: 1:4.4.12-1 Tags: patch upstream User: debian-cr...@lists.debian.org Usertags: ftcbfs
xnec2c fails to cross build from source, because it hard codes the build architecture pkg-config in src/Makefile.am. As a consequence, it fails to locate glib-compile-resources and then things go bad. Running pkg-config should only be done at configure time and preferrably using PKG_CHECK_MODULES or something similar. Then the result of that should be substituted into the generated Makefiles. I'm attaching a patch for your convenience. Helmut
--- xnec2c-4.4.12.orig/configure.ac +++ xnec2c-4.4.12/configure.ac @@ -29,6 +29,10 @@ AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) +PKG_CHECK_MODULES(GIO, [gio-2.0]) +GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0` +AC_SUBST([GLIB_COMPILE_RESOURCES]) + # GCC has atan2 as a built-in so the autoconf test casts it incorrectly and triggers a warning. # This causes -Werror to fail and then xnec2c does not link with -lm. Disable built-ins # for this test: --- xnec2c-4.4.12.orig/src/Makefile.am +++ xnec2c-4.4.12/src/Makefile.am @@ -55,8 +55,5 @@ xnec2c_LDADD = @PACKAGE_LIBS@ $(INTLLIBS) -PKGCONFIG = $(shell which pkg-config) -GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0) - xnec2c-resources.c: ../resources/xnec2c.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=../resources --generate-dependencies ../resources/xnec2c.gresource.xml) $(GLIB_COMPILE_RESOURCES) --sourcedir=../resources --target=xnec2c-resources.c --generate-source ../resources/xnec2c.gresource.xml