debug option check must be before warnings option check
diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4
index 5daf2df..0c125d9 100644
--- a/m4/curl-confopts.m4
+++ b/m4/curl-confopts.m4
@@ -22,7 +22,7 @@
 #***************************************************************************
 
 # File version for 'aclocal' use. Keep it a single number.
-# serial 1
+# serial 2
 
 
 dnl CURL_CHECK_OPTION_DEBUG
@@ -32,7 +32,7 @@
 dnl variable want_debug value as appropriate.
 
 AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
-  AC_BEFORE([$0],[CURL_CHECK_OPTION_DEBUG])dnl
+  AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl
   AC_BEFORE([$0],[AC_PROG_CC])dnl
   AC_MSG_CHECKING([whether to enable debug build options])
   OPT_DEBUG_BUILD="default"