configure.in
changeset 1173 e9cf8c1b4590
parent 1170 bb1a52a8d3d6
child 1174 8c43aceeed81
equal deleted inserted replaced
1172:f69f4d25fb20 1173:e9cf8c1b4590
   302             fi
   302             fi
   303             alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
   303             alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
   304             alsa_lib=`ls $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   304             alsa_lib=`ls $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   305             echo "-- $alsa_lib_spec -> $alsa_lib"
   305             echo "-- $alsa_lib_spec -> $alsa_lib"
   306 
   306 
   307             if test x$use_dlopen != xyes && \
   307             if test x$have_loadso != xyes && \
   308                test x$enable_alsa_shared = xyes; then
   308                test x$enable_alsa_shared = xyes; then
   309                 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   309                 AC_MSG_ERROR([You must have SDL_LoadObject() support])
   310             fi
   310             fi
   311             if test x$use_dlopen = xyes && \
   311             if test x$have_loadso = xyes && \
   312                test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
   312                test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
   313                 CFLAGS="$CFLAGS -DALSA_SUPPORT -DALSA_DYNAMIC=\$(alsa_lib) $ALSA_CFLAGS"
   313                 CFLAGS="$CFLAGS -DALSA_SUPPORT -DALSA_DYNAMIC=\$(alsa_lib) $ALSA_CFLAGS"
   314                 AC_SUBST(alsa_lib)
   314                 AC_SUBST(alsa_lib)
   315 
   315 
   316                 use_dlvsym=no
   316                 use_dlvsym=no
   365 [  --enable-esd-shared     dynamically load ESD audio support [default=yes]],
   365 [  --enable-esd-shared     dynamically load ESD audio support [default=yes]],
   366                           , enable_esd_shared=yes)
   366                           , enable_esd_shared=yes)
   367             esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
   367             esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
   368             esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   368             esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   369             echo "-- $esd_lib_spec -> $esd_lib"
   369             echo "-- $esd_lib_spec -> $esd_lib"
   370             if test x$use_dlopen != xyes && \
   370             if test x$have_loadso != xyes && \
   371                test x$enable_esd_shared = xyes; then
   371                test x$enable_esd_shared = xyes; then
   372                 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   372                 AC_MSG_ERROR([You must have SDL_LoadObject() support])
   373             fi
   373             fi
   374             if test x$use_dlopen = xyes && \
   374             if test x$have_loadso = xyes && \
   375                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   375                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
   376                 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
   376                 CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
   377                 AC_SUBST(esd_lib)
   377                 AC_SUBST(esd_lib)
   378             else
   378             else
   379                 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
   379                 CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
   416 [  --enable-arts-shared    dynamically load aRts audio support [default=yes]],
   416 [  --enable-arts-shared    dynamically load aRts audio support [default=yes]],
   417                               , enable_arts_shared=yes)
   417                               , enable_arts_shared=yes)
   418                 arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*"
   418                 arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*"
   419                 arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   419                 arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
   420                 echo "-- $arts_lib_spec -> $arts_lib"
   420                 echo "-- $arts_lib_spec -> $arts_lib"
   421                 if test x$use_dlopen != xyes && \
   421                 if test x$have_loadso != xyes && \
   422                    test x$enable_arts_shared = xyes; then
   422                    test x$enable_arts_shared = xyes; then
   423                     AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   423                     AC_MSG_ERROR([You must have SDL_LoadObject() support])
   424                 fi
   424                 fi
   425                 if test x$use_dlopen = xyes && \
   425                 if test x$have_loadso = xyes && \
   426                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
   426                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
   427                     CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
   427                     CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
   428                     AC_SUBST(arts_lib)
   428                     AC_SUBST(arts_lib)
   429                 else
   429                 else
   430                     CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
   430                     CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
   615 
   615 
   616             dnl !!! FIXME: if a platform needs more than this, fill it in!
   616             dnl !!! FIXME: if a platform needs more than this, fill it in!
   617             x11_lib='libX11.so.6'
   617             x11_lib='libX11.so.6'
   618             x11ext_lib='libXext.so.6'
   618             x11ext_lib='libXext.so.6'
   619 
   619 
   620             if test x$use_dlopen != xyes && \
   620             if test x$have_loadso != xyes && \
   621                test x$enable_x11_shared = xyes; then
   621                test x$enable_x11_shared = xyes; then
   622                 AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
   622                 AC_MSG_ERROR([You must have SDL_LoadObject() support])
   623             fi
   623             fi
   624 
   624 
   625             if test x$use_dlopen = xyes && \
   625             if test x$have_loadso = xyes && \
   626                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
   626                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
   627                 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
   627                 CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
   628                 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
   628                 SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
   629                 AC_SUBST(x11_lib)
   629                 AC_SUBST(x11_lib)
   630                 AC_SUBST(x11ext_lib)
   630                 AC_SUBST(x11ext_lib)
  1129         video_opengl=yes
  1129         video_opengl=yes
  1130         ])
  1130         ])
  1131         AC_MSG_RESULT($video_opengl)
  1131         AC_MSG_RESULT($video_opengl)
  1132         if test x$video_opengl = xyes; then
  1132         if test x$video_opengl = xyes; then
  1133             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1133             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1134             if test x$use_dlopen != xyes; then
  1134             if test x$have_loadso != xyes; then
  1135                 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
  1135                 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
  1136             fi
  1136             fi
  1137         fi
  1137         fi
  1138     fi
  1138     fi
  1139 }
  1139 }
  1152         ])
  1152         ])
  1153         AC_MSG_RESULT($video_opengl)
  1153         AC_MSG_RESULT($video_opengl)
  1154         if test x$video_opengl = xyes; then
  1154         if test x$video_opengl = xyes; then
  1155             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1155             CFLAGS="$CFLAGS -DHAVE_OPENGL"
  1156             SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1156             SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
  1157             if test x$use_dlopen != xyes; then
  1157             if test x$have_loadso != xyes; then
  1158                 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
  1158                 AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
  1159             fi
  1159             fi
  1160         fi
  1160         fi
  1161     fi
  1161     fi
  1162 }
  1162 }
  1776     AC_ARG_ENABLE(sdl-dlopen,
  1776     AC_ARG_ENABLE(sdl-dlopen,
  1777 [  --enable-sdl-dlopen     use dlopen for shared object loading [default=yes]],
  1777 [  --enable-sdl-dlopen     use dlopen for shared object loading [default=yes]],
  1778                   , enable_sdl_dlopen=yes)
  1778                   , enable_sdl_dlopen=yes)
  1779     if test x$enable_sdl_dlopen = xyes; then
  1779     if test x$enable_sdl_dlopen = xyes; then
  1780         AC_MSG_CHECKING(for dlopen)
  1780         AC_MSG_CHECKING(for dlopen)
  1781         use_dlopen=no
  1781         have_loadso=no
  1782         AC_TRY_COMPILE([
  1782         AC_TRY_COMPILE([
  1783          #include <dlfcn.h>
  1783          #include <dlfcn.h>
  1784         ],[
  1784         ],[
  1785         ],[
  1785         ],[
  1786         use_dlopen=yes
  1786         have_loadso=yes
  1787         ])
  1787         ])
  1788         AC_MSG_RESULT($use_dlopen)
  1788         AC_MSG_RESULT($have_loadso)
  1789 
  1789 
  1790         if test x$use_dlopen = xyes; then
  1790         if test x$have_loadso = xyes; then
  1791             CFLAGS="$CFLAGS -DUSE_DLOPEN"
  1791             CFLAGS="$CFLAGS -DUSE_DLOPEN"
  1792             AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
  1792             AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
  1793                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
  1793                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
  1794                   AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
  1794                   AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
  1795         fi
  1795         fi
  1804                   , enable_atari_ldg=yes)
  1804                   , enable_atari_ldg=yes)
  1805     if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
  1805     if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
  1806         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
  1806         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
  1807         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
  1807         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
  1808         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
  1808         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
       
  1809             have_loadso=yes
  1809             CFLAGS="$CFLAGS -DENABLE_LDG"
  1810             CFLAGS="$CFLAGS -DENABLE_LDG"
  1810             SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
  1811             SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
  1811         fi
  1812         fi
  1812     fi
  1813     fi
  1813 }
  1814 }
  1987     AC_ARG_ENABLE(rpath,
  1988     AC_ARG_ENABLE(rpath,
  1988 [  --enable-rpath          use an rpath when linking SDL [default=yes]],
  1989 [  --enable-rpath          use an rpath when linking SDL [default=yes]],
  1989                   , enable_rpath=yes)
  1990                   , enable_rpath=yes)
  1990 }
  1991 }
  1991 
  1992 
       
  1993 have_loadso=no
  1992 case "$target" in
  1994 case "$target" in
  1993     arm-*-elf*)
  1995     arm-*-elf*)
  1994 	ARCH=linux
  1996 	ARCH=linux
  1995 	CheckDummyVideo
  1997 	CheckDummyVideo
  1996 	CheckIPod
  1998 	CheckIPod
  2558             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2560             COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
  2559         fi
  2561         fi
  2560         ;;
  2562         ;;
  2561     *-*-cygwin* | *-*-mingw32*)
  2563     *-*-cygwin* | *-*-mingw32*)
  2562         ARCH=win32
  2564         ARCH=win32
       
  2565         have_loadso=yes
  2563         if test "$build" != "$target"; then # cross-compiling
  2566         if test "$build" != "$target"; then # cross-compiling
  2564             # Default cross-compile location
  2567             # Default cross-compile location
  2565             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
  2568             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
  2566         else
  2569         else
  2567             # Look for the location of the tools and install there
  2570             # Look for the location of the tools and install there
  2623         esac
  2626         esac
  2624         ;;
  2627         ;;
  2625     *-*-beos*)
  2628     *-*-beos*)
  2626         ARCH=beos
  2629         ARCH=beos
  2627         ac_default_prefix=/boot/develop/tools/gnupro
  2630         ac_default_prefix=/boot/develop/tools/gnupro
       
  2631         have_loadso=yes
  2628         CheckDummyVideo
  2632         CheckDummyVideo
  2629         CheckDiskAudio
  2633         CheckDiskAudio
  2630         CheckNASM
  2634         CheckNASM
  2631         CheckBWINDOW
  2635         CheckBWINDOW
  2632         CheckBeGL
  2636         CheckBeGL
  2666     *-*-macos*)
  2670     *-*-macos*)
  2667         # This would be used if cross-compiling to MacOS 9.  No way to
  2671         # This would be used if cross-compiling to MacOS 9.  No way to
  2668         # use it at present, but Apple is working on a X-to-9 compiler
  2672         # use it at present, but Apple is working on a X-to-9 compiler
  2669         # for which this case would be handy.
  2673         # for which this case would be handy.
  2670         ARCH=macos
  2674         ARCH=macos
       
  2675         have_loadso=yes
  2671         CheckDummyVideo
  2676         CheckDummyVideo
  2672         CheckDiskAudio
  2677         CheckDiskAudio
  2673         CheckTOOLBOX
  2678         CheckTOOLBOX
  2674         CheckMacGL
  2679         CheckMacGL
  2675         # Set up files for the audio library
  2680         # Set up files for the audio library
  2709     *-*-darwin* )
  2714     *-*-darwin* )
  2710         # This could be either full "Mac OS X", or plain "Darwin" which is
  2715         # This could be either full "Mac OS X", or plain "Darwin" which is
  2711         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2716         # just the OS X kernel sans upper layers like Carbon and Cocoa.
  2712         # Next line is broken, and a few files below require Mac OS X (full)
  2717         # Next line is broken, and a few files below require Mac OS X (full)
  2713         ARCH=macosx
  2718         ARCH=macosx
       
  2719         have_loadso=yes
  2714         CheckDummyVideo
  2720         CheckDummyVideo
  2715         CheckDiskAudio
  2721         CheckDiskAudio
  2716         CheckCOCOA
  2722         CheckCOCOA
  2717         CheckCARBON
  2723         CheckCARBON
  2718         CheckMacX11
  2724         CheckMacX11