Tuesday May 31, 2011

Compiling Alpine on Solaris 11

I use alpine as my primary e-mail client. In order to get it compiled for Solaris 11 (snv_166 and later), you will need to make a few changes to the source.
[paulie@adrenaline ~]$ uname -orv
5.11 snv_166 Solaris
[paulie@adrenaline ~]$ ./configure --with-ssl-include-dir=/usr/include/openssl
[paulie@adrenaline ~]$ gmake
We run into a problem ...
In file included from osdep.c:66:
scandir.c: In function `Scandir':
scandir.c:45: error: structure has no member named `dd_fd'
Let's investigate:
[paulie@adrenaline ~]$ vi /usr/include/dirent.h
#if defined(__USE_LEGACY_PROTOTYPES__)
/* traditional SVR4 definition */
typedef struct {
        int     dd_fd;          /* file descriptor */
        int     dd_loc;         /* offset in block */
        int     dd_size;        /* amount of valid data */
        char    *dd_buf;        /* directory block */
} DIR;                          /* stream data from opendir() */
#else
/* default definition (POSIX conformant) */
typedef struct {
        int     d_fd;           /* file descriptor */
        int     d_loc;          /* offset in block */
        int     d_size;         /* amount of valid data */
        char    *d_buf;         /* directory block */
} DIR;                          /* stream data from opendir() */
#endif  /* __USE_LEGACY_PROTOTYPES__ */
Interesting, so alpine *should* be using POSIX instead of the older UNIX SVR4 definitions. Let's make a change to the scandir.c file, which is located in alpine-2.00/imap/c-client/scandir.c. On line 45 I see the following use of dd_fd:
  if ((!dirp) || (fstat (dirp->dd_fd,&stb) < 0)) return -1;
Let's change that dd_fd to d_fd.
  if ((!dirp) || (fstat (dirp->d_fd,&stb) < 0)) return -1;
After recompile, everything works as expected. I'm sure there is a better way of fixing this problem, but considering how trivial this issue is, a small edit is sufficient.

Tuesday Sep 29, 2009

Compiling Alpine on OpenSolaris 2009.06

For Alpine 2.00, the configure file looks around in the wrong directories for the OpenSSL header files.
...
    \*-\*-solaris\*)
      if test -d /usr/sfw/include/openssl ; then
        alpine_SSLDIR="/usr/sfw"
      elif test -d /opt/csw/include/openssl ; then
        alpine_SSLDIR="/opt/csw"
        if test -d /opt/csw/ssl/certs ; then
          alpine_SSLCERTS="/opt/csw/ssl/certs"
        fi
      fi
...
Unfortunately, configure never looks for the new location: /usr/include/openssl. Thankfully, there is an easy fix:
./configure --with-ssl-include-dir=/usr/include/openssl
About

Hiya, my name is Paul Johnson and I'm a software engineer working on the ZFS storage appliance .

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today