Actually hook the cpuinfo module into the library. :)
authorSam Lantinga <slouken@libsdl.org>
Tue, 18 Nov 2003 02:16:57 +0000
changeset 740e70f80e98f60
parent 739 22dbf364c017
child 741 97b9c301df94
Actually hook the cpuinfo module into the library. :)
configure.in
src/Makefile.am
src/cpuinfo/Makefile.am
test/Makefile.am
test/testcpuinfo.c
     1.1 --- a/configure.in	Tue Nov 18 01:27:06 2003 +0000
     1.2 +++ b/configure.in	Tue Nov 18 02:16:57 2003 +0000
     1.3 @@ -226,6 +226,15 @@
     1.4  else
     1.5      CFLAGS="$CFLAGS -DDISABLE_FILE"
     1.6  fi
     1.7 +AC_ARG_ENABLE(cpuinfo,
     1.8 +[  --enable-cpuinfo        Enable the cpuinfo subsystem [default=yes]],
     1.9 +              , enable_cpuinfo=yes)
    1.10 +if test x$enable_cpuinfo = xyes; then
    1.11 +    SDL_EXTRADIRS="$SDL_EXTRADIRS cpuinfo"
    1.12 +    SDL_EXTRALIBS="$SDL_EXTRALIBS cpuinfo/libcpuinfo.la"
    1.13 +else
    1.14 +    CFLAGS="$CFLAGS -DDISABLE_CPUINFO"
    1.15 +fi
    1.16  
    1.17  dnl See if the OSS audio interface is supported
    1.18  CheckOSS()
     2.1 --- a/src/Makefile.am	Tue Nov 18 01:27:06 2003 +0000
     2.2 +++ b/src/Makefile.am	Tue Nov 18 02:16:57 2003 +0000
     2.3 @@ -7,7 +7,7 @@
     2.4  
     2.5  # These are the subdirectories which may be built
     2.6  EXTRA_SUBDIRS =			\
     2.7 -	 audio video events joystick cdrom thread timer endian file hermes
     2.8 +	 audio video events joystick cdrom thread timer endian file cpuinfo hermes
     2.9  
    2.10  # These are the subdirectories which will be built now
    2.11  SUBDIRS = $(CORE_SUBDIRS) @SDL_EXTRADIRS@
     3.1 --- a/src/cpuinfo/Makefile.am	Tue Nov 18 01:27:06 2003 +0000
     3.2 +++ b/src/cpuinfo/Makefile.am	Tue Nov 18 02:16:57 2003 +0000
     3.3 @@ -16,7 +16,6 @@
     3.4  
     3.5  if HAVE_NASM
     3.6  ARCH_SRCS =			\
     3.7 -	gcpuinfo.c		\
     3.8  	_cpuinfo.asm		\
     3.9  	_pcihelp.asm
    3.10  else
    3.11 @@ -24,6 +23,8 @@
    3.12  endif
    3.13  
    3.14  COMMON_SRCS = 			\
    3.15 +	cpuinfo.h		\
    3.16 +	gcpuinfo.c		\
    3.17  	SDL_cpuinfo.c
    3.18  
    3.19  libcpuinfo_la_SOURCES = $(ARCH_SRCS) $(COMMON_SRCS)
     4.1 --- a/test/Makefile.am	Tue Nov 18 01:27:06 2003 +0000
     4.2 +++ b/test/Makefile.am	Tue Nov 18 02:16:57 2003 +0000
     4.3 @@ -1,7 +1,7 @@
     4.4  AUTOMAKE_OPTIONS = no-dependencies
     4.5  
     4.6  noinst_PROGRAMS = \
     4.7 -	testver testtypes testhread testlock testerror testsem testtimer \
     4.8 +	testver testtypes testcpuinfo testhread testlock testerror testsem testtimer \
     4.9  	loopwave testcdrom testkeys testvidinfo checkkeys testwin graywin \
    4.10  	testsprite testbitmap testalpha testgamma testpalette testwm \
    4.11  	threadwin testoverlay testoverlay2 testgl testjoystick
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/testcpuinfo.c	Tue Nov 18 02:16:57 2003 +0000
     5.3 @@ -0,0 +1,15 @@
     5.4 +
     5.5 +/* Test program to check SDL's CPU feature detection */
     5.6 +
     5.7 +#include <stdio.h>
     5.8 +
     5.9 +#include "SDL.h"
    5.10 +#include "SDL_cpuinfo.h"
    5.11 +
    5.12 +int main(int argc, char *argv[])
    5.13 +{
    5.14 +	printf("MMX %s\n", SDL_HasMMX() ? "detected" : "not detected");
    5.15 +	printf("3DNow %s\n", SDL_Has3DNow() ? "detected" : "not detected");
    5.16 +	printf("SSE %s\n", SDL_HasSSE() ? "detected" : "not detected");
    5.17 +	return(0);
    5.18 +}