Skip to content

Commit

Permalink
Actually hook the cpuinfo module into the library. :)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 18, 2003
1 parent 04c9894 commit d5b58c2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
9 changes: 9 additions & 0 deletions configure.in
Expand Up @@ -226,6 +226,15 @@ if test x$enable_file = xyes; then
else
CFLAGS="$CFLAGS -DDISABLE_FILE"
fi
AC_ARG_ENABLE(cpuinfo,
[ --enable-cpuinfo Enable the cpuinfo subsystem [default=yes]],
, enable_cpuinfo=yes)
if test x$enable_cpuinfo = xyes; then
SDL_EXTRADIRS="$SDL_EXTRADIRS cpuinfo"
SDL_EXTRALIBS="$SDL_EXTRALIBS cpuinfo/libcpuinfo.la"
else
CFLAGS="$CFLAGS -DDISABLE_CPUINFO"
fi

dnl See if the OSS audio interface is supported
CheckOSS()
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Expand Up @@ -7,7 +7,7 @@ CORE_SUBDIRS = \

# These are the subdirectories which may be built
EXTRA_SUBDIRS = \
audio video events joystick cdrom thread timer endian file hermes
audio video events joystick cdrom thread timer endian file cpuinfo hermes

# These are the subdirectories which will be built now
SUBDIRS = $(CORE_SUBDIRS) @SDL_EXTRADIRS@
Expand Down
3 changes: 2 additions & 1 deletion src/cpuinfo/Makefile.am
Expand Up @@ -16,14 +16,15 @@ noinst_LTLIBRARIES = libcpuinfo.la

if HAVE_NASM
ARCH_SRCS = \
gcpuinfo.c \
_cpuinfo.asm \
_pcihelp.asm
else
ARCH_SRCS =
endif

COMMON_SRCS = \
cpuinfo.h \
gcpuinfo.c \
SDL_cpuinfo.c

libcpuinfo_la_SOURCES = $(ARCH_SRCS) $(COMMON_SRCS)
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile.am
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = no-dependencies

noinst_PROGRAMS = \
testver testtypes testhread testlock testerror testsem testtimer \
testver testtypes testcpuinfo testhread testlock testerror testsem testtimer \
loopwave testcdrom testkeys testvidinfo checkkeys testwin graywin \
testsprite testbitmap testalpha testgamma testpalette testwm \
threadwin testoverlay testoverlay2 testgl testjoystick
Expand Down
15 changes: 15 additions & 0 deletions test/testcpuinfo.c
@@ -0,0 +1,15 @@

/* Test program to check SDL's CPU feature detection */

#include <stdio.h>

#include "SDL.h"
#include "SDL_cpuinfo.h"

int main(int argc, char *argv[])
{
printf("MMX %s\n", SDL_HasMMX() ? "detected" : "not detected");
printf("3DNow %s\n", SDL_Has3DNow() ? "detected" : "not detected");
printf("SSE %s\n", SDL_HasSSE() ? "detected" : "not detected");
return(0);
}

0 comments on commit d5b58c2

Please sign in to comment.