[Openais] [Corosync] Patches to fix BSD support

Jérôme Flesch jerome.flesch at netasq.com
Wed Jun 10 07:52:49 PDT 2009


>>>>> I think the LDL part needs to be in some user defined flag in the
>>>>> configure.ac.  The #if BSD with defining LDL is a bit hacky.  I'm not
>>>>> sure where it should go however, so perhaps Jim or Fabio could comment.
>>>>> If Jim or Fabio give that part the thumbs up, then this patch should be
>>>>> good to go in.
>>>>>
>>>>> the if defined semun wont work because unions are not defines.  That
>>>>> entire code segment is wrong.  Can you try the attached patch on bsd for
>>>>> me?
>>>>>
>>>> I think you misunderstood my problem: semun *is* already defined on 
>>>> FreeBSD, but the #if !defined(semun) doesn't work on my system (probably 
>>>> due to a GCC version difference ?) and the compiler ends up with a 
>>>> redefinition of semun.
>>>>
>>>> Is there actually any system where semun is not already defined ?
>>>>
>>>>
>>> Linux doesn't define it and Solaris doesn't even have a description of
>>> the definition.  Do you have _SEM_SEMUN_UNDEFINED in your header files?
>>> Or SEM_SEMUN_DEFINED?  That can be used to do an if defined test.
>>>
>> I haven't found any of them in the FreeBSD headers :/
>>
> 
> I believe the proper thing to do is put the union in ifdefs around
> _SEM_SEMUN_UNDEFINED and define them in configure.ac for Solaris.
> 
> Can you try this patch on your os?
>
Works for me :)



> Regards
> -steve
> 
>>> Regards
>>> -steve
>>>
>>>
>>>
>>>
>>>
>> plain text document attachment (patch-fix-bsd-compilation)
>> diff --git a/configure.ac b/configure.ac
>> index de1ac78..b0b7c87 100644
>> --- configure.ac
>> +++ configure.ac
>> @@ -194,6 +194,7 @@ AC_ARG_WITH([socket-dir],
>>  # OS detection
>>  # THIS SECTION MUST DIE!
>>  CP=cp
>> +OS_LDL="-ldl"
>>  case "$host_os" in
>>  	*linux*)
>>  		AC_DEFINE_UNQUOTED([COROSYNC_LINUX], [1],
>> @@ -225,11 +226,14 @@ case "$host_os" in
>>  	*bsd*)
>>  		AC_DEFINE_UNQUOTED([COROSYNC_BSD], [1],
>>  				   [Compiling for BSD platform])
>> +		AC_DEFINE_UNQUOTED([MAP_ANONYMOUS], [MAP_ANON],
>> +				   [Shared memory define for Darwin platform])
>>  		OS_CFLAGS=""
>>  		OS_CPPFLAGS="-I/usr/local/include"
>>  		OS_LDFLAGS="-L/usr/local/lib"
>>  		OS_DYFLAGS="-export-dynamic"
>>  		DARWIN_OPTS=""
>> +		OS_LDL=""
>>  	;;
>>  	*solaris*)
>>  		AC_DEFINE_UNQUOTED([COROSYNC_SOLARIS], [1],
>> diff --git a/lib/Makefile.am b/lib/Makefile.am
>> index 37afffd..31e8664 100644
>> --- lib/Makefile.am
>> +++ lib/Makefile.am
>> @@ -114,7 +114,7 @@ libconfdb.so.$(SONAME): confdb.o sa-confdb.o ../lcr/lcr_ifact.o libcoroipcc.so.$
>>  	$(CC) -shared -o $@ \
>>  		-Wl,-soname=libconfdb.so.$(SOMAJOR) \
>>  		-Wl,-version-script=$(srcdir)/libconfdb.versions \
>> -		$^ $(LDFLAGS) $(OS_DYFLAGS) -ldl $(AM_LDFLAGS)
>> +		$^ $(LDFLAGS) $(OS_DYFLAGS) $(OS_LDL) $(AM_LDFLAGS)
>>  	ln -sf libconfdb.so.$(SONAME) libconfdb.so
>>  	ln -sf libconfdb.so.$(SONAME) libconfdb.so.$(SOMAJOR)
>>  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4393 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20090610/131923a0/attachment.bin 


More information about the Openais mailing list