Set OPT to -g -O2 (or -O2 when -g not supported) when using gcc.
diff --git a/configure.in b/configure.in
index f2510ce..e91199b 100644
--- a/configure.in
+++ b/configure.in
@@ -98,7 +98,13 @@
 AC_SUBST(OPT)
 if test -z "$OPT"
 then
-	case $ac_sys_system in
+	case $GCC in
+	yes)
+		case $ac_cv_prog_cc_g in
+		yes)	OPT="-g -O2";;
+		*)	OPT="-O2";;
+		esac
+		;;
 	*)	OPT="-O";;
 	esac
 fi