diff --git a/zsnes/src/Makefile.in b/zsnes/src/Makefile.in index da62e2ad..f11d4d56 100644 --- a/zsnes/src/Makefile.in +++ b/zsnes/src/Makefile.in @@ -59,29 +59,21 @@ MAINOBJ=cfgload.o endmem.o fixsin.o init.o ui.o vcache.o water.o OBJS=${CHIPSOBJ} ${CPUOBJ} ${WINOBJ} ${WINDOSOBJ} ${GUIOBJ} ${VIDEOBJ} ${ZIPOBJ} ${MAINOBJ} -CFLAGS=@CFLAGS@ -ASM=@NASMPATH@ -ASMFLAGS=@NASMD@ -LIBS=@LIBS@ -CC=@CC@ -INSTALL=@INSTALL@ -prefix=@prefix@ - .SUFFIXES: .c .cpp .asm %.o: %.c - ${CC} ${CFLAGS} -o $@ -c $< + @CC@ @CFLAGS@ -o $@ -c $< %.o: %.cpp - ${PP} ${CFLAGS} -o $@ -c $< + @CPP@ @CFLAGS@ -o $@ -c $< %.o: %.asm - ${ASM} ${ASMFLAGS} -o $@ $< + @NASMPATH@ @NFLAGS@ -o $@ $< ALL: @ZSNESEXE@ @ZSNESEXE@: ${OBJS} - ${CC} -o @ZSNESEXE@ ${OBJS} ${LIBS} + @CC@ -o @ZSNESEXE@ ${OBJS} @CFLAGS@ @LDFLAGS@ ${ZIPDIR}/zpng.o: ${ZIPDIR}/zpng.c ${ZIPDIR}/zpng.h ${ZIPDIR}/unzip.o: ${ZIPDIR}/unzip.c ${ZIPDIR}/unzip.h @@ -179,8 +171,8 @@ endmem.o: endmem.asm macros.mac ${DOSDIR}/modemrtn.o: ${DOSDIR}/modemrtn.asm macros.mac install: - @INSTALL@ -m 0755 @ZSNESEXE@ ${prefix}/bin - @INSTALL@ -m 0644 linux/zsnes.man ${prefix}/man + @INSTALL@ -m 0755 @ZSNESEXE@ @prefix@/bin + @INSTALL@ -m 0644 linux/zsnes.man @prefix@/man clean: rm -f ${CHIPDIR}/*.o ${CPUDIR}/*.o ${VIDEODIR}/*.o ${GUIDIR}/*.o ${DOSDIR}/*.o ${WINDIR}/*.o ${ZIPDIR}/*.o *.o @ZSNESEXE@ diff --git a/zsnes/src/chips/dsp1emu.c b/zsnes/src/chips/dsp1emu.c index 5653ee8b..36e049be 100644 --- a/zsnes/src/chips/dsp1emu.c +++ b/zsnes/src/chips/dsp1emu.c @@ -16,11 +16,15 @@ //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#ifdef __LINUX__ +#include <../gblhdr.h> +#else #include #include #include #include #include +#endif //#define DebugDSP1 // uncomment some lines to test diff --git a/zsnes/src/configure b/zsnes/src/configure index 521329e0..70e245b2 100755 --- a/zsnes/src/configure +++ b/zsnes/src/configure @@ -25,14 +25,6 @@ ac_help="$ac_help --without-png Build without PNG screenshot support " ac_help="$ac_help --enable-debug Build GDB Friendly binary (zsnes-debug) " -ac_help="$ac_help - --enable-force-386 Force 386 Optimization" -ac_help="$ac_help - --enable-force-486 Force 486 Optimization" -ac_help="$ac_help - --enable-force-586 Force Pentium Optimization" -ac_help="$ac_help - --enable-force-686 Force PPro/P2 Optimization" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -544,11 +536,11 @@ fi echo -- Where is our compiler, and who are we compiling for? -CFLAGS="-pipe" +CFLAGS="-pipe -I." # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:552: checking for $ac_word" >&5 +echo "configure:544: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -578,7 +570,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:582: checking for $ac_word" >&5 +echo "configure:574: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -629,7 +621,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:633: checking for $ac_word" >&5 +echo "configure:625: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -661,7 +653,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:665: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:657: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -672,12 +664,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 676 "configure" +#line 668 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -703,12 +695,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:707: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:699: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:712: checking whether we are using GNU C" >&5 +echo "configure:704: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -717,7 +709,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -736,7 +728,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:740: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:732: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -770,7 +762,7 @@ fi # Extract the first word of "nasm", so it can be a program name with args. set dummy nasm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:774: checking for $ac_word" >&5 +echo "configure:766: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_NASMPATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -803,7 +795,7 @@ else echo "$ac_t""no" 1>&6 fi -NASMD="$NASMD -w-orphan-labels" +NFLAGS="$NFLAGS -w-orphan-labels" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -835,7 +827,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:839: checking for a BSD compatible install" >&5 +echo "configure:831: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -915,7 +907,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:919: checking host system type" >&5 +echo "configure:911: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -936,7 +928,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:940: checking target system type" >&5 +echo "configure:932: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -954,7 +946,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:958: checking build system type" >&5 +echo "configure:950: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -977,16 +969,21 @@ test "$host_alias" != "$target_alias" && program_prefix=${target_alias}- case "$target" in - *-*-linux* | *-*-*bsd*) + *-*-linux*) CFLAGS="$CFLAGS -D__LINUX__" - NASMD="$NASMD -D__LINUX__ -f elf" + NFLAGS="$NFLAGS -D__LINUX__ -f elf" + ;; + *-*-*bsd*) + CFLAGS="$CFLAGS -D__LINUX__ -D__FreeBSD__" + NFLAGS="$NFLAGS -D__LINUX__ -D__FreeBSD__ -f elf" ;; *-*-cygwin* | *-*-*ming*) CFLAGS="$CFLAGS -D__LINUX__" - NASMD="$NASMD -D__LINUX__ -f win32" + NFLAGS="$NFLAGS -D__LINUX__ -f win32" ZSNESEXE=".exe" ;; *) + { echo "configure: error: This Target is Not Supported" 1>&2; exit 1; } ;; esac @@ -994,7 +991,7 @@ esac echo -- Do we have X, and where is it? Needed for Mesa Checking echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:998: checking how to run the C preprocessor" >&5 +echo "configure:995: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1009,13 +1006,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1026,13 +1023,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1043,13 +1040,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1078,7 +1075,7 @@ echo "$ac_t""$CPP" 1>&6 # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1082: checking for X" >&5 +echo "configure:1079: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1140,12 +1137,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1214,14 +1211,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -1308,7 +1305,7 @@ else fi CFLAGS="$CFLAGS -I$x_includes" -LIBS="$LIBS -L$x_libraries" +LDFLAGS="$LDFLAGS -L$x_libraries" echo -- Where is libSDL and zlib, and do we want/have libPNG and OpenGL support? @@ -1354,7 +1351,7 @@ fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1358: checking for $ac_word" >&5 +echo "configure:1355: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1389,7 +1386,7 @@ fi min_sdl_version=1.2.0 echo $ac_n "checking for SDL - version >= $min_sdl_version""... $ac_c" 1>&6 -echo "configure:1393: checking for SDL - version >= $min_sdl_version" >&5 +echo "configure:1390: checking for SDL - version >= $min_sdl_version" >&5 no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes @@ -1413,7 +1410,7 @@ echo "configure:1393: checking for SDL - version >= $min_sdl_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -1474,7 +1471,7 @@ int main (int argc, char *argv[]) EOF -if { (eval echo configure:1478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1508,7 +1505,7 @@ fi CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" cat > conftest.$ac_ext < @@ -1523,7 +1520,7 @@ int main() { return 0; ; return 0; } EOF -if { (eval echo configure:1527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" @@ -1557,13 +1554,13 @@ rm -f conftest* rm -f conf.sdltest CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS $SDL_LIBS" +LDFLAGS="$LDFLAGS $SDL_LIBS" echo $ac_n "checking for zlib""... $ac_c" 1>&6 -echo "configure:1564: checking for zlib" >&5 +echo "configure:1561: checking for zlib" >&5 with_zlib=no cat > conftest.$ac_ext < @@ -1574,7 +1571,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* with_zlib=yes @@ -1586,7 +1583,7 @@ fi rm -f conftest* if test x$with_zlib = xyes; then - LIBS="$LIBS -lz" + LDFLAGS="$LDFLAGS -lz" echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 @@ -1600,11 +1597,11 @@ if test "${with_opengl+set}" = set; then fi echo $ac_n "checking for OpenGL support""... $ac_c" 1>&6 -echo "configure:1604: checking for OpenGL support" >&5 +echo "configure:1601: checking for OpenGL support" >&5 if test x$with_opengl != xno; then with_opengl=no cat > conftest.$ac_ext < @@ -1615,7 +1612,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* with_opengl=yes @@ -1627,9 +1624,9 @@ fi rm -f conftest* echo "$ac_t""$with_opengl" 1>&6 if test x$with_opengl = xyes; then - LIBS="$LIBS -lGL" + LDFLAGS="$LDFLAGS -lGL" CFLAGS="$CFLAGS -D__OPENGL__" - NASMD="$NASMD -D__OPENGL__" + NFLAGS="$NFLAGS -D__OPENGL__" GL_DRAW="\${WINDIR}/gl_draw.o" fi else @@ -1643,11 +1640,11 @@ if test "${enable_png+set}" = set; then fi echo $ac_n "checking for libPNG support""... $ac_c" 1>&6 -echo "configure:1647: checking for libPNG support" >&5 +echo "configure:1644: checking for libPNG support" >&5 if test x$with_png != xno; then with_png=no cat > conftest.$ac_ext < @@ -1658,7 +1655,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* with_png=yes @@ -1670,7 +1667,7 @@ fi rm -f conftest* echo "$ac_t""$with_png" 1>&6 if test x$with_png = xyes; then - LIBS="$LIBS -lpng" + LDFLAGS="$LDFLAGS -lpng" fi else echo "$ac_t""disabled by user" 1>&6 @@ -1684,88 +1681,44 @@ if test "${enable_debug+set}" = set; then fi echo $ac_n "checking if you want gdb friendly executable""... $ac_c" 1>&6 -echo "configure:1688: checking if you want gdb friendly executable" >&5 +echo "configure:1685: checking if you want gdb friendly executable" >&5 if test x$debug = xyes; then echo "$ac_t""yes" 1>&6 CFLAGS="$CFLAGS -Wall -O0 -fno-omit-frame-pointer -ggdb3" - NASMD="$NASMD -g -s" + NFLAGS="$NFLAGS -g -s" ZSNESEXE="zsnes-debug$ZSNESEXE" else echo "$ac_t""no" 1>&6 - CFLAGS="$CFLAGS -s -Os -ffast-math -fomit-frame-pointer -fschedule-insns2" + CFLAGS="$CFLAGS -Os -ffast-math -fomit-frame-pointer -fschedule-insns2 -s" ZSNESEXE="zsnes$ZSNESEXE" fi -# Check whether --enable-force-386 or --disable-force-386 was given. -if test "${enable_force_386+set}" = set; then - enableval="$enable_force_386" - wantforce=386 -fi - -# Check whether --enable-force-486 or --disable-force-486 was given. -if test "${enable_force_486+set}" = set; then - enableval="$enable_force_486" - wantforce=486 -fi - -# Check whether --enable-force-586 or --disable-force-586 was given. -if test "${enable_force_586+set}" = set; then - enableval="$enable_force_586" - wantforce=586 -fi - -# Check whether --enable-force-686 or --disable-force-686 was given. -if test "${enable_force_686+set}" = set; then - enableval="$enable_force_686" - wantforce=668 -fi - - echo $ac_n "checking which processor class to optimize for""... $ac_c" 1>&6 -echo "configure:1730: checking which processor class to optimize for" >&5 +echo "configure:1702: checking which processor class to optimize for" >&5 if test x$debug != xyes; then - case "$wantforce" in - 386) - echo "$ac_t""forced to 386" 1>&6 - CFLAGS="$CFLAGS -march=i386" - ;; - 486) - echo "$ac_t""forced to 486" 1>&6 - CFLAGS="$CFLAGS -march=i486" - ;; - 586) - echo "$ac_t""forced to Pentium" 1>&6 - CFLAGS="$CFLAGS -march=pentium" - ;; - 686) - echo "$ac_t""forced to PPro/P2" 1>&6 - CFLAGS="$CFLAGS -march=pentiumpro" - ;; - *) case "$target" in i486-*-*) CFLAGS="$CFLAGS -march=i486" - echo "$ac_t""detected 486" 1>&6 + echo "$ac_t""486" 1>&6 ;; i586-*-*) CFLAGS="$CFLAGS -march=pentium" - echo "$ac_t""detected Pentium" 1>&6 + echo "$ac_t""Pentium" 1>&6 ;; i686-*-*) CFLAGS="$CFLAGS -march=pentiumpro" - echo "$ac_t""detected PPro/P2" 1>&6 + echo "$ac_t""PPro/P2" 1>&6 ;; *) - echo "$ac_t""detected 386" 1>&6 - echo "configure: warning: *** This is probably not what you want use --enable-force-486/586/686" 1>&2 + echo "$ac_t""386" 1>&6 + echo "configure: warning: *** This is probably not what you want use --target" 1>&2 ;; esac - ;; - esac + else echo "$ac_t""no optimization because debug enabled" 1>&6 fi @@ -1775,12 +1728,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1779: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1732: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1788,7 +1741,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1813,7 +1766,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1817: checking for opendir in -ldir" >&5 +echo "configure:1770: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1821,7 +1774,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1854,7 +1807,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1858: checking for opendir in -lx" >&5 +echo "configure:1811: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1862,7 +1815,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1896,12 +1849,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1900: checking for ANSI C header files" >&5 +echo "configure:1853: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1909,7 +1862,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1926,7 +1879,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1944,7 +1897,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1965,7 +1918,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1976,7 +1929,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1999,21 +1952,21 @@ EOF fi -for ac_hdr in fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h +for ac_hdr in fcntl.h limits.h malloc.h sys/ioctl.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2007: checking for $ac_hdr" >&5 +echo "configure:1960: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2041,12 +1994,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2045: checking for working const" >&5 +echo "configure:1998: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2116,12 +2069,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2120: checking for size_t" >&5 +echo "configure:2073: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2149,12 +2102,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2153: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2106: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2163,7 +2116,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2183,239 +2136,39 @@ EOF fi -echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2188: checking whether struct tm is in sys/time.h or time.h" >&5 -if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -int main() { -struct tm *tp; tp->tm_sec; -; return 0; } -EOF -if { (eval echo configure:2201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_struct_tm=time.h -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_struct_tm=sys/time.h -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_struct_tm" 1>&6 -if test $ac_cv_struct_tm = sys/time.h; then - cat >> confdefs.h <<\EOF -#define TM_IN_SYS_TIME 1 -EOF - -fi - - -echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 -echo "configure:2223: checking whether utime accepts a null argument" >&5 -if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata; > conftestdata -# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. -if test "$cross_compiling" = yes; then - ac_cv_func_utime_null=no -else - cat > conftest.$ac_ext < -#include -main() { -struct stat s, t; -exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 -&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime -&& t.st_mtime - s.st_mtime < 120)); -} -EOF -if { (eval echo configure:2244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_func_utime_null=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_utime_null=no -fi -rm -fr conftest* -fi - -rm -f core core.* *.core -fi - -echo "$ac_t""$ac_cv_func_utime_null" 1>&6 -if test $ac_cv_func_utime_null = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_UTIME_NULL 1 -EOF - -fi - -echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2268: checking for vprintf" >&5 -if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* 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 vprintf(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_vprintf) || defined (__stub___vprintf) -choke me -#else -vprintf(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_vprintf=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_vprintf=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_VPRINTF 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -if test "$ac_cv_func_vprintf" != yes; then -echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2320: checking for _doprnt" >&5 -if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* 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 _doprnt(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -_doprnt(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func__doprnt=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func__doprnt=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_DOPRNT 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -fi - -for ac_func in getcwd gethostname mkdir mktime rmdir select socket +for ac_hdr in sys/time.h do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2375: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2144: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -/* 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 $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } +#include <$ac_hdr> EOF -if { (eval echo configure:2403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <= 1.2.0 is required)]) CFLAGS="$CFLAGS $SDL_CFLAGS" -LIBS="$LIBS $SDL_LIBS" +LDFLAGS="$LDFLAGS $SDL_LIBS" AC_MSG_CHECKING(for zlib) with_zlib=no @@ -62,7 +67,7 @@ with_zlib=yes ]) if test x$with_zlib = xyes; then - LIBS="$LIBS -lz" + LDFLAGS="$LDFLAGS -lz" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -82,9 +87,9 @@ if test x$with_opengl != xno; then ]) AC_MSG_RESULT($with_opengl) if test x$with_opengl = xyes; then - LIBS="$LIBS -lGL" + LDFLAGS="$LDFLAGS -lGL" CFLAGS="$CFLAGS -D__OPENGL__" - NASMD="$NASMD -D__OPENGL__" + NFLAGS="$NFLAGS -D__OPENGL__" GL_DRAW="\${WINDIR}/gl_draw.o" fi else @@ -104,7 +109,7 @@ if test x$with_png != xno; then ]) AC_MSG_RESULT($with_png) if test x$with_png = xyes; then - LIBS="$LIBS -lpng" + LDFLAGS="$LDFLAGS -lpng" fi else AC_MSG_RESULT(disabled by user) @@ -120,7 +125,7 @@ if test x$debug = xyes; then dnl enabled. CFLAGS="$CFLAGS -Wall -O0 -fno-omit-frame-pointer -ggdb3" - NASMD="$NASMD -g -s" + NFLAGS="$NFLAGS -g -s" ZSNESEXE="zsnes-debug$ZSNESEXE" else AC_MSG_RESULT(no) @@ -130,55 +135,31 @@ else dnl zsnes more easily deal with small instruction caches, and more dnl effectivly use branch prediction. - CFLAGS="$CFLAGS -s -Os -ffast-math -fomit-frame-pointer -fschedule-insns2" + CFLAGS="$CFLAGS -Os -ffast-math -fomit-frame-pointer -fschedule-insns2 -s" ZSNESEXE="zsnes$ZSNESEXE" fi -AC_ARG_ENABLE(force-386,[ --enable-force-386 Force 386 Optimization],wantforce=386) -AC_ARG_ENABLE(force-486,[ --enable-force-486 Force 486 Optimization],wantforce=486) -AC_ARG_ENABLE(force-586,[ --enable-force-586 Force Pentium Optimization],wantforce=586) -AC_ARG_ENABLE(force-686,[ --enable-force-686 Force PPro/P2 Optimization],wantforce=668) - AC_MSG_CHECKING(which processor class to optimize for) if test x$debug != xyes; then - case "$wantforce" in - 386) - AC_MSG_RESULT(forced to 386) - CFLAGS="$CFLAGS -march=i386" - ;; - 486) - AC_MSG_RESULT(forced to 486) - CFLAGS="$CFLAGS -march=i486" - ;; - 586) - AC_MSG_RESULT(forced to Pentium) - CFLAGS="$CFLAGS -march=pentium" - ;; - 686) - AC_MSG_RESULT(forced to PPro/P2) - CFLAGS="$CFLAGS -march=pentiumpro" - ;; - *) case "$target" in i486-*-*) CFLAGS="$CFLAGS -march=i486" - AC_MSG_RESULT(detected 486) + AC_MSG_RESULT(486) ;; i586-*-*) CFLAGS="$CFLAGS -march=pentium" - AC_MSG_RESULT(detected Pentium) + AC_MSG_RESULT(Pentium) ;; i686-*-*) CFLAGS="$CFLAGS -march=pentiumpro" - AC_MSG_RESULT(detected PPro/P2) + AC_MSG_RESULT(PPro/P2) ;; *) - AC_MSG_RESULT(detected 386) - AC_MSG_WARN(*** This is probably not what you want use --enable-force-486/586/686) + AC_MSG_RESULT(386) + AC_MSG_WARN(*** This is probably not what you want use --target) ;; esac - ;; - esac + else AC_MSG_RESULT(no optimization because debug enabled) fi @@ -186,22 +167,18 @@ fi dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h) +AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME -AC_STRUCT_TM +AC_CHECK_HEADERS(sys/time.h) dnl Checks for library functions. -AC_FUNC_UTIME_NULL -AC_FUNC_VPRINTF -AC_CHECK_FUNCS(getcwd gethostname mkdir mktime rmdir select socket) -AC_SUBST(LIBS) -AC_SUBST(NASMD) AC_SUBST(ZSNESEXE) AC_SUBST(GL_DRAW) +AC_SUBST(NFLAGS) AC_OUTPUT(Makefile) echo echo You may now type gmake to compile $ZSNESEXE diff --git a/zsnes/src/water.c b/zsnes/src/water.c index a0800b07..93a336cc 100644 --- a/zsnes/src/water.c +++ b/zsnes/src/water.c @@ -16,11 +16,15 @@ //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#ifdef __LINUX__ +#include <../gblhdr.h> +#else #include #include #include #include #include +#endif #include "fixsin.h" diff --git a/zsnes/src/zip/zzip.c b/zsnes/src/zip/zzip.c index da3161ad..2e867b98 100644 --- a/zsnes/src/zip/zzip.c +++ b/zsnes/src/zip/zzip.c @@ -16,18 +16,16 @@ //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#ifdef __LINUX__ +#include <../gblhdr.h> +#else #include #include #include #include -#ifdef __LINUX__ -#include -#include -#include -#include -#endif #include #include +#endif #include "unzip.h"