Subject: Re: compiling on dreamcast
To: Kenneth Culver <culverk@culverk.student.umd.edu>
From: Alistair Crooks <agc@pkgsrc.org>
List: port-dreamcast
Date: 05/04/2001 10:26:05
You did exactly the right thing: "make" should make the package.

I built the package on i386, and it seems, for some reason, that your
configure step checks and finds things properly, but... isn't setting the
right values in your config.cache:

The first compilation statement on i386 (for me) looks like
(re-formatted to avoid long lines):

===> real-build [thttpd-2.20b] ===> Building for thttpd-2.20b
/usr/bin/gcc -Wall -O2 -O -DHAVE__PROGNAME=1 -DHAVE_FCNTL_H=1
-DHAVE_GRP_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DHAVE_POLL_H=1
-DHAVE_SYS_POLL_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1
-DHAVE_LIBCRYPT=1 -DHAVE_STRERROR=1 -DHAVE_WAITPID=1
-DHAVE_VSNPRINTF=1 -DHAVE_DAEMON=1 -DHAVE_SETSID=1 -DHAVE_SETLOGIN=1
-DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1
-DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1
-DHAVE_POLL=1 -DHAVE_TM_GMTOFF=1 -DHAVE_SOCKADDR_STORAGE=1
-DHAVE_SOCKADDR_IN6=1 -I.  -c thttpd.c

And your error is actually because <fcntl.h> is not being included,
and that is because HAVE_FCNTL_H is undefined:

#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

So the next thing to check, is the generated Makefile:

	work/thttpd-2.20b/Makefile

should contain, around line 52, a DEFS definition.  On i386 it looks
for me like (re-formatted to avoid long lines):

DEFS = -DHAVE__PROGNAME=1 -DHAVE_FCNTL_H=1 -DHAVE_GRP_H=1
-DHAVE_MEMORY_H=1 -DHAVE_PATHS_H=1 -DHAVE_POLL_H=1 -DHAVE_SYS_POLL_H=1
-DTIME_WITH_SYS_TIME=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBCRYPT=1 -DHAVE_ST
RERROR=1 -DHAVE_WAITPID=1 -DHAVE_VSNPRINTF=1 -DHAVE_DAEMON=1
-DHAVE_SETSID=1 -DHAVE_SETLOGIN=1 -DHAVE_GETADDRINFO=1
-DHAVE_GETNAMEINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_UNISTD_H=1
-DHAVE_GETPAGESIZE=1 -DHAVE_MM AP=1 -DHAVE_SELECT=1 -DHAVE_POLL=1
-DHAVE_TM_GMTOFF=1 -DHAVE_SOCKADDR_STORAGE=1 -DHAVE_SOCKADDR_IN6=1

I suspect your line does not have all these definitions, and so we'll
have to look deep into the bowels of the GNU configure script, to see
why it's not generating the line correctly. This may well be because
sed or awk or the shell is doing something unusual on the DC.

Regards,
Alistair


On Thu, May 03, 2001 at 11:17:20PM -0400, Kenneth Culver wrote:
> Alright, this is a follow-up to my last mail about compiling thttpd. Here
> is what happens when I use pkgsrc to try to compile it:
> 
> => Checksum OK for thttpd-2.20b.tar.gz.
> => Checksum OK for sitedrivenby.gif.
> ===> Extracting for thttpd-2.20b
> ===> Patching for thttpd-2.20b
> ===> Applying NetBSD patches for thttpd-2.20b
> ===> Configuring for thttpd-2.20b
> /bin/mv /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/extras/htpasswd.1 /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/extras/thtpasswd.1
> /bin/mv /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/extras/htpasswd.c /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/extras/thtpasswd.c
> for file in thttpd.8 extras/Makefile.in extras/thtpasswd.c; do  /bin/mv -f /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/${file} /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/${file}.bak;  /usr/bin/sed -e "s,htpasswd,thtpasswd,g"  < /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/${file}.bak > /usr/pkgsrc/www/thttpd/work/thttpd-2.20b/${file};  done
> creating cache ./config.cache
> checking host system type... sh--netbsd
> checking target system type... sh--netbsd
> checking build system type... sh--netbsd
> checking for gcc... cc
> checking whether the C compiler (cc -O  -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib) works... yes
> checking whether the C compiler (cc -O  -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib) is a cross-compiler... no
> checking whether we are using GNU C... yes
> checking whether cc accepts -g... yes
> checking gcc version... 
> checking how to link static binaries... -static
> checking for __progname... yes
> checking how to run the C preprocessor... cc -E
> checking for fcntl.h... yes
> checking for grp.h... yes
> checking for memory.h... yes
> checking for paths.h... yes
> checking for poll.h... yes
> checking for sys/poll.h... yes
> checking whether time.h and sys/time.h may both be included... yes
> checking for dirent.h that defines DIR... yes
> checking for opendir in -ldir... no
> checking for /usr/local/v6/lib... no
> checking for gethostbyname... yes
> checking for socket... yes
> checking for main in -linet6... no
> checking for crypt... no
> checking for crypt in -lcrypt... yes
> checking for hstrerror... yes
> checking for strerror... yes
> checking for waitpid... yes
> checking for vsnprintf... yes
> checking for daemon... yes
> checking for setsid... yes
> checking for setlogin... yes
> checking for getaddrinfo... yes
> checking for getnameinfo... yes
> checking for gai_strerror... yes
> checking for unistd.h... yes
> checking for getpagesize... yes
> checking for working mmap... yes
> checking for select... yes
> checking for poll... yes
> checking if struct tm has tm_gmtoff member... yes
> checking if struct sockaddr_storage exists... yes
> checking if struct sockaddr_in6 exists... yes
> checking whether make sets ${MAKE}... yes
> checking for a BSD compatible install... /usr/bin/install -c -o root -g wheel
> updating cache ./config.cache
> creating ./config.status
> creating Makefile
> creating cgi-src/Makefile
> creating extras/Makefile
> ===> Building for thttpd-2.20b
> cc -O -O  -I. -c thttpd.c
> thttpd.c: In function `handle_hup':
> thttpd.c:184: `F_SETFD' undeclared (first use in this function)
> thttpd.c:184: (Each undeclared identifier is reported only once
> thttpd.c:184: for each function it appears in.)
> thttpd.c: In function `main':
> thttpd.c:269: `F_SETFD' undeclared (first use in this function)
> thttpd.c: In function `handle_newconnect':
> thttpd.c:1234: `F_GETFL' undeclared (first use in this function)
> thttpd.c:1237: `F_SETFL' undeclared (first use in this function)
> thttpd.c:1237: `O_NDELAY' undeclared (first use in this function)
> *** Error code 1
> 
> Stop.
> *** Error code 1
> 
> Stop.
> *** Error code 1
> 
> Stop.
> *** Error code 1
> 
> Stop.
> 
> did I do something wrong? I just cd to /usr/pkgsrc/www/thttpd then type
> make.
> 
> Thanks for any help...
> 
> Ken
>