Re: [Freeipa-devel] [PATCH] Use pkg-config to detect cmocka

2013-07-15 Thread Martin Kosek
On 07/15/2013 03:13 PM, Alexander Bokovoy wrote:
> On Mon, 15 Jul 2013, Martin Kosek wrote:
>> On 07/04/2013 01:49 PM, Lukas Slebodnik wrote:
>>> On (04/07/13 13:10), Alexander Bokovoy wrote:
 On Thu, 04 Jul 2013, Lukas Slebodnik wrote:
> ehlo,
>
> libcmocka-0.3 was released and package is available in fedore >= 18.
> libcmocka-devel contains pkg-config file,
> therefore it is better to use pkg-config to detect this library.
>
> Patch is attached.
 Few comments.

 0. Please follow https://fedorahosted.org/freeipa/wiki/PatchFormat
>>> changed
>>>
 1. It would be nice to have a ticket in the FreeIPA trac.
>>> Could ticket#3434 be used? I know that ticket is fixed.
>>> https://fedorahosted.org/freeipa/ticket/3434
>>> Funcionality of patch is the same as Sumit's version.
>>>
 2. I think at this point we need to decide whether we want to have
  BuildRequires: libcmocka-devel
   in freeipa.spec.in. Given the change, older version would become
   unsupported but we don't really have any packaging dependency yet.
>>> At the moment, there isnot any cmocka test in freeipa source repo.
>>>
>>> LS
>>>
>>
>> Any update with this patch? If the build works OK, I would push it.
>>
>> I think we do not need to add libcmocka BuildRequires ATM and leave the 
>> cmocka
>> tests optional (especially if there is no cmocka test).
> Yes, it works fine.

OK. I pushed the patch to master, ipa-3-2.

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] Use pkg-config to detect cmocka

2013-07-15 Thread Alexander Bokovoy

On Mon, 15 Jul 2013, Martin Kosek wrote:

On 07/04/2013 01:49 PM, Lukas Slebodnik wrote:

On (04/07/13 13:10), Alexander Bokovoy wrote:

On Thu, 04 Jul 2013, Lukas Slebodnik wrote:

ehlo,

libcmocka-0.3 was released and package is available in fedore >= 18.
libcmocka-devel contains pkg-config file,
therefore it is better to use pkg-config to detect this library.

Patch is attached.

Few comments.

0. Please follow https://fedorahosted.org/freeipa/wiki/PatchFormat

changed


1. It would be nice to have a ticket in the FreeIPA trac.

Could ticket#3434 be used? I know that ticket is fixed.
https://fedorahosted.org/freeipa/ticket/3434
Funcionality of patch is the same as Sumit's version.


2. I think at this point we need to decide whether we want to have
 BuildRequires: libcmocka-devel
  in freeipa.spec.in. Given the change, older version would become
  unsupported but we don't really have any packaging dependency yet.

At the moment, there isnot any cmocka test in freeipa source repo.

LS



Any update with this patch? If the build works OK, I would push it.

I think we do not need to add libcmocka BuildRequires ATM and leave the cmocka
tests optional (especially if there is no cmocka test).

Yes, it works fine.

--
/ Alexander Bokovoy

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] Use pkg-config to detect cmocka

2013-07-15 Thread Martin Kosek
On 07/04/2013 01:49 PM, Lukas Slebodnik wrote:
> On (04/07/13 13:10), Alexander Bokovoy wrote:
>> On Thu, 04 Jul 2013, Lukas Slebodnik wrote:
>>> ehlo,
>>>
>>> libcmocka-0.3 was released and package is available in fedore >= 18.
>>> libcmocka-devel contains pkg-config file,
>>> therefore it is better to use pkg-config to detect this library.
>>>
>>> Patch is attached.
>> Few comments.
>>
>> 0. Please follow https://fedorahosted.org/freeipa/wiki/PatchFormat
> changed
> 
>> 1. It would be nice to have a ticket in the FreeIPA trac.
> Could ticket#3434 be used? I know that ticket is fixed.
> https://fedorahosted.org/freeipa/ticket/3434
> Funcionality of patch is the same as Sumit's version.
> 
>> 2. I think at this point we need to decide whether we want to have
>>  BuildRequires: libcmocka-devel
>>   in freeipa.spec.in. Given the change, older version would become
>>   unsupported but we don't really have any packaging dependency yet.
> At the moment, there isnot any cmocka test in freeipa source repo.
> 
> LS
> 

