#935 2.5.1.1 fails to build on OS X

closed-fixed
None
5
2015-02-04
2013-02-18
No

Hello, I'm a manager of the MacPorts project, trying to update libgphoto2 at a user's request. But 2.5.1 and 2.5.1.1 do not build for me on OS X 10.8.2 Mountain Lion with Xcode 4.6. There are numerous warnings:

:info:build gphoto2-port-info-list.c:270:38: warning: implicitly declaring library function 'strdup' with type 'char *(const char *)'
:info:build                         list->info[j]->library_filename = strdup (filename);
:info:build                                                           ^
:info:build gphoto2-port-info-list.c:270:38: note: please include the header <string.h> or explicitly provide a declaration for 'strdup'
:info:build serial/unix.c:362:3: warning: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)'
:info:build                 snprintf (xname, 100, _("Serial Port %i"), x);
:info:build                 ^
:info:build serial/unix.c:362:3: note: please include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
:info:build usbdiskdirect/linux.c:153:9: warning: implicit declaration of function 'readlink' is invalid in C99 [-Wimplicit-function-declaration]
:info:build                 ret = readlink (path, buf, PATH_MAX);
:info:build                       ^

Finally the build fails with:

:info:build usbscsi/linux.c:87:6: warning: implicit declaration of function 'flock' is invalid in C99 [-Wimplicit-function-declaration]
:info:build         if (flock(port->pl->fd, LOCK_EX | LOCK_NB) != 0) {
:info:build             ^
:info:build usbscsi/linux.c:87:26: error: use of undeclared identifier 'LOCK_EX'
:info:build         if (flock(port->pl->fd, LOCK_EX | LOCK_NB) != 0) {
:info:build                                 ^
:info:build usbscsi/linux.c:87:36: error: use of undeclared identifier 'LOCK_NB'
:info:build         if (flock(port->pl->fd, LOCK_EX | LOCK_NB) != 0) {
:info:build                                           ^
:info:build usbscsi/linux.c:108:26: error: use of undeclared identifier 'LOCK_UN'
:info:build         if (flock(port->pl->fd, LOCK_UN) != 0) {
:info:build                                 ^

libgphoto2 2.5.0 builds fine.

2 Attachments

Discussion

<< < 1 2 (Page 2 of 2)
  • Marcus Meissner

    Marcus Meissner - 2014-08-17
    • status: open --> closed-fixed
    • assigned_to: Marcus Meissner
     
  • Marcus Meissner

    Marcus Meissner - 2014-08-17

    hope its better in the meantime?

     
  • Ryan Schmidt

    Ryan Schmidt - 2014-08-18

    Yes, thanks, it appears to be. 2.5.4 builds on OS X without needing to add the previously-needed -D_DARWIN_C_SOURCE flag.

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.