More FreeBSD/SDL troubles

Hi,

I’ve gotten SDL to build. I’ve even built John Garrison’s PowerPak
library against it fine, but when I go to link my program against it I
get the following error:

/usr/local/lib/libSDL-1.0.so.0: undefined reference to `clone’

My understanding is that clone is specific to linux and not available
under freebsd though I could be wrong.

That’s correct. For some reason the pthread configure test is failing.

Can you send me the output of “./configure” and config.log, after running
make distclean in the SDL directory?

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Hi,

I’ve gotten SDL to build. I’ve even built John Garrison’s PowerPak
library against it fine, but when I go to link my program against it I
get the following error:

/usr/local/lib/libSDL-1.0.so.0: undefined reference to `clone’

My understanding is that clone is specific to linux and not available
under freebsd though I could be wrong.

Mike

Sam Lantinga wrote:

Hi,

I’ve gotten SDL to build. I’ve even built John Garrison’s PowerPak
library against it fine, but when I go to link my program against it I
get the following error:

/usr/local/lib/libSDL-1.0.so.0: undefined reference to `clone’

My understanding is that clone is specific to linux and not available
under freebsd though I could be wrong.

That’s correct. For some reason the pthread configure test is failing.

Can you send me the output of “./configure” and config.log, after running
make distclean in the SDL directory?

    -Sam Lantinga                           (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Ok I ran gmake distclean and reran configure. I’ve attatched the output of
configure followed by the config.log
-------------- next part --------------
creating cache ./config.cache
checking for a BSD compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking whether make sets ${MAKE}… yes
checking for working aclocal… found
checking for working autoconf… found
checking for working automake… found
checking for working autoheader… found
checking for working makeinfo… found
checking host system type… i386-unknown-freebsdelf3.3
checking target system type… i386-unknown-freebsdelf3.3
checking for Cygwin environment… no
checking for mingw32 environment… no
checking build system type… i386-unknown-freebsdelf3.3
checking for gcc… gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… no
checking whether we are using GNU C… yes
checking whether gcc accepts -g… yes
checking for ld used by GCC… /usr/libexec/elf/ld
checking if the linker (/usr/libexec/elf/ld) is GNU ld… yes
checking for BSD-compatible nm… /usr/bin/nm -B
checking whether ln -s works… yes
checking for object suffix… o
checking for executable suffix… no
checking for ranlib… ranlib
checking for strip… strip
checking for file… /usr/bin/file
updating cache ./config.cache
loading cache ./config.cache within ltconfig
checking for objdir… .libs
checking for gcc option to produce PIC… -fPIC
checking if gcc PIC flag -fPIC works… yes
checking if gcc static flag -static works… yes
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.lo… yes
checking if gcc supports -fno-rtti -fno-exceptions … no
checking whether the linker (/usr/libexec/elf/ld) supports shared libraries… yes
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking for /usr/libexec/elf/ld option to reload object files… -r
checking dynamic linker characteristics… freebsdelf3.3 ld.so
checking command to parse /usr/bin/nm -B output… ok
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
creating libtool
updating cache ./config.cache
loading cache ./config.cache
checking whether make sets ${MAKE}… (cached) yes
checking for gcc… (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works… yes
checking whether the C compiler (gcc -g -O2 ) is a cross-compiler… no
checking whether we are using GNU C… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for c++… c++
checking whether the C++ compiler (c++ ) works… yes
checking whether the C++ compiler (c++ ) is a cross-compiler… no
checking whether we are using GNU C++… yes
checking whether c++ accepts -g… yes
checking for a BSD compatible install… /usr/bin/install -c
checking target system type… i386-unknown-freebsdelf3.3
checking for working const… yes
checking for esd-config… /usr/local/bin/esd-config
checking for ESD - version >= 0.2.8… yes
checking how to run the C preprocessor… gcc -E
checking for X… libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for dnet_ntoa in -ldnet… no
checking for dnet_ntoa in -ldnet_stub… no
checking for gethostbyname… yes
checking for connect… yes
checking for remove… yes
checking for shmat… yes
checking for IceConnectionNumber in -lICE… yes
checking for XFree86 DGA 1.0 support… yes
checking for Memory Type Range Register support… no
checking for pthreads… no
Copying src/main/linux/SDL_main.c -> src/main/SDL_main.c
Copying src/audio/linux/SDL_lowaudio.h -> src/audio/SDL_lowaudio.h
Copying src/audio/linux/SDL_sysaudio.c -> src/audio/SDL_sysaudio.c
Copying src/cdrom/freebsd/SDL_syscdrom.c -> src/cdrom/SDL_syscdrom.c
Copying src/thread/linux/SDL_mutex.c -> src/thread/SDL_mutex.c
Copying src/thread/linux/SDL_systhread.c -> src/thread/SDL_systhread.c
Copying src/thread/linux/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h
Copying src/timer/linux/SDL_timer.c -> src/timer/SDL_timer.c
updating cache ./config.cache
creating ./config.status
creating Makefile
creating docs/Makefile
creating include/Makefile
creating include/SDL/Makefile
creating src/Makefile
creating src/main/Makefile
creating src/audio/Makefile
creating src/video/Makefile
creating src/video/x11/Makefile
creating src/video/fbcon/Makefile
creating src/video/ggi/Makefile
creating src/video/svga/Makefile
creating src/video/wincommon/Makefile
creating src/video/windib/Makefile
creating src/video/windx5/Makefile
creating src/video/bwindow/Makefile
creating src/video/toolbox/Makefile
creating src/events/Makefile
creating src/cdrom/Makefile
creating src/thread/Makefile
creating src/timer/Makefile
creating src/endian/Makefile
creating src/file/Makefile
creating src/hermes/Makefile
creating sdl-config
creating sdl.spec
-------------- next part --------------
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:648: checking for a BSD compatible install
configure:701: checking whether build environment is sane
configure:758: checking whether make sets ${MAKE}
configure:804: checking for working aclocal
configure:817: checking for working autoconf
configure:830: checking for working automake
configure:843: checking for working autoheader
configure:856: checking for working makeinfo
configure:877: checking host system type
configure:898: checking target system type
configure:919: checking for Cygwin environment
configure:935: cc -c conftest.c 1>&5
configure: In function main': configure:931:CYGWIN32’ undeclared (first use this function)
configure:931: (Each undeclared identifier is reported only once
configure:931: for each function it appears in.)
configure: failed program was:
#line 924 “configure”
#include “confdefs.h”

int main() {

#ifndef CYGWIN
#define CYGWIN CYGWIN32
#endif
return CYGWIN;
; return 0; }
configure:952: checking for mingw32 environment
configure:964: cc -c conftest.c 1>&5
configure: In function main': configure:960:MINGW32’ undeclared (first use this function)
configure:960: (Each undeclared identifier is reported only once
configure:960: for each function it appears in.)
configure: failed program was:
#line 957 “configure”
#include “confdefs.h”

int main() {
return MINGW32;
; return 0; }
configure:1050: checking build system type
configure:1070: checking for gcc
configure:1183: checking whether the C compiler (gcc ) works
configure:1199: gcc -o conftest conftest.c 1>&5
configure:1225: checking whether the C compiler (gcc ) is a cross-compiler
configure:1230: checking whether we are using GNU C
configure:1239: gcc -E conftest.c
configure:1258: checking whether gcc accepts -g
configure:1301: checking for ld used by GCC
configure:1370: checking if the linker (/usr/libexec/elf/ld) is GNU ld
GNU ld version 2.9.1 (with BFD 2.9.1)
configure:1388: checking for BSD-compatible nm
configure:1425: checking whether ln -s works
configure:1446: checking for object suffix
configure:1452: gcc -c -g -O2 conftest.c 1>&5
configure:1472: checking for executable suffix
configure:1482: gcc -o conftest -g -O2 conftest.c 1>&5
configure:1513: checking for ranlib
configure:1580: checking for strip
configure:1649: checking for file
ltconfig:557:checking for gcc option to produce PIC
ltconfig:687:checking that gcc PIC flag -fPIC works.
ltconfig:696: gcc -c -g -O2 -fPIC -DPIC conftest.c 1>&5
ltconfig:748: checking if gcc static flag -static works
ltconfig:756: gcc -o conftest -g -O2 -static conftest.c 1>&5
ltconfig:793: checking if gcc supports -c -o file.o
ltconfig:794: gcc -c -g -O2 -o out/conftest2.o conftest.c 1>&5
ltconfig:826: checking if gcc supports -c -o file.lo
ltconfig:827: gcc -c -g -O2 -c -o conftest.lo conftest.c 1>&5
ltconfig:878: checking if gcc supports -fno-rtti -fno-exceptions
ltconfig:879: gcc -c -g -O2 -fno-rtti -fno-exceptions -c conftest.c conftest.c 1>&5
cc1: Invalid option -fno-exceptions' cc1: Invalid option-fno-exceptions’
ltconfig:1873: checking if global_symbol_pipe works
ltconfig:1874: gcc -c -g -O2 conftest.c 1>&5
ltconfig:1877: eval "/usr/bin/nm -B conftest.o | sed -n -e 's/^.[ ]([ABCDGISTW])[ ][ ]()([_A-Za-z][_A-Za-z0-9])$/\1 \2\3 \3/p’ > conftest.nm"
ltconfig:1929: gcc -o conftest -g -O2 -fno-builtin conftest.c conftstm.o 1>&5
configure:2169: checking whether make sets ${MAKE}
configure:2198: checking for gcc
configure:2311: checking whether the C compiler (gcc -g -O2 ) works
configure:2327: gcc -o conftest -g -O2 conftest.c 1>&5
configure:2353: checking whether the C compiler (gcc -g -O2 ) is a cross-compiler
configure:2358: checking whether we are using GNU C
configure:2386: checking whether gcc accepts -g
configure:2422: checking for c++
configure:2454: checking whether the C++ compiler (c++ ) works
configure:2470: c++ -o conftest conftest.C 1>&5
configure:2496: checking whether the C++ compiler (c++ ) is a cross-compiler
configure:2501: checking whether we are using GNU C++
configure:2510: c++ -E conftest.C
configure:2529: checking whether c++ accepts -g
configure:2572: checking for a BSD compatible install
configure:2626: checking target system type
configure:2651: checking for working const
configure:2705: gcc -c -g -O2 conftest.c 1>&5
configure:2896: checking for esd-config
configure:2931: checking for ESD - version >= 0.2.8
configure:3013: gcc -o conftest -g -O2 -I/usr/local/include conftest.c -L/usr/local/lib -lesd -laudiofile -lm 1>&5
configure:3174: checking how to run the C preprocessor
configure:3195: gcc -E conftest.c >/dev/null 2>conftest.out
configure:3258: checking for X
configure:3572: checking for dnet_ntoa in -ldnet
configure:3591: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include conftest.c -ldnet 1>&5
/usr/libexec/elf/ld: cannot open -ldnet: No such file or directory
configure: failed program was:
#line 3580 “configure”
#include “confdefs.h”
/
Override any gcc2 internal prototype to avoid an error. /
/
We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa();

int main() {
dnet_ntoa()
; return 0; }
configure:3613: checking for dnet_ntoa in -ldnet_stub
configure:3632: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include conftest.c -ldnet_stub 1>&5
/usr/libexec/elf/ld: cannot open -ldnet_stub: No such file or directory
configure: failed program was:
#line 3621 “configure”
#include “confdefs.h”
/* Override any gcc2 internal prototype to avoid an error. /
/
We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dnet_ntoa();

int main() {
dnet_ntoa()
; return 0; }
configure:3661: checking for gethostbyname
configure:3689: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include conftest.c 1>&5
configure:3759: checking for connect
configure:3787: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include conftest.c 1>&5
configure:3851: checking for remove
configure:3879: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include conftest.c 1>&5
configure:3943: checking for shmat
configure:3971: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include conftest.c 1>&5
configure:4044: checking for IceConnectionNumber in -lICE
configure:4063: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include -L/usr/X11R6/lib conftest.c -lICE 1>&5
configure:4103: checking for XFree86 DGA 1.0 support
configure:4118: gcc -c -g -O2 -DESD_SUPPORT -I/usr/local/include -I/usr/X11R6/include -DENABLE_X11 conftest.c 1>&5
configure:4145: checking for Memory Type Range Register support
configure:4159: gcc -c -g -O2 -DESD_SUPPORT -I/usr/local/include -I/usr/X11R6/include -DENABLE_X11 -DXFREE86_DGA conftest.c 1>&5
configure:4150: asm/mtrr.h: No such file or directory
configure: failed program was:
#line 4148 “configure”
#include “confdefs.h”

             #include <asm/mtrr.h>

int main() {

             struct mtrr_sentry entry;

; return 0; }
configure:4336: checking for pthreads
configure:4351: gcc -o conftest -g -O2 -DESD_SUPPORT -I/usr/local/include -I/usr/X11R6/include -DENABLE_X11 -DXFREE86_DGA conftest.c 1>&5
/var/tmp/ccX569941.o: In function main': /usr/local/SDL/configure(.text+0xb): undefined reference topthread_attr_init’
configure: failed program was:
#line 4339 “configure”
#include “confdefs.h”

     #include <pthread.h>

int main() {

     pthread_attr_t type;
     pthread_attr_init(&type);

; return 0; }