Skip to content

Commit

Permalink
Complete compilation for Linux 2.6.38.
Browse files Browse the repository at this point in the history
- Improve fixincludes.pl for 2.6.38 constructs.
- Detect need for AUTOCONF_INCLUDED.

Includes some small modifications to Joonwoo's earlier patches, and a
version of his unlocked_ioctl patch.

Signed-off-by: Eddie Kohler <[email protected]>
  • Loading branch information
kohler committed Jun 12, 2011
1 parent 440457f commit 0f6dae9
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 107 deletions.
5 changes: 4 additions & 1 deletion config-linuxmodule.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
fairly with the kernel. */
#undef HAVE_ADAPTIVE_SCHEDULER

/* Define if the AUTOCONF_INCLUDED symbol should be checked. */
#undef HAVE_CHECK_AUTOCONF_INCLUDED

/* Define if your Linux kernel has Click extensions. */
#undef HAVE_CLICK_KERNEL

Expand Down Expand Up @@ -167,7 +170,7 @@
#define MODULE 1

/* Include Linux configuration and type definitions. */
#ifndef AUTOCONF_INCLUDED
#if HAVE_CHECK_AUTOCONF_INCLUDED && !defined(AUTOCONF_INCLUDED)
# include <linux/autoconf.h>
#endif
#include <linux/version.h>
Expand Down
126 changes: 51 additions & 75 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -8885,24 +8885,32 @@ fi

if test $ac_have_linux_kernel = y; then

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux 2.6" >&5
$as_echo_n "checking for Linux 2.6... " >&6; }
if ${ac_cv_linux26+:} false; then :
$as_echo_n "(cached) " >&6
else
if grep '^PATCHLEVEL *= *6' `find_linuxpath Makefile` >/dev/null 2>&1; then ac_cv_linux26=yes; else ac_cv_linux26=no; fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux version" >&5
$as_echo_n "checking Linux version... " >&6; }
linuxpath_makefile=`find_linuxpath Makefile`
linux_version=`grep '^VERSION[ ]*=[ ]*[0-9][0-9]*[ ]*$' "$linuxpath_makefile" | tr -c -d 0-9`
linux_patchlevel=`grep '^PATCHLEVEL[ ]*=[ ]*[0-9][0-9]*[ ]*$' "$linuxpath_makefile" | tr -c -d 0-9`
linux_sublevel=`grep '^SUBLEVEL[ ]*=[ ]*[0-9][0-9]*[ ]*$' "$linuxpath_makefile" | tr -c -d 0-9`
if test -n "$linux_version" -a -n "$linux_patchlevel" -a -z "$linux_sublevel"; then linux_sublevel=0; fi
if test -n "$linux_version" -a -n "$linux_patchlevel" -a -n "$linux_sublevel"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $linux_version.$linux_patchlevel.$linux_sublevel" >&5
$as_echo "$linux_version.$linux_patchlevel.$linux_sublevel" >&6; }
linux_version_code=`expr $linux_version '*' 65536 + $linux_patchlevel '*' 256 + $linux_sublevel`
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
$as_echo "unknown" >&6; }
linux_version_code=0
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_linux26" >&5
$as_echo "$ac_cv_linux26" >&6; }
LINUXMODULE_2_6=0
if test "$ac_cv_linux26" = yes; then LINUXMODULE_2_6=1; fi

if test $LINUXMODULE_2_6 = 1; then
LINUXMODULE_2_6=0
if test "$linux_version.$linux_patchlevel" = 2.6; then
LINUXMODULE_2_6=1

$as_echo "#define HAVE_LINUXMODULE_2_6 1" >>confdefs.h

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Click Linux kernel extensions" >&5
$as_echo_n "checking for Click Linux kernel extensions... " >&6; }
if ${ac_cv_click_kernel+:} false; then :
Expand Down Expand Up @@ -9001,7 +9009,7 @@ fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for files_lglock kernel symbol" >&5
$as_echo_n "checking for files_lglock kernel symbol... " >&6; }
if test "${ac_cv_linux_files_lglock+set}" = set; then :
if ${ac_cv_linux_files_lglock+:} false; then :
$as_echo_n "(cached) " >&6
else
if grep "__ksymtab_files_lglock" $linux_system_map >/dev/null 2>&1; then
Expand Down Expand Up @@ -10210,6 +10218,16 @@ fixincludes.pl execution failed.


# CLICK_LINUXMODULE_PROLOGUE()
linux_autoconf_include=
if test "$linux_version_code" -lt 132638; then

$as_echo "#define HAVE_CHECK_AUTOCONF_INCLUDED 1" >>confdefs.h

linux_autoconf_include="#if !defined(AUTOCONF_INCLUDED)
# include <linux/autoconf.h>
#endif
"
fi



