sim: bfin: drop old linux/mii.h workarounds
authorMike Frysinger <vapier@gentoo.org>
Sun, 4 Mar 2012 19:56:57 +0000 (19:56 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 4 Mar 2012 19:56:57 +0000 (19:56 +0000)
We had some workarounds for old linux/mii.h headers, but it breaks with
newer ones.  So tweak the checks a bit to work with newer ones.  We'll
worry about older systems once someone complains.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/bfin/ChangeLog
sim/bfin/config.in
sim/bfin/configure
sim/bfin/configure.ac
sim/bfin/dv-eth_phy.c

index 1376e6b..812c782 100644 (file)
@@ -1,3 +1,11 @@
+2012-02-04  Mike Frysinger  <vapier@gentoo.org>
+
+       * config.in: Regenerate.
+       * configure: Likewise.
+       * configure.ac: Add linux/types.h to AC_CHECK_HEADERS.
+       * dv-eth_phy.c: Check for HAVE_LINUX_TYPES_H, and delete __u16 and
+       _LINUX_TYPES_H defines.
+
 2011-12-03  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (bfin_syscall): Increase _tbuf storage.  Declare new local
index 2b25645..4175dad 100644 (file)
@@ -1,20 +1,5 @@
 /* config.in.  Generated from configure.ac by autoheader.  */
 
-/* Define to 1 if NLS is requested.  */
-#undef ENABLE_NLS
-
-/* Define as 1 if you have catgets and don't want to use GNU gettext.  */
-#undef HAVE_CATGETS
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext.  */
-#undef HAVE_GETTEXT
-
-/* Define as 1 if you have the stpcpy function.  */
-#undef HAVE_STPCPY
-
-/* Define if your locale.h file contains LC_MESSAGES.  */
-#undef HAVE_LC_MESSAGES
-
 /* Define if building universal (internal helper macro) */
 #undef AC_APPLE_UNIVERSAL_BUILD
 
@@ -58,6 +43,9 @@
 /* Define to 1 if you have the `kill' function. */
 #undef HAVE_KILL
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
@@ -70,6 +58,9 @@
 /* Define to 1 if you have the <linux/mii.h> header file. */
 #undef HAVE_LINUX_MII_H
 
+/* Define to 1 if you have the <linux/types.h> header file. */
+#undef HAVE_LINUX_TYPES_H
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
index a8c4639..fe1fc7c 100755 (executable)
@@ -2468,9 +2468,9 @@ sim_inline="-DDEFAULT_INLINE=0"
 # AC_PROG_CPP_WERROR
 
 # Test for GNAT.
-# We require the gnatbind program, and a compiler driver that
-# understands Ada.  We use the user's CC setting, already found,
-# and possibly add $1 to the command-line parameters.
+# We require the gnatbind & gnatmake programs, as well as a compiler driver
+# that understands Ada.  We use the user's CC setting, already found, and
+# possibly add $1 to the command-line parameters.
 #
 # Sets the shell variable have_gnat to yes or no as appropriate, and
 # substitutes GNATBIND and GNATMAKE.
@@ -5414,7 +5414,14 @@ _ACEOF
 fi
 done
 
-for ac_header in sys/ioctl.h sys/mman.h net/if.h linux/if_tun.h linux/mii.h
+for ac_header in  \
+       linux/if_tun.h \
+       linux/mii.h \
+       linux/types.h \
+       net/if.h \
+       sys/ioctl.h \
+       sys/mman.h \
+
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
index 1917c01..cda3ac9 100644 (file)
@@ -45,7 +45,14 @@ SIM_AC_OPTION_HARDWARE(yes,,\
 )
 
 AC_CHECK_FUNCS([getuid getgid geteuid getegid setuid setgid mmap munmap kill pread])
-AC_CHECK_HEADERS([sys/ioctl.h sys/mman.h net/if.h linux/if_tun.h linux/mii.h])
+AC_CHECK_HEADERS([ \
+       linux/if_tun.h \
+       linux/mii.h \
+       linux/types.h \
+       net/if.h \
+       sys/ioctl.h \
+       sys/mman.h \
+])
 
 BFIN_SIM_EXTRA_OBJS=
 
index f7d7172..e42b213 100644 (file)
 #include "sim-main.h"
 #include "devices.h"
 
-#ifdef HAVE_LINUX_MII_H
+#if defined (HAVE_LINUX_MII_H) && defined (HAVE_LINUX_TYPES_H)
 
 /* Workaround old/broken linux headers.  */
-#define _LINUX_TYPES_H
-#define __u16 unsigned short
+#include <linux/types.h>
 #include <linux/mii.h>
 
 #define REG_PHY_SIZE 0x20