#10202: Use pkg-config --define-variable option to set ${SAGE_ROOT} anytime pkg-
config is invoked
------------------------------+---------------------------------------------
   Reporter:  jason           |          Owner:  leif       
       Type:  enhancement     |         Status:  needs_info 
   Priority:  critical        |      Milestone:  sage-4.7.2 
  Component:  packages        |       Keywords:             
Work_issues:                  |       Upstream:  N/A        
   Reviewer:  Leif Leonhardy  |         Author:  Jason Grout
     Merged:                  |   Dependencies:             
------------------------------+---------------------------------------------

Comment(by leif):

 Replying to [comment:31 jason]:
 > It also seems like using PC_TOP_BUILD_DIR in this way goes against its
 purpose.  That would confuse users, I think.

 Well, it's just another situation where its application is useful (and
 which is quite similar to its original intent). The way Sage uses its own
 prefix / subtree of typical system directories
 (`$SAGE_ROOT/local/{bin,lib,include}`) is just not very common, so the
 developer of `pkg-config` didn't have it in mind.

 To make it less obscure (to people actually looking at the `.pc` files),
 we could use
 {{{
 SAGE_ROOT=${pc_top_builddir} # the latter is set "dynamically" by sage-env
 prefix=${SAGE_ROOT}/local
 ...
 # (further references to SAGE_ROOT rather than pc_top_builddir)
 }}}
 (Adding comments to the `.pc` files isn't bad anyway; I used to also add a
 comment telling when the file was [last] modified by Sage, e.g. for
 debugging.)

 [[BR]]

 W.r.t. users already using that variable (`pc_top_builddir`) for other
 purposes: [[BR]]
 I don't think anybody will have it in his/her system-wide `.pc` files, but
 at least in case `PKG_CONFIG_TOP_BUILD_DIR` is already set, we could issue
 a warning.

 [[BR]]

 Using `$${SAGE_ROOT}` instead isn't that safe, since programs using
 parameters supplied by `pkg-config` do ''not necessarily'' use the shell
 to execute commands with these parameters (though they usually do; I'm
 currently not aware of any counter-example), in which case
 `${SAGE_ROOT}/...` would get passed verbatim to the commands, e.g. to the
 compiler or the linker.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10202#comment:32>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to