SV: trouble compiling nsd-2.3.0 under solaris 10

joel.nyholm at fsb.se joel.nyholm at fsb.se
Tue May 31 08:26:27 UTC 2005


I tried reconfigured it with the flags but the compile failed.. I looked in the man page for ctime_r and i found that i could use -D_POSIX_PTHREAD_SEMANTICS flag for POSIX compliant.

After i run the configure script with -D_POSIX_PTHREAD_SEMANTICS everythig worked ok..


>From the ctime_r man page 

     char *ctime_r(const time_t *clock, char *buf, int buflen);

  Standard conforming
     cc [ flag... ] file... -D_POSIX_PTHREAD_SEMANTICS [ library... ]

     char *ctime_r(const time_t *clock, char *buf);

     char *asctime_r(const struct tm *tm, char *buf);


Thanks for all your help!


//joel


-----Ursprungligt meddelande-----
Från: Erik Rozendaal [mailto:erik at nlnetlabs.nl] 
Skickat: den 31 maj 2005 09:46
Till: Joel Nyholm
Kopia: nsd-users at nlnetlabs.nl
Ämne: Re: trouble compiling nsd-2.3.0 under solaris 10


joel.nyholm at fsb.se wrote:
> Have anyone compiled NSD 2.3.0 under Solaris 10? I have some trouble
> compiling it under solaris 10..
>  
>  
> when i compile tsig.c i get the following error..
> 
> gcc -I/usr/local/ssl/include -DHAVE_CONFIG_H -I. 
> -DDBFILE=\"/etc/nsd/nsd.db\" -DPIDFILE=\"/var/run/nsd.pid\" -DUSER=\"nsd\" -g -O2 -c tsig.c
> tsig.c: In function `tsig_from_query':
> tsig.c:252: error: too few arguments to function `ctime_r'
> tsig.c:256: error: too few arguments to function `ctime_r'
> *** Error code 1
> make: Fatal error: Command failed for target `tsig.o'

Looks like the ctime_r function on solaris is not POSIX compliant by 
default and has an additional 'size' argument.  Could you try 
reconfiguring with:

$ ./configure CPPFLAGS='-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600'

and recompiling?

Other CPPFLAGS you might try to use are:

-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__

or just -D_POSIX_C_SOURCE

Erik




More information about the nsd-users mailing list