libnjb on Solaris


My mp3 player is a Creative Zen Xtra (I just don't drink enough Martini to own an iProduct [1]). Anyway I obviously would prefer to use Solaris rather than Windows for this little gadget, so I compiled up gnomad2 which requires libnjb.

One of the issues compiling was a relatively common problem that I've encountered recently, that of types being defined for Linux but not for Solaris. The error in this case looks like

[fintanr@tiresias libnjb-2.0] $ make
cd src && make prefix=/usr/local
/usr/bin/bash ..//libtool --mode=compile gcc    -I/usr/local/include -DHAVE_GETOPT_H 
-DHAVE_LIBGEN_H -DHAVE_USLEEP -Wall -Wmissing-prototypes -c base.c
 gcc -I/usr/local/include -DHAVE_GETOPT_H -DHAVE_LIBGEN_H -DHAVE_USLEEP -Wall 
-Wmissing-prototypes -c base.c  -fPIC -DPIC -o .libs/base.o
In file included from base.c:9:
libnjb.h:163: error: syntax error before "u_int8_t"
libnjb.h:163: warning: no semicolon at end of struct or union
libnjb.h:164: warning: type defaults to `int' in declaration of `usb_interface'
libnjb.h:164: warning: data definition has no type or storage class
And when we take a look at libnjb.h we see that our types are assumed to be the those that are on Linux. Anyway the fix for this is simple, just add the following to libnjb.h
#ifdef __sun
#define u_int8_t uint8_t
#define u_int16_t uint16_t
#define u_int32_t uint32_t
#define u_int64_t uint64_t
#endif
and away you go. A patch has been submitted to the libnjb folks on Sourceforge all ready (the patch is actually for libnjb.h.in). If your really interested you can view it here.
[1] Actually I like the fact that I can replace the battery myself in the Zen.
Comments:

Ack! No! The proper patch is to fix all of the broken linux-isms. u_int8_t is NOT a posix type. But uint8_t is. Ok, this is all assuming I recall correctly. Please, have them fix the root problem. If you need more info, let me know-- I can call our standards nerd.

Posted by Dan Price on April 19, 2005 at 06:17 AM IST #

Seeing this in many an app/library. The Helix player being the most recent of troublesome ports I've come accross.

Posted by smg on April 19, 2005 at 05:04 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

fintanr

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
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