SQLite 3.24.0 Solaris 9 build failure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLite 3.24.0 Solaris 9 build failure

Andy Goth-3
SQLite 3.24.0 fails to build on Solaris 9 (a.k.a. Solaris 2.9) due to
not finding fchmod, fchown, readlink, lstat, usleep, struct timeval, and
gettimeofday.

To correct, do not #define _XOPEN_SOURCE.  There's already a check for
Mac OS X, so I would suggest extending the check to also exclude Solaris
9 with something like the following:

#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE)
&& \
     !(defined(__sun) && defined(__SVR4))
#  define _XOPEN_SOURCE 600
#endif

This check isn't version-specific.  There doesn't appear to be a
guaranteed macro for that purpose.  Sun Studio offers macros like
_SunOS_5_9 (meaning Solaris 9), but gcc does not.  Though it's a bit
silly for me to obsess over versions since I don't know exactly which
versions of Solaris hide the relevant functions and structs if
_XOPEN_SOURCE is defined.  I only have access to Solaris 9, and by
"access" I mean I have a copy of /usr/include and such, not a computer I
can log in to.  Just enough to do a cross-compile, which succeeds with
the above change.

More investigation is needed to figure out how to make SQLite build for
Solaris 9 without breaking other Solaris/SunOS platforms.

--
Andy Goth | <andrew.m.goth/at/gmail/dot/com>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite 3.24.0 Solaris 9 build failure

Gary R. Schmidt
On 2018-07-28 08:33, Andy Goth wrote:

> SQLite 3.24.0 fails to build on Solaris 9 (a.k.a. Solaris 2.9) due to
> not finding fchmod, fchown, readlink, lstat, usleep, struct timeval,
> and gettimeofday.
>
> To correct, do not #define _XOPEN_SOURCE.  There's already a check for
> Mac OS X, so I would suggest extending the check to also exclude
> Solaris 9 with something like the following:
>
> #if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) &&
> !defined(__APPLE) && \
>     !(defined(__sun) && defined(__SVR4))
> #  define _XOPEN_SOURCE 600
> #endif
>
> This check isn't version-specific.  There doesn't appear to be a
> guaranteed macro for that purpose.  Sun Studio offers macros like
> _SunOS_5_9 (meaning Solaris 9), but gcc does not.  Though it's a bit
> silly for me to obsess over versions since I don't know exactly which
> versions of Solaris hide the relevant functions and structs if
> _XOPEN_SOURCE is defined.  I only have access to Solaris 9, and by
> "access" I mean I have a copy of /usr/include and such, not a computer
> I can log in to.  Just enough to do a cross-compile, which succeeds
> with the above change.
>
> More investigation is needed to figure out how to make SQLite build
> for Solaris 9 without breaking other Solaris/SunOS platforms.

For some time at $ORK I have been configuring with
"--disable-readline"[1] and inserting the following lines into sqlite3.c
as provided in the autoconf archive.

I don't recall which UNIX variant caused the need, or when, but the
changes are applied across all my Linux and UNIX builds now.

    #include <sys/time.h>
    #include <sys/types.h>
    #include <sys/stat.h>

These changes, plus updating libz to a newer version, builds happily on
Solaris 8, 9, 10, and 11.  As well as HP-UX 11.x and AIX 5.x to 7.x.

         Cheers,
                 Gary    B-)

1 - Yes, we could supply readline(), but $ORK decided not to do so
before I arrived.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite 3.24.0 Solaris 9 build failure

Dennis Clarke
On 07/30/2018 03:59 AM, Gary R. Schmidt wrote:
> On 2018-07-28 08:33, Andy Goth wrote:
>> SQLite 3.24.0 fails to build on Solaris 9 (a.k.a. Solaris 2.9)

It may be work while to spin up a Solaris 9 zone on a Solaris 10 or
Solaris 11 server for this purpose.  Not sure how you are getting a
cross compile to work at all with just /usr/include on hand. Are you
using the Sun Studio compilers for this ?


Dennis

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users