Problems building gpgme 0.3.9 with Solaris and SINIX native C compilers

Dr.Stefan.Dalibor at bfa.de Dr.Stefan.Dalibor at bfa.de
Mon Sep 2 14:23:04 CEST 2002


Hi,
gpgme 0.3.9 won't build with native C compilers under Solaris 8
(SUNspro compiler) and SINIX 5.45 (CDS++ compiler) due to some
`GCC-isms' in posix-io.c and version.c - it seems the proprietary
compilers are too dumb for initializing structs when defining them,
complaining about `non-constant initializers'.  The appending
trivial patches solve the problem.

I haven't tried to build the gpgme plugin, but the C modules in
gpgmeplug seem to have a similar problem (C++ style comments are
used, many C compilers won't grok these).

Cheers,
Stefan
--

diff -r -C 3 gpgme-0.3.9/gpgme/posix-io.c gpgme-0.3.9-patched/gpgme/posix-io.c
*** gpgme-0.3.9/gpgme/posix-io.c    Sun Jul 28 01:21:29 2002
--- gpgme-0.3.9-patched/gpgme/posix-io.c  Thu Aug 29 09:17:21 2002
***************
*** 292,300 ****
    fd_set readfds;
    fd_set writefds;
    int any, i, max_fd, n, count;
!   struct timeval timeout = { nonblock ? 0 : 1, 0 }; /* Use a 1s timeout.  */
    void *dbg_help = NULL;

    FD_ZERO (&readfds);
    FD_ZERO (&writefds);
    max_fd = 0;
--- 302,314 ----
    fd_set readfds;
    fd_set writefds;
    int any, i, max_fd, n, count;
!   struct timeval timeout;
    void *dbg_help = NULL;

+   /* Use a 1s timeout.  */
+   timeout.tv_sec = nonblock ? 0 : 1;
+   timeout.tv_usec = 0;
+
    FD_ZERO (&readfds);
    FD_ZERO (&writefds);
    max_fd = 0;
diff -r -C 3 gpgme-0.3.9/gpgme/version.c gpgme-0.3.9-patched/gpgme/version.c
*** gpgme-0.3.9/gpgme/version.c     Thu May  9 08:06:54 2002
--- gpgme-0.3.9-patched/gpgme/version.c   Thu Aug 29 09:17:21 2002
***************
*** 221,231 ****
    int rp[2];
    pid_t pid;
    int nread;
!   char *argv[] = {(char *) path, "--version", 0};
    struct spawn_fd_item_s pfd[] = { {0, -1}, {-1, -1} };
    struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */}, {-1, -1} };
    int status, signal;

    if (!path)
      return NULL;

--- 221,233 ----
    int rp[2];
    pid_t pid;
    int nread;
!   char *argv[3];
    struct spawn_fd_item_s pfd[] = { {0, -1}, {-1, -1} };
    struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */}, {-1, -1} };
    int status, signal;

+   argv[0] = path, argv[1] = "--version", argv[2] = NULL;
+
    if (!path)
      return NULL;





More information about the Gnupg-devel mailing list