[vlc-devel] [PATCH] configure: check for declarations of daemon and fork

Felix Paul Kühne fkuehne at videolan.org
Fri Sep 11 13:57:53 CEST 2015


Hello,

Thanks for the quick review!

> On 11 Sep 2015, at 13:49, Rémi Denis-Courmont <remi at remlab.net> wrote:
> 
> Le 2015-09-11 14:40, Felix Paul Kühne a écrit :
>> tvOS includes those functions but prevents their use so we need check
>> their declaration
> 
> Autodetection cannot fix that.

I hope that it can. Actually, the unavailability to userland apps is defined in the header through a pre-compiler macro and reliably leads to a compilation failure.

> 
>> ---
>> configure.ac | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/configure.ac b/configure.ac
>> index 55513bd..2974bb4 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -548,7 +548,9 @@ need_libc=false
>> 
>> dnl Check for usual libc functions
>> AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
>> -AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty
>> lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise
>> posix_madvise setlocale stricmp strnicmp strptime uselocale
>> pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
>> +AC_CHECK_DECLS([daemon],,,[#include <stdlib.h>])
>> +AC_CHECK_DECLS([fork],,,[#include <unistd.h>])
> 
> IIRC, Diego advises against using AC_CHECK_DECLS, which he considers flaky. Regardless the test is not even correct here.

In fact, he suggested those functions explicitly for this use-case, but indeed, I should have send him the patch for review first :)

Best regards,

Felix


More information about the vlc-devel mailing list