Any update with this patch? If the build works OK, I would push it.

I think we do not need to add libcmocka BuildRequires ATM and leave the cmocka
tests optional (especially if there is no cmocka test).

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] Use pkg-config to detect cmocka

2013-07-04 Thread Lukas Slebodnik
On (04/07/13 13:10), Alexander Bokovoy wrote:
>On Thu, 04 Jul 2013, Lukas Slebodnik wrote:
>>ehlo,
>>
>>libcmocka-0.3 was released and package is available in fedore >= 18.
>>libcmocka-devel contains pkg-config file,
>>therefore it is better to use pkg-config to detect this library.
>>
>>Patch is attached.
>Few comments.
>
>0. Please follow https://fedorahosted.org/freeipa/wiki/PatchFormat
changed

>1. It would be nice to have a ticket in the FreeIPA trac.
Could ticket#3434 be used? I know that ticket is fixed.
https://fedorahosted.org/freeipa/ticket/3434
Funcionality of patch is the same as Sumit's version.

>2. I think at this point we need to decide whether we want to have
>  BuildRequires: libcmocka-devel
>   in freeipa.spec.in. Given the change, older version would become
>   unsupported but we don't really have any packaging dependency yet.
At the moment, there isnot any cmocka test in freeipa source repo.

LS
>From 17d5b40e51ae4f4ac1a8689aabfdba389568e9ab Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik 
Date: Wed, 3 Jul 2013 22:32:12 +0200
Subject: [PATCH] Use pkg-config to detect cmocka

https://fedorahosted.org/freeipa/ticket/3434
---
 daemons/configure.ac | 37 -
 1 file changed, 12 insertions(+), 25 deletions(-)

diff --git a/daemons/configure.ac b/daemons/configure.ac
index 21d4e7a..8219f2c 100644
--- a/daemons/configure.ac
+++ b/daemons/configure.ac
@@ -207,33 +207,20 @@ AM_CONDITIONAL([HAVE_CHECK], [test x$have_check != x])
 
 dnl ---
 dnl - Check for cmocka unit test framework http://cmocka.cryptomilk.org/
-dnl   This will be simplified when cmocka carries a .pc file.
 dnl ---
-AC_SUBST(CMOCKA_LIBS)
-AC_SUBST(CMOCKA_CFLAGS)
-
-AC_CHECK_HEADERS(
-[setjmp.h cmocka.h],,,
-[[ #include 
- # include 
- #ifdef HAVE_SETJMP_H
- # include 
- #endif
-]]
+PKG_CHECK_EXISTS(cmocka,
+[AC_CHECK_HEADERS([stdarg.h stddef.h setjmp.h],
+[], dnl We are only intrested in action-if-not-found
+[AC_MSG_WARN([Header files stdarg.h stddef.h setjmp.h are required by 
cmocka])
+ cmocka_required_headers="no"
+]
+)
+AS_IF([test x"$cmocka_required_headers" != x"no"],
+  [PKG_CHECK_MODULES([CMOCKA], [cmocka], [have_cmocka="yes"])]
+)],
+dnl PKG_CHECK_EXISTS ACTION-IF-NOT-FOUND
+[AC_MSG_WARN([No libcmocka library found, cmocka tests will not be built])]
 )
-
-if test "x$ac_cv_header_setjmp_h" = "xyes" && test "x$ac_cv_header_cmocka_h" = 
"xyes" ; then
-AC_CHECK_LIB([cmocka], [_will_return],
- [ CMOCKA_LIBS="-lcmocka"
-   AC_MSG_RESULT([libcmocka available, cmocka tests will be 
build])
-   have_cmocka="yes" ],
- [AC_MSG_WARN([No libcmocka library found, cmocka tests will 
not be build])
-   have_cmocka="no" ])
-else
-AC_MSG_WARN([Required header files for libcmocka are missing, cmocka tests 
will not be build])
-have_cmocka="no"
-fi
-
 AM_CONDITIONAL([HAVE_CMOCKA], [test x$have_cmocka = xyes])
 
 dnl -- dirsrv is needed for the extdom unit tests --
-- 
1.8.3.1

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel