diff --git a/libcpu/i386_lex.l b/libcpu/i386_lex.l
index 9b33ed95..9c1e14db 100644
--- a/libcpu/i386_lex.l
+++ b/libcpu/i386_lex.l
@@ -1,3 +1,9 @@
+%top{
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+}
+
 %{
 /* Copyright (C) 2004, 2005, 2007, 2008 Red Hat, Inc.
    Written by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -26,10 +32,6 @@
    the GNU Lesser General Public License along with this program.  If
    not, see <http://www.gnu.org/licenses/>.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
 #include <ctype.h>
 
 #include <libeu.h>
