Patchwork [v4,1/5] Fix configure script for LTTng 2.x

login
register
mail settings
Submitter Mohamad Gebai
Date Oct. 18, 2013, 6:39 a.m.
Message ID <1382078393-11195-2-git-send-email-mohamad.gebai@polymtl.ca>
Download mbox | patch
Permalink /patch/284446/
State New
Headers show

Comments

Mohamad Gebai - Oct. 18, 2013, 6:39 a.m.
Signed-off-by: Mohamad Gebai <mohamad.gebai@polymtl.ca>
---
 configure |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Stefan Hajnoczi - Oct. 18, 2013, 2:05 p.m.
On Fri, Oct 18, 2013 at 02:39:49AM -0400, Mohamad Gebai wrote:
> Signed-off-by: Mohamad Gebai <mohamad.gebai@polymtl.ca>
> ---
>  configure |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index 23dbaaf..627054c 100755
> --- a/configure
> +++ b/configure
> @@ -3287,15 +3287,14 @@ fi
>  # For 'ust' backend, test if ust headers are present
>  if test "$trace_backend" = "ust"; then
>    cat > $TMPC << EOF
> -#include <ust/tracepoint.h>
> -#include <ust/marker.h>
> +#include <lttng/tracepoint.h>
>  int main(void) { return 0; }
>  EOF
>    if compile_prog "" "" ; then
> -    LIBS="-lust -lurcu-bp $LIBS"
> -    libs_qga="-lust -lurcu-bp $libs_qga"
> +    LIBS="-llttng-ust -lurcu-bp -ldl $LIBS"
> +    libs_qga="-llttng-ust -lurcu-bp -ldl $libs_qga"

Please switch to pkg-config instead of hardcoding particular flags.  I
checked that Fedora and Debian ship the pkg-config file.
Mohamad Gebai - Oct. 21, 2013, 8:24 p.m.
On 13-10-18 10:05 AM, Stefan Hajnoczi wrote:
> On Fri, Oct 18, 2013 at 02:39:49AM -0400, Mohamad Gebai wrote:
>> Signed-off-by: Mohamad Gebai <mohamad.gebai@polymtl.ca>
>> ---
>>   configure |    9 ++++-----
>>   1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 23dbaaf..627054c 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3287,15 +3287,14 @@ fi
>>   # For 'ust' backend, test if ust headers are present
>>   if test "$trace_backend" = "ust"; then
>>     cat > $TMPC << EOF
>> -#include <ust/tracepoint.h>
>> -#include <ust/marker.h>
>> +#include <lttng/tracepoint.h>
>>   int main(void) { return 0; }
>>   EOF
>>     if compile_prog "" "" ; then
>> -    LIBS="-lust -lurcu-bp $LIBS"
>> -    libs_qga="-lust -lurcu-bp $libs_qga"
>> +    LIBS="-llttng-ust -lurcu-bp -ldl $LIBS"
>> +    libs_qga="-llttng-ust -lurcu-bp -ldl $libs_qga"
> Please switch to pkg-config instead of hardcoding particular flags.  I
> checked that Fedora and Debian ship the pkg-config file.
Unfortunately, some missing files in the Ubuntu package make it 
impossible to use pkg-config for versions of Ubuntu older than 13.10 
(like Ubuntu 12.04 which is a LTS). Would you be okay with these flags?
alex.bennee@linaro.org - Oct. 22, 2013, 9:03 a.m.
mohamad.gebai@polymtl.ca writes:

> On 13-10-18 10:05 AM, Stefan Hajnoczi wrote:
<snip>
>> Please switch to pkg-config instead of hardcoding particular flags.  I
>> checked that Fedora and Debian ship the pkg-config file.
> Unfortunately, some missing files in the Ubuntu package make it 
> impossible to use pkg-config for versions of Ubuntu older than 13.10 
> (like Ubuntu 12.04 which is a LTS). Would you be okay with these flags?

Hmm this is tricky because pkg-config really should be the portable way
to get at these flags. Perhaps we could just fall back to sensible
defaults if pkg-config fails?

On my 12.04 system (with the lttng PPA) it works fine:

$>pkg-config --libs lttng-ust
-llttng-ust -ldl  
$>pkg-config --cflags lttng-ust
-I/usr/include/x86_64-linux-gnu  

Is there a bug raised with the Ubuntu upstream to fix their stable LTTNG package?

Patch

diff --git a/configure b/configure
index 23dbaaf..627054c 100755
--- a/configure
+++ b/configure
@@ -3287,15 +3287,14 @@  fi
 # For 'ust' backend, test if ust headers are present
 if test "$trace_backend" = "ust"; then
   cat > $TMPC << EOF
-#include <ust/tracepoint.h>
-#include <ust/marker.h>
+#include <lttng/tracepoint.h>
 int main(void) { return 0; }
 EOF
   if compile_prog "" "" ; then
-    LIBS="-lust -lurcu-bp $LIBS"
-    libs_qga="-lust -lurcu-bp $libs_qga"
+    LIBS="-llttng-ust -lurcu-bp -ldl $LIBS"
+    libs_qga="-llttng-ust -lurcu-bp -ldl $libs_qga"
   else
-    error_exit "Trace backend 'ust' missing libust header files"
+    error_exit "Trace backend 'ust' missing lttng-ust header files"
   fi
 fi