GNOME Bugzilla – Bug 590174
evince-2.27.4 fails to compile with --with-smclient=xsmp
Last modified: 2009-11-01 11:38:23 UTC
Please describe the problem: Hey, related to gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=279591, evince fails to build if --with-smclient=xsmp is given to the configure script. Prototype of AC_ARG_WITH is the following : AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given]) action-if-given is executed only if a option --{with,without}-smclient is given to the configure script, is nothing is given action-if-not-given is executed. The problem was SMCLIENT_PKGS="sm >= 1.0.0" was assigned ONLY IF nothing was given to the configure (default behaviour) so in action-if-not-given. If the user gave --with-smclient=stuff "[]" was executed, and then SMCLIENT_PKGS was empty, then the PKG_CHECK_MODULES into the if statement didn't check it, and necesseraly libSM's cflags and libs wasn't found (so didn't set respectively into SMCLIENT_CFLAGS and SMCLIENT_LIBS) You will find in attachment a patch which normally solves the problem. Regards, Romain. Steps to reproduce: 1. start ./configure --with-smclient=xsmp 2. make 3. compilation fails Actual results: Expected results: Does this happen every time? Other information:
Created attachment 139494 [details] [review] Patch which solves the problem
This is wrong. Just remove the SMCLIENT_PKGS assignment from the action-if-not-given case, and add an extra case check outside the AC_ARG_WITH where you set it.
Yeah but if some checks was done in action-if-not-given (before the patch), ie when the support was activated as default, This implies that these checks was needed when the support was activated nop ? that's why I moved it into the if outside the AC_ARG_WITH.
Your patch is wrong; it overwrites a --with-smclient value with the default. Just delete SMCLIENT_PKGS="sm >= 1.0.0" from the action-if-not-given code, then do case "$with_smclient" in xsmp) SMCLIENT_PKGS="sm >= 1.0.0" ;; *) ;; esac outside the AC_ARG_WITH, before the 'if test "$with_smclient" != "no"; then ' line.
Fixed on master.