OSSP CVS Repository

ossp - Ticket #81
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [History

Ticket 81: Compiliation Problems on Mac OS X 10.4

Mac OS X Tiger (10.4.x) ships with its own UUID library. This seems to create a conflict for OSSP-UUID:

geertz# make gcc -I. -I. -DHAVE_CONFIG_H -O2 -pipe -c uuid.c -fno-common -DPIC -o .libs/uuid.o In file included from uuid.c:44: uuid.h:82: error: conflicting types for 'uuid_t' /usr/include/unistd.h:121: error: previous declaration of 'uuid_t' was here make: *** [uuid.lo] Error 1

The closest post I found to a solution was here:

  http://forums.macosxhints.com/archive/index.php/t-38443.html

But that's ugly. I think that Data::UUID had a similar issue; the solution there was to rename the function:

  https://rt.cpan.org/NoAuth/Bug.html?id=12389

And...yes, that does indeed seem to do the trick. Here's what I did to make it compile:

   rgrep -l uuid_t | grep -v ChangeLog | xargs perl -i -pe 's/uuid_t/ossp_uuid_t/g' 

I imagine that other systems will have UUID functions (Red Hat comes to mind), so it might be worth it to make this change in order to prevent more conflicts in the future.

[Append remarks]

Remarks:

2005-Dec-31 17:24:07 by anonymous:
A sufficient solution is to define _POSIX_SOURCE=1

Apple's unistd.h has the following:

  #ifndef _POSIX_C_SOURCE
  #ifndef _UUID_T
  #define _UUID_T
  typedef __darwin_uuid_t         uuid_t;
  #endif /* _UUID_T */
  #endif /* _POSIX_C_SOURCE */

-- mefisk@gmail.com


2006-Jan-20 23:15:53 by anonymous:
I got the C library to compile by setting _POSIX_C_SOURCE, but not the Perl library. It seems that perl.h loads unistd.h, but if I define _POSIX_C_SOURCE before uuid.xs includes perl.h, I get all kinds of errors.

Unfortunately, I think that the only solution is to give uuid_t another name. Maybe it can just be done where uuid_t is already defined elsewhere, and then dependent libraries would have to make the same test?

—Theory

[Append remarks]

Properties:

Type: todo           Version: 1.3.1 
Status: new          Created: 2005-Dec-05 20:52
Severity:          Last Change: 2005-Dec-05 20:52
Priority:          Subsystem: uuid 
Assigned To: rse           Derived From:  
Creator: anonymous 

CVSTrac 2.0.1