From owner-freebsd-ports@FreeBSD.ORG Fri Dec 5 08:27:47 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 436181065670 for ; Fri, 5 Dec 2008 08:27:47 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from po-out-1718.google.com (po-out-1718.google.com [72.14.252.153]) by mx1.freebsd.org (Postfix) with ESMTP id C7D7B8FC18 for ; Fri, 5 Dec 2008 08:27:46 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by po-out-1718.google.com with SMTP id y22so6864602pof.3 for ; Fri, 05 Dec 2008 00:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=fbc1W2Rt4OIwm6w1kNRt7YmzCpLe9MwsKwuh+5uyjiI=; b=WItSVpFyg1wMvV0oMISwK8SH9hH5FMgMIFCy+1+/lkLHNjFL4J8aZsfxnOipumaJh5 Uhybitpz5QsRdfytIy74mwfkXNCo8woSnigZPgEo4Mr+VLWz/wM6ADfu++jY6T/71Jr4 kcGWlxTV5NLnp+y53wG12dvvX+6lANBXroWd0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=NDO+5Kl2nJqWXTa69spe3qMACQ8xSTvjJmAjYkBTE9W+fiR4HjkNv1RpxJyMxdzN9A aAIAzjT9Wh7jiZW1MyM0FBaTvdkmQA2Leq93MnMHJhnuk2vXyCyZHxjV6Sc7EuDVkX9X 78m43PT/Y2rAgxkonMZ0dC0rNzmw3xicR9S4o= Received: by 10.141.146.4 with SMTP id y4mr7419645rvn.88.1228465666014; Fri, 05 Dec 2008 00:27:46 -0800 (PST) Received: by 10.140.158.13 with HTTP; Fri, 5 Dec 2008 00:27:45 -0800 (PST) Message-ID: <7d6fde3d0812050027n712d78fxf9e70f2a4568e43@mail.gmail.com> Date: Fri, 5 Dec 2008 00:27:45 -0800 From: "Garrett Cooper" To: "Silver Salonen" In-Reply-To: <20849140.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20828880.post@talk.nabble.com> <7d6fde3d0812040143n374c63edyead7aa4f44e7c0f1@mail.gmail.com> <20830760.post@talk.nabble.com> <7d6fde3d0812040320p2df5474av631d9139c1e9f205@mail.gmail.com> <20831657.post@talk.nabble.com> <7d6fde3d0812041205h493da747vffede0a613c390b8@mail.gmail.com> <20849062.post@talk.nabble.com> <20849140.post@talk.nabble.com> Cc: freebsd-ports@freebsd.org Subject: Re: cmake cannot link against libxml++ X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 08:27:47 -0000 On Thu, Dec 4, 2008 at 11:46 PM, Silver Salonen wrote: > > > Silver Salonen wrote: >> >> >> Garrett Cooper-6 wrote: >>> >>> On Thu, Dec 4, 2008 at 3:27 AM, Silver Salonen >>> wrote: >>>> >>>> Garrett Cooper-6 wrote: >>>>> >>>>> On Thu, Dec 4, 2008 at 2:20 AM, Silver Salonen >>>>> >>>>> wrote: >>>>>> Garrett Cooper-6 wrote: >>>>>>> >>>>>>> On Thu, Dec 4, 2008 at 12:02 AM, Silver Salonen >>>>>>> wrote: >>>>>>>> >>>>>>>> Hello. >>>>>>>> >>>>>>>> I created a port for Museek+ which is built with cmake now. The >>>>>>>> problem >>>>>>>> is >>>>>>>> that although it gets built OK, cmake cannot link one of its >>>>>>>> executables >>>>>>>> against libxml++: >>>>>>>> ===== >>>>>>>> ... [100%] Building CXX object >>>>>>>> museekd/CMakeFiles/museekd.dir/distributedsocket.cpp.o Linking CXX >>>>>>>> executable museekd /usr/bin/ld: cannot find -lxml++-2.6 *** Error >>>>>>>> code >>>>>>>> 1 >>>>>>>> ===== >>>>>>>> >>>>>>>> Concerning libxml++, cmake seems to find it OK - before building: >>>>>>>> ===== >>>>>>>> -- checking for one of the modules 'libxml++-2.6' -- found >>>>>>>> libxml++-2.6, >>>>>>>> version 2.22.0 >>>>>>>> ===== >>>>>>>> >>>>>>>> Previously I had a problem with cmake finding libiconv.h, but I >>>>>>>> resolved >>>>>>>> it >>>>>>>> with "CMAKE_ARGS+= >>>>>>>> -DCMAKE_REQUIRED_INCLUDES="${LOCALBASE}/include". >>>>>>>> But >>>>>>>> I guess it's irrelevant and not even similar. >>>>>>>> >>>>>>>> Is there anything to be specified in order to cmake to find libxml++ >>>>>>>> correctly? >>>>>>> >>>>>>> 1. Does /usr/local/lib/libxml++-2.6.a and/or >>>>>>> /usr/local/lib/libxml++-2.6.so exist? >>>>>>> 2. What are your CXXFLAGS / LDFLAGS? >>>>>>> >>>>>> >>>>>> 1. Yes: >>>>>> $ ls -1 /usr/local/lib/libxml++* >>>>>> /usr/local/lib/libxml++-2.6.a >>>>>> /usr/local/lib/libxml++-2.6.la >>>>>> /usr/local/lib/libxml++-2.6.so >>>>>> /usr/local/lib/libxml++-2.6.so.2 >>>>>> >>>>>> 2. CXXFLAGS: -O2 -fno-strict-aliasing -pipe >>>>>> LDFLAGS: nothing >>>>> >>>>> Sorry -- let me rephrase: what are CXXFLAGS and LDFLAGS set to for the >>>>> port? >>>>> -Garrett >>>>> >>>> >>>> I got the values from pre-everything: >>>> @${ECHO_MSG} "${CXXFLAGS}" >>>> @${ECHO_MSG} "${LDFLAGS}" >>>> >>>> So I guess they are valid in this matter? >>> >>> Eh? It all depends on where you're doing the echo... >>> >>> Honestly I'd need to see more around where you're running configure, >>> or passing in args for the parent make (if it doesn't use configure). >>> You're probably just missing /usr/local/lib in your LDFLAGS though. >>> >> >> I echoed these in "pre-everything" section. Now I set "LDFLAGS+= >> -L${LOCALBASE}/lib", but it doesn't help much. My Makefile is structured >> smth like that: >> >> PORTNAME=... >> ... >> USE_CMAKE= yes >> ... >> LDFLAGS+= -L${LOCALBASE}/lib >> CMAKE_ARGS+= -DCMAKE_REQUIRED_INCLUDES="${LOCALBASE}/include" >> ... >> OPTIONS=... >> ... >> .include >> ... >> pre-everything:: >> @${ECHO_MSG} "${CXXFLAGS}" >> @${ECHO_MSG} "${LDFLAGS}" >> ... >> post-install: >> ... >> .include >> > > OK, the problem disappeared when I also set: CONFIGURE_ENV+= > CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" > > Thanks for your help! :) Bingo, ya got it ;) (I was kind of pointing you in that direction, but I wasn't sure where you did or didn't pass the variables through). Environment variables that need to be communicate to the underlying processes for compiling things should be communicate via either configure (which just is a wrapper produced by autotools / autoconf) or gmake, or via the double-dashed args to configure. There are other make systems like scons, or waf, etc that do different things, but that's outside the scope of what most folks try to do, and the syntax is similar. Best of luck, -Garrett