diff -durN snes9x-1.54.1.orig/unix/configure.ac snes9x-1.54.1/unix/configure.ac --- snes9x-1.54.1.orig/unix/configure.ac 2016-10-15 02:20:34.000000000 +0200 +++ snes9x-1.54.1/unix/configure.ac 2017-02-04 18:52:33.297396407 +0100 @@ -55,50 +55,6 @@ # ***************************** # *** Execution begins here *** # ***************************** - -# Remove -g and -O2 flags manually. - -if test "x$CFLAGS" != "x"; then - CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-g//'`" - CFLAGS="`echo \"$CFLAGS\" | sed -e 's/-O2//'`" -fi - -if test "x$CXXFLAGS" != "x"; then - CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-g//'`" - CXXFLAGS="`echo \"$CXXFLAGS\" | sed -e 's/-O2//'`" -fi - -# Test what compiler flags we should use. - -AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--enable-debug], - [leave debug information in the final binary (default: no)])], - [], [enable_debug="no"]) - -if test "x$enable_debug" = "xyes"; then - AC_S9X_COMPILER_FLAG([-g], [g]) - AC_S9X_COMPILER_FLAG([-O0], [o0]) -else - AC_S9X_COMPILER_FLAG([-O3], [o3], [ - AC_S9X_COMPILER_FLAG([-O2], [o2], [ - AC_S9X_COMPILER_FLAG([-O1], [o1])])]) - AC_S9X_COMPILER_FLAG([-fomit-frame-pointer], [omit_frame_pointer]) -fi - -AC_ARG_ENABLE([mtune], - [AS_HELP_STRING([--enable-mtune], - [use the specified value for the -mtune/-mcpu flag (default: no)])], - [], [enable_mtune="no"]) - -if test "x$enable_mtune" != "xno"; then - AC_S9X_COMPILER_FLAG([-mtune="$enable_mtune"], [mtune], - [ - AC_MSG_WARN([-mtune failed, trying -mcpu...]) - AC_S9X_COMPILER_FLAG([-mcpu="$enable_mtune"], [mcpu], - [AC_MSG_ERROR([Please specify a working value for --enable-mtune.])]) - ]) -fi - AC_S9X_COMPILER_FLAG([-fno-exceptions], [no_exceptions]) AC_S9X_COMPILER_FLAG([-fno-rtti], [no_rtti]) AC_S9X_COMPILER_FLAG([-pedantic], [pedantic]) diff -durN snes9x-1.54.1.orig/unix/Makefile.in snes9x-1.54.1/unix/Makefile.in --- snes9x-1.54.1.orig/unix/Makefile.in 2016-10-15 02:20:34.000000000 +0200 +++ snes9x-1.54.1/unix/Makefile.in 2017-02-04 18:52:02.039108126 +0100 @@ -47,7 +47,7 @@ exit 1 snes9x: $(OBJECTS) - $(CCC) $(INCLUDES) -o $@ $(OBJECTS) -lm @S9XLIBS@ + $(CCC) $(LDFLAGS) $(INCLUDES) -o $@ $(OBJECTS) -lm @S9XLIBS@ ../jma/s9x-jma.o: ../jma/s9x-jma.cpp $(CCC) $(INCLUDES) -c $(CCFLAGS) -fexceptions $*.cpp -o $@