comparison configure.in @ 1550:31c2b8e4885e

Fixed bug #166 From the autoconf obsolete macros documentation: Macro: AC_CANONICAL_SYSTEM Determine the system type and set output variables to the names of the canonical system types. See section Getting the Canonical System Type, for details about the variables this macro sets. The user is encouraged to use either AC_CANONICAL_BUILD, or AC_CANONICAL_HOST, or AC_CANONICAL_TARGET, depending on the needs. Using AC_CANONICAL_TARGET is enough to run the two other macros. From the documentation for the canonical environments: case $target in i386-*-mach* | i386-*-gnu*) obj_format=aout emulation=mach bfd_gas=yes ;; i960-*-bout) obj_format=bout ;; esac Note that the above example uses $target because it's taken from a tool which can be built on some architecture ($build), run on another ($host), but yet handle data for a third architecture ($target). Such tools are usually part of a compiler suite, they generate code for a specific $target. However $target should be meaningless for most packages. If you want to base a decision on the system where your program will be run, make sure you use the $host variable.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 Mar 2006 05:27:22 +0000
parents a77c022733fe
children 780fd5b61df1
comparison
equal deleted inserted replaced
1549:066236f0cbf0 1550:31c2b8e4885e
37 AC_SUBST(LT_RELEASE) 37 AC_SUBST(LT_RELEASE)
38 AC_SUBST(LT_CURRENT) 38 AC_SUBST(LT_CURRENT)
39 AC_SUBST(LT_REVISION) 39 AC_SUBST(LT_REVISION)
40 AC_SUBST(LT_AGE) 40 AC_SUBST(LT_AGE)
41 41
42 dnl Detect the canonical host and target build environment 42 dnl Detect the canonical build and host environments
43 AC_CONFIG_AUX_DIRS($srcdir/build-scripts) 43 AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
44 AC_CANONICAL_SYSTEM 44 AC_CANONICAL_HOST
45 AC_C_BIGENDIAN 45 AC_C_BIGENDIAN
46 if test x$ac_cv_c_bigendian = xyes; then 46 if test x$ac_cv_c_bigendian = xyes; then
47 AC_DEFINE(SDL_BYTEORDER, 4321) 47 AC_DEFINE(SDL_BYTEORDER, 4321)
48 else 48 else
49 AC_DEFINE(SDL_BYTEORDER, 1234) 49 AC_DEFINE(SDL_BYTEORDER, 1234)
52 dnl Set up the compiler and linker flags 52 dnl Set up the compiler and linker flags
53 INCLUDE="-I$srcdir/include" 53 INCLUDE="-I$srcdir/include"
54 if test x$srcdir != x.; then 54 if test x$srcdir != x.; then
55 INCLUDE="-Iinclude $INCLUDE" 55 INCLUDE="-Iinclude $INCLUDE"
56 fi 56 fi
57 case "$target" in 57 case "$host" in
58 *-*-cygwin*) 58 *-*-cygwin*)
59 # We build SDL on cygwin without the UNIX emulation layer 59 # We build SDL on cygwin without the UNIX emulation layer
60 BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin" 60 BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
61 BASE_LDFLAGS="-mno-cygwin" 61 BASE_LDFLAGS="-mno-cygwin"
62 ;; 62 ;;
283 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c" 283 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
284 SOURCES="$SOURCES $srcdir/src/audio/dma/*.c" 284 SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
285 have_audio=yes 285 have_audio=yes
286 286
287 # OpenBSD needs linking with ossaudio emulation library 287 # OpenBSD needs linking with ossaudio emulation library
288 case "$target" in 288 case "$host" in
289 *-*-openbsd*|*-*-netbsd*) 289 *-*-openbsd*|*-*-netbsd*)
290 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";; 290 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
291 esac 291 esac
292 fi 292 fi
293 fi 293 fi
567 dnl See if we can use x86 assembly blitters 567 dnl See if we can use x86 assembly blitters
568 # NASM is available from: http://nasm.sourceforge.net 568 # NASM is available from: http://nasm.sourceforge.net
569 CheckNASM() 569 CheckNASM()
570 { 570 {
571 dnl Make sure we are running on an x86 platform 571 dnl Make sure we are running on an x86 platform
572 case $target in 572 case $host in
573 i?86*) 573 i?86*)
574 ;; 574 ;;
575 *) 575 *)
576 # Nope, bail early. 576 # Nope, bail early.
577 return 577 return
598 ;; 598 ;;
599 esac 599 esac
600 AC_SUBST(NASM) 600 AC_SUBST(NASM)
601 AC_SUBST(NASMFLAGS) 601 AC_SUBST(NASMFLAGS)
602 602
603 case "$target" in 603 case "$host" in
604 # this line is needed for QNX, because it's not defined the __ELF__ 604 # this line is needed for QNX, because it's not defined the __ELF__
605 *-*-qnx*) 605 *-*-qnx*)
606 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";; 606 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
607 *-*-solaris*) 607 *-*-solaris*)
608 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";; 608 EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
751 if test x$have_x = xyes; then 751 if test x$have_x = xyes; then
752 AC_ARG_ENABLE(x11-shared, 752 AC_ARG_ENABLE(x11-shared,
753 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [default=yes]]), 753 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [default=yes]]),
754 , enable_x11_shared=yes) 754 , enable_x11_shared=yes)
755 755
756 case "$target" in 756 case "$host" in
757 *-*-darwin*) 757 *-*-darwin*)
758 x11_lib='/usr/X11R6/lib/libX11.6.dylib' 758 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
759 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' 759 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
760 ;; 760 ;;
761 *-*-osf*) 761 *-*-osf*)
1351 dnl Check for MacOS OpenGL 1351 dnl Check for MacOS OpenGL
1352 CheckMacGL() 1352 CheckMacGL()
1353 { 1353 {
1354 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then 1354 if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
1355 AC_DEFINE(SDL_VIDEO_OPENGL) 1355 AC_DEFINE(SDL_VIDEO_OPENGL)
1356 case "$target" in 1356 case "$host" in
1357 *-*-darwin*) 1357 *-*-darwin*)
1358 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework OpenGL" 1358 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework OpenGL"
1359 # The following is probably not available in Darwin: 1359 # The following is probably not available in Darwin:
1360 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework AGL" 1360 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -framework AGL"
1361 esac 1361 esac
1483 , enable_pthreads=yes) 1483 , enable_pthreads=yes)
1484 dnl This is used on Linux for glibc binary compatibility (Doh!) 1484 dnl This is used on Linux for glibc binary compatibility (Doh!)
1485 AC_ARG_ENABLE(pthread-sem, 1485 AC_ARG_ENABLE(pthread-sem,
1486 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [default=yes]]), 1486 AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [default=yes]]),
1487 , enable_pthread_sem=yes) 1487 , enable_pthread_sem=yes)
1488 case "$target" in 1488 case "$host" in
1489 *-*-linux*) 1489 *-*-linux*)
1490 pthread_cflags="-D_REENTRANT" 1490 pthread_cflags="-D_REENTRANT"
1491 pthread_lib="-lpthread" 1491 pthread_lib="-lpthread"
1492 ;; 1492 ;;
1493 *-*-bsdi*) 1493 *-*-bsdi*)
1892 AC_ARG_ENABLE(rpath, 1892 AC_ARG_ENABLE(rpath,
1893 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [default=yes]]), 1893 AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [default=yes]]),
1894 , enable_rpath=yes) 1894 , enable_rpath=yes)
1895 } 1895 }
1896 1896
1897 dnl Set up the configuration based on the target platform! 1897 dnl Set up the configuration based on the host platform!
1898 case "$target" in 1898 case "$host" in
1899 arm-*-elf*) # FIXME: Can we get more specific for iPodLinux? 1899 arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
1900 ARCH=linux 1900 ARCH=linux
1901 CheckDummyVideo 1901 CheckDummyVideo
1902 CheckIPod 1902 CheckIPod
1903 # Set up files for the timer library 1903 # Set up files for the timer library
1906 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" 1906 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
1907 have_timers=yes 1907 have_timers=yes
1908 fi 1908 fi
1909 ;; 1909 ;;
1910 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*) 1910 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
1911 case "$target" in 1911 case "$host" in
1912 *-*-linux*) ARCH=linux ;; 1912 *-*-linux*) ARCH=linux ;;
1913 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; 1913 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
1914 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; 1914 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
1915 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; 1915 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
1916 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants 1916 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
2070 have_timers=yes 2070 have_timers=yes
2071 fi 2071 fi
2072 ;; 2072 ;;
2073 *-*-cygwin* | *-*-mingw32*) 2073 *-*-cygwin* | *-*-mingw32*)
2074 ARCH=win32 2074 ARCH=win32
2075 if test "$build" != "$target"; then # cross-compiling 2075 if test "$build" != "$host"; then # cross-compiling
2076 # Default cross-compile location 2076 # Default cross-compile location
2077 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc 2077 ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
2078 else 2078 else
2079 # Look for the location of the tools and install there 2079 # Look for the location of the tools and install there
2080 if test "$BUILD_PREFIX" != ""; then 2080 if test "$BUILD_PREFIX" != ""; then
2333 # The RISC OS platform requires special setup. 2333 # The RISC OS platform requires special setup.
2334 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz" 2334 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
2335 ;; 2335 ;;
2336 *) 2336 *)
2337 AC_MSG_ERROR([ 2337 AC_MSG_ERROR([
2338 *** Unsupported target: Please add to configure.in 2338 *** Unsupported host: Please add to configure.in
2339 ]) 2339 ])
2340 ;; 2340 ;;
2341 esac 2341 esac
2342 2342
2343 # Verify that we have all the platform specific files we need 2343 # Verify that we have all the platform specific files we need