Expand Down Expand Up @@ -10244,9 +10262,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/signal.h>
#include <linux/skbuff.h>
Expand Down Expand Up @@ -10295,9 +10311,7 @@ else
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/types.h>
void f1(long) {
Expand Down Expand Up @@ -10353,9 +10367,7 @@ else
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/types.h>
void f1(long long) {
Expand Down Expand Up @@ -10411,9 +10423,7 @@ else
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/types.h>
Expand Down Expand Up @@ -10472,9 +10482,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
int
Expand Down Expand Up @@ -10531,9 +10539,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
int
Expand Down Expand Up @@ -10590,9 +10596,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
int
Expand Down Expand Up @@ -10649,9 +10653,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
int
Expand Down Expand Up @@ -10708,9 +10710,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
int
Expand Down Expand Up @@ -10767,9 +10767,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
int
Expand Down Expand Up @@ -10826,9 +10824,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/netdevice.h>
int
Expand Down Expand Up @@ -10872,9 +10868,7 @@ $as_echo "#define HAVE_LINUX_POLLING 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <net/dst.h>
"
Expand Down Expand Up @@ -10908,9 +10902,7 @@ $as_echo "#define HAVE_SKB_DST_DROP 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
"
Expand Down Expand Up @@ -10944,9 +10936,7 @@ $as_echo "#define HAVE_SKB_RECYCLE 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
"
Expand Down Expand Up @@ -10993,9 +10983,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/netdevice.h>
int
Expand Down Expand Up @@ -11045,9 +11033,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
Expand Down Expand Up @@ -11082,9 +11068,7 @@ $as_echo "#define HAVE_NET_ENABLE_TIMESTAMP 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
Expand Down Expand Up @@ -11119,9 +11103,7 @@ $as_echo "#define HAVE_NETIF_TX_LOCK 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
Expand Down Expand Up @@ -11156,9 +11138,7 @@ $as_echo "#define HAVE_NETDEV_GET_TX_QUEUE 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
Expand Down Expand Up @@ -11193,9 +11173,7 @@ $as_echo "#define HAVE_NETIF_TX_QUEUE_FROZEN 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
Expand Down Expand Up @@ -11230,9 +11208,7 @@ $as_echo "#define HAVE_NETDEV_USES_DSA_TAGS 1" >>confdefs.h
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
Expand Down
34 changes: 26 additions & 8 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -637,14 +637,26 @@ dnl Check for Linux 2.6

if test $ac_have_linux_kernel = y; then

AC_CACHE_CHECK([for Linux 2.6], [ac_cv_linux26],
[if grep '^PATCHLEVEL[ ]*=[ ]*6' `find_linuxpath Makefile` >/dev/null 2>&1; then ac_cv_linux26=yes; else ac_cv_linux26=no; fi])
AC_MSG_CHECKING([Linux version])
linuxpath_makefile=`find_linuxpath Makefile`
linux_version=`grep '^VERSION[[ ]]*=[[ ]]*[[0-9]][[0-9]]*[[ ]]*$' "$linuxpath_makefile" | tr -c -d 0-9`
linux_patchlevel=`grep '^PATCHLEVEL[[ ]]*=[[ ]]*[[0-9]][[0-9]]*[[ ]]*$' "$linuxpath_makefile" | tr -c -d 0-9`
linux_sublevel=`grep '^SUBLEVEL[[ ]]*=[[ ]]*[[0-9]][[0-9]]*[[ ]]*$' "$linuxpath_makefile" | tr -c -d 0-9`
if test -n "$linux_version" -a -n "$linux_patchlevel" -a -z "$linux_sublevel"; then linux_sublevel=0; fi
if test -n "$linux_version" -a -n "$linux_patchlevel" -a -n "$linux_sublevel"; then
AC_MSG_RESULT([$linux_version.$linux_patchlevel.$linux_sublevel])
linux_version_code=`expr $linux_version '*' 65536 + $linux_patchlevel '*' 256 + $linux_sublevel`
else
AC_MSG_RESULT([unknown])
linux_version_code=0
fi

LINUXMODULE_2_6=0
if test "$ac_cv_linux26" = yes; then LINUXMODULE_2_6=1; fi
AC_SUBST(LINUXMODULE_2_6)
if test $LINUXMODULE_2_6 = 1; then
if test "$linux_version.$linux_patchlevel" = 2.6; then
LINUXMODULE_2_6=1
AC_DEFINE([HAVE_LINUXMODULE_2_6], [1], [Define if the Click linuxmodule is compiled for a 2.6 kernel.])
fi
AC_SUBST(LINUXMODULE_2_6)

AC_CACHE_CHECK(for Click Linux kernel extensions, ac_cv_click_kernel,
[if grep "register_net_in" $linux_system_map >/dev/null 2>&1; then
Expand Down Expand Up @@ -1221,6 +1233,14 @@ fixincludes.pl execution failed.


# CLICK_LINUXMODULE_PROLOGUE()
linux_autoconf_include=
if test "$linux_version_code" -lt 132638; then
AC_DEFINE([HAVE_CHECK_AUTOCONF_INCLUDED], [1], [Define if the AUTOCONF_INCLUDED symbol should be checked.])
linux_autoconf_include="#if !defined(AUTOCONF_INCLUDED)
# include <linux/autoconf.h>
#endif
"
fi
AC_DEFUN([CLICK_LINUXMODULE_PROLOGUE], [[#if HAVE_LINUXMODULE_2_6
# define KBUILD_STR(s) #s
# define KBUILD_BASENAME KBUILD_STR(click)
Expand All @@ -1239,9 +1259,7 @@ fixincludes.pl execution failed.
#define false linux_false
#define true linux_true
#define CLICK_CXX_PROTECTED 1
#ifndef AUTOCONF_INCLUDED
# include <linux/autoconf.h>
#endif
$linux_autoconf_include
#include <asm/types.h>]])


Expand Down
Loading

0 comments on commit 0f6dae9

Please sign in to comment.