From owner-freebsd-questions@freebsd.org Sat Apr 7 19:07:44 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5332DF9F746 for ; Sat, 7 Apr 2018 19:07:44 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dreamchaser.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4BD67376F for ; Sat, 7 Apr 2018 19:07:43 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id w37J7Z5W075116 for ; Sat, 7 Apr 2018 13:07:35 -0600 (MDT) (envelope-from freebsd@dreamchaser.org) To: FreeBSD Mailing List Reply-To: freebsd@dreamchaser.org From: Gary Aitken Subject: how to build and use a debug version of a ports lib? Message-ID: <677559c8-1f23-aac2-464f-621a41446d15@dreamchaser.org> Date: Sat, 7 Apr 2018 13:06:55 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Sat, 07 Apr 2018 13:07:35 -0600 (MDT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2018 19:07:44 -0000 Trying to get a debug version of graphics/lensfun built and linked with something. I tried setting CFLAGS= -O0 -ggdb -pipe CMAKE_ARGS= -DBUILD_AUXFUN:BOOL=ON -O0 -ggdb -pipe in graphics/lensfun/Makefile, then got the following for make configure: CMake Warning: Manually-specified variables were not used by the project: CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_VERBOSE_MAKEFILE Python_ADDITIONAL_VERSIONS THREADS_HAVE_PTHREAD_ARG 1. Can someone explain what the above means? Where were these manually specified, since I don't think I did it; they aren't in the main Makefile. Or does that message really mean: Manually-specifiable variables which were not ... 2. What's the right way to get libraries built suitable for debugging? Assuming I get the library built suitable for debugging, how do I get it linked? I tried manually doing the following, but ldd still shows the lensfun lib coming from the one in /usr/local/lib, not the one I pointed at: $ c++ -O0 -pipe -fstack-protector -fno-strict-aliasing -fstack-protector -o ufraw ufraw-ufraw.o libufraw.a /usr/ports/graphics/lensfun/work/lensfun-0.3.2/libs/lensfun/liblensfun.so.0.3.2 -L/usr/local/lib -lpthread -lexiv2 -lgthread-2.0 -pthread -lglib-2.0 -lintl -llcms2 -ltiff -lpng16 -lz -L/usr/local/lib -lgtkimageview -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lpthread -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -ljasper -ljpeg -lbz2 -lz -lm -lintl $ ldd ./ufraw ./ufraw: liblensfun.so.1 => /usr/local/lib/liblensfun.so.1 (0x80098e000) ... $ file /usr/ports/graphics/lensfun/work/lensfun-0.3.2/libs/lensfun/liblensfun.so.0.3.2 /usr/ports/graphics/lensfun/work/lensfun-0.3.2/libs/lensfun/liblensfun.so.0.3.2: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, not stripped If instead of specifying the liblensfun.so specifically, I use a -L/usr/ports/graphics/lensfun/work/lensfun-0.3.2/libs/lensfun the link fails with things like: libufraw.a(ufraw_lens_ui.o): In function `camera_menu_fill': .../ufraw_lens_ui.c:77: undefined reference to `lf_mlstr_get' Thanks, Gary