[Clam-devel] Patch for build system

Trevor Fancher trevor at fancher.org
Fri Feb 15 23:10:45 PST 2008


Hi,

I'm new to this list and also to CLAM and its build system so bear
with me.

I was attempting to build CLAM on my Mac and I hit a bug with the
build system. The problem is the CheckPkgConfigFile function defined
in scons/libs/clam_build_helpers.py assumes the environmental
variable PKG_CONFIG is set.  Since the MacPorts installation
documentation doesn't tell the user to set PKG_CONFIG and it doesn't
get set after installing pkgconfig, I am assuming PKG_CONFIG isn't
set on most systems using Macports.

The attached patch fixes the problem for me.  I'm not sure if this
is the proper way to solve the problem, but it's a start.


Trevor Fancher

-------------- next part --------------
A non-text attachment was scrubbed...
Name: build-system.patch
Type: application/octet-stream
Size: 734 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080216/53b2299c/attachment-0004.obj>
-------------- next part --------------



Index: scons/libs/clam_build_helpers.py
===================================================================
--- scons/libs/clam_build_helpers.py	(revision 11188)
+++ scons/libs/clam_build_helpers.py	(working copy)
@@ -193,7 +193,9 @@
  	if str(libname) != libname :
  		libname = " ".join(libname)
  	context.Message( 'Checking for %s pkg-config file... ' % libname)
-	command = "PKG_CONFIG_PATH='$PKG_CONFIG_PATH' $PKG_CONFIG --cflags -- 
libs %s"%libname
+	_,pkgconfig = context.TryAction( "echo $PKG_CONFIG" )
+	if pkgconfig == '': pkgconfig = "pkg-config"
+	command = "PKG_CONFIG_PATH='$PKG_CONFIG_PATH' %s --cflags --libs %s"  
% (pkgconfig, libname)
  	ret,_=context.TryAction( command )
  	context.Result(ret)
  	if not ret: return False




More information about the clam-devel mailing list