diff --git a/wxGTK3.spec b/wxGTK3.spec
index 51de0f4..4ebda81 100644
--- a/wxGTK3.spec
+++ b/wxGTK3.spec
@@ -179,6 +179,9 @@ This package provides XML documentation for the %{srcname} library.
 %autosetup -n %{srcname}-%{version} %{!?builddocs:-a 1} -p1
 %endif
 
+# Run autogen since we're patching configure.in
+./autogen.sh
+
 # patch some installed files to avoid conflicts with 2.8.*
 sed -i -e 's|aclocal)|aclocal/wxwin3.m4)|' Makefile.in
 sed -i -e 's|wxstd.mo|wxstd3.mo|' Makefile.in
@@ -208,7 +211,6 @@ make allmo
 popd
 %endif
 
-./autogen.sh
 %configure \
   --with-gtk=%{gtkver} \
   --with-opengl \