configure.ac
branchstable-1.3
changeset 1744 7bc131b92039
parent 1740 fa0af75bfbe9
child 1745 07fd94c5119d
equal deleted inserted replaced
1743:1a7067207637 1744:7bc131b92039
     1 #------------------------------------------------------------------------------
     1 #------------------------------------------------------------------------------
     2 # $Id$
     2 # $Id$
     3 #------------------------------------------------------------------------------
     3 #------------------------------------------------------------------------------
     4 
     4 
     5 AC_PREREQ(2.59)
     5 AC_PREREQ(2.59)
     6 AC_INIT([ethercat],[1.2.0],[fp@igh-essen.com])
     6 AC_INIT([ethercat],[1.3.0],[fp@igh-essen.com])
     7 AC_CONFIG_AUX_DIR([autoconf])
     7 AC_CONFIG_AUX_DIR([autoconf])
     8 AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2])
     8 AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2])
     9 AC_PREFIX_DEFAULT([/opt/etherlab])
     9 AC_PREFIX_DEFAULT([/opt/etherlab])
    10 AC_CONFIG_HEADERS([config.h])
    10 AC_CONFIG_HEADERS([config.h])
    11 AC_CONFIG_SRCDIR([config.h.in])
    11 AC_CONFIG_SRCDIR([config.h.in])
    75 AC_SUBST(LINUX_KERNEL_VERSION,[$linuxversion])
    75 AC_SUBST(LINUX_KERNEL_VERSION,[$linuxversion])
    76 AC_SUBST(LINUX_MOD_PATH,[/lib/modules/$kernelrelease/ethercat])
    76 AC_SUBST(LINUX_MOD_PATH,[/lib/modules/$kernelrelease/ethercat])
    77 AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $LINUX_KERNEL_RELEASE)])
    77 AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $LINUX_KERNEL_RELEASE)])
    78 
    78 
    79 #------------------------------------------------------------------------------
    79 #------------------------------------------------------------------------------
    80 # 8139too Kernel
    80 # 8139too driver
    81 #------------------------------------------------------------------------------
    81 #------------------------------------------------------------------------------
       
    82 
       
    83 AC_ARG_ENABLE([8139too],
       
    84     AS_HELP_STRING([--enable-8139too],
       
    85                    [Enable 8139too driver]),
       
    86     [
       
    87         case "${enableval}" in
       
    88             yes) enable8139too=1
       
    89                 ;;
       
    90             no) enable8139too=0
       
    91                 ;;
       
    92             *) AC_MSG_ERROR([Invalid value for --enable-8139too])
       
    93                 ;;
       
    94         esac
       
    95     ],
       
    96     [enable8139too=1]
       
    97 )
       
    98 
       
    99 AM_CONDITIONAL(ENABLE_8139TOO, test "x$enable8139too" = "x1")
    82 
   100 
    83 AC_ARG_WITH([8139too-kernel],
   101 AC_ARG_WITH([8139too-kernel],
    84     AC_HELP_STRING(
   102     AC_HELP_STRING(
    85         [--with-8139too-kernel=<X.Y.Z>],
   103         [--with-8139too-kernel=<X.Y.Z>],
    86         [8139too kernel (only if differing)]
   104         [8139too kernel (only if differing)]
    91     [
   109     [
    92         kernel8139too=$linuxversion
   110         kernel8139too=$linuxversion
    93     ]
   111     ]
    94 )
   112 )
    95 
   113 
    96 AC_MSG_CHECKING([for kernel for 8139too driver])
   114 if test "x${enable8139too}" = "x1"; then
    97 
   115     AC_MSG_CHECKING([for kernel for 8139too driver])
    98 kernels=`ls -1 devices/ | grep -oE "^8139too-.*-" | cut -d "-" -f 2 | uniq`
   116 
    99 found=0
   117     kernels=`ls -1 devices/ | grep -oE "^8139too-.*-" | cut -d "-" -f 2 | uniq`
   100 for k in $kernels; do
   118     found=0
   101     if test "$kernel8139too" = "$k"; then
   119     for k in $kernels; do
   102         found=1
   120         if test "$kernel8139too" = "$k"; then
   103     fi
   121             found=1
   104 done
   122         fi
   105 if test $found -ne 1; then
   123     done
   106     AC_MSG_ERROR([kernel $kernel8139too not available for 8139too driver!])
   124     if test $found -ne 1; then
   107 fi
   125         AC_MSG_ERROR([kernel $kernel8139too not available for 8139too driver!])
   108 
   126     fi
   109 AC_MSG_RESULT([$kernel8139too])
   127 
       
   128     AC_MSG_RESULT([$kernel8139too])
       
   129 fi
       
   130 
       
   131 #------------------------------------------------------------------------------
       
   132 # e100 driver
       
   133 #------------------------------------------------------------------------------
       
   134 
       
   135 AC_ARG_ENABLE([e100],
       
   136     AS_HELP_STRING([--enable-e100],
       
   137                    [Enable e100 driver]),
       
   138     [
       
   139         case "${enableval}" in
       
   140             yes) enablee100=1
       
   141                 ;;
       
   142             no) enablee100=0
       
   143                 ;;
       
   144             *) AC_MSG_ERROR([Invalid value for --enable-e100])
       
   145                 ;;
       
   146         esac
       
   147     ],
       
   148     [enablee100=0] # disabled by default
       
   149 )
       
   150 
       
   151 AM_CONDITIONAL(ENABLE_E100, test "x$enablee100" = "x1")
       
   152 
       
   153 AC_ARG_WITH([e100-kernel],
       
   154     AC_HELP_STRING(
       
   155         [--with-e100-kernel=<X.Y.Z>],
       
   156         [e100 kernel (only if differing)]
       
   157     ),
       
   158     [
       
   159         kernele100=[$withval]
       
   160     ],
       
   161     [
       
   162         kernele100=$linuxversion
       
   163     ]
       
   164 )
       
   165 
       
   166 if test "x${enablee100}" = "x1"; then
       
   167     AC_MSG_CHECKING([for kernel for e100 driver])
       
   168 
       
   169     kernels=`ls -1 devices/ | grep -oE "^e100-.*-" | cut -d "-" -f 2 | uniq`
       
   170     found=0
       
   171     for k in $kernels; do
       
   172         if test "$kernele100" = "$k"; then
       
   173             found=1
       
   174         fi
       
   175     done
       
   176     if test $found -ne 1; then
       
   177         AC_MSG_ERROR([kernel $kernele100 not available for e100 driver!])
       
   178     fi
       
   179 
       
   180     AC_MSG_RESULT([$kernele100])
       
   181 fi
       
   182 
       
   183 #------------------------------------------------------------------------------
       
   184 # forcedeth driver
       
   185 #------------------------------------------------------------------------------
       
   186 
       
   187 AC_ARG_ENABLE([forcedeth],
       
   188     AS_HELP_STRING([--enable-forcedeth],
       
   189                    [Enable forcedeth driver]),
       
   190     [
       
   191         case "${enableval}" in
       
   192             yes) enableforcedeth=1
       
   193                 ;;
       
   194             no) enableforcedeth=0
       
   195                 ;;
       
   196             *) AC_MSG_ERROR([Invalid value for --enable-forcedeth])
       
   197                 ;;
       
   198         esac
       
   199     ],
       
   200     [enableforcedeth=0] # disabled by default!
       
   201 )
       
   202 
       
   203 AM_CONDITIONAL(ENABLE_FORCEDETH, test "x$enableforcedeth" = "x1")
       
   204 
       
   205 AC_ARG_WITH([forcedeth-kernel],
       
   206     AC_HELP_STRING(
       
   207         [--with-forcedeth-kernel=<X.Y.Z>],
       
   208         [forcedeth kernel (only if differing)]
       
   209     ),
       
   210     [
       
   211         kernelforcedeth=[$withval]
       
   212     ],
       
   213     [
       
   214         kernelforcedeth=$linuxversion
       
   215     ]
       
   216 )
       
   217 
       
   218 if test "x${enableforcedeth}" = "x1"; then
       
   219     AC_MSG_CHECKING([for kernel for forcedeth driver])
       
   220 
       
   221     kernels=`ls -1 devices/ | grep -oE "^forcedeth-.*-" | cut -d "-" -f 2 | uniq`
       
   222     found=0
       
   223     for k in $kernels; do
       
   224         if test "$kernelforcedeth" = "$k"; then
       
   225             found=1
       
   226         fi
       
   227     done
       
   228     if test $found -ne 1; then
       
   229         AC_MSG_ERROR([kernel $kernelforcedeth not available for forcedeth driver!])
       
   230     fi
       
   231 
       
   232     AC_MSG_RESULT([$kernelforcedeth])
       
   233 fi
       
   234 
       
   235 #------------------------------------------------------------------------------
       
   236 # e1000 driver
       
   237 #------------------------------------------------------------------------------
       
   238 
       
   239 AC_ARG_ENABLE([e1000],
       
   240     AS_HELP_STRING([--enable-e1000],
       
   241                    [Enable e1000 driver]),
       
   242     [
       
   243         case "${enableval}" in
       
   244             yes) enablee1000=1
       
   245                 ;;
       
   246             no) enablee1000=0
       
   247                 ;;
       
   248             *) AC_MSG_ERROR([Invalid value for --enable-e1000])
       
   249                 ;;
       
   250         esac
       
   251     ],
       
   252     [enablee1000=0] # disabled by default
       
   253 )
       
   254 
       
   255 AM_CONDITIONAL(ENABLE_E1000, test "x$enablee1000" = "x1")
       
   256 
       
   257 AC_ARG_WITH([e1000-kernel],
       
   258     AC_HELP_STRING(
       
   259         [--with-e1000-kernel=<X.Y.Z>],
       
   260         [e1000 kernel (only if differing)]
       
   261     ),
       
   262     [
       
   263         kernele1000=[$withval]
       
   264     ],
       
   265     [
       
   266         kernele1000=$linuxversion
       
   267     ]
       
   268 )
       
   269 
       
   270 if test "x${enablee1000}" = "x1"; then
       
   271     AC_MSG_CHECKING([for kernel for e1000 driver])
       
   272 
       
   273     kernels=`ls -1 devices/e1000/ | grep -oE "^e1000_main-.*" | cut -d "-" -f 2 | uniq`
       
   274     found=0
       
   275     for k in $kernels; do
       
   276         if test "$kernele1000" = "$k"; then
       
   277             found=1
       
   278         fi
       
   279     done
       
   280     if test $found -ne 1; then
       
   281         AC_MSG_ERROR([kernel $kernele1000 not available for e1000 driver!])
       
   282     fi
       
   283 
       
   284     AC_MSG_RESULT([$kernele1000])
       
   285 fi
   110 
   286 
   111 #------------------------------------------------------------------------------
   287 #------------------------------------------------------------------------------
   112 # RTAI path (optional)
   288 # RTAI path (optional)
   113 #------------------------------------------------------------------------------
   289 #------------------------------------------------------------------------------
   114 
   290 
   168 
   344 
   169 #------------------------------------------------------------------------------
   345 #------------------------------------------------------------------------------
   170 # Debug interface
   346 # Debug interface
   171 #------------------------------------------------------------------------------
   347 #------------------------------------------------------------------------------
   172 
   348 
   173 AC_ARG_ENABLE([dbg-if],
   349 AC_ARG_ENABLE([debug-if],
   174     AS_HELP_STRING([--enable-dbg-if],
   350     AS_HELP_STRING([--enable-debug-if],
   175                    [Create a debug interface for each master @<:@NO@:>@]),
   351                    [Create a debug interface for each master @<:@NO@:>@]),
   176     [
   352     [
   177         case "${enableval}" in
   353         case "${enableval}" in
   178             yes) dbg=1
   354             yes) dbg=1
   179                 AC_DEFINE([EC_DBG_IF], [1], [Debug interfaces enabled])
       
   180                 ;;
   355                 ;;
   181             no) dbg=0
   356             no) dbg=0
   182                 ;;
   357                 ;;
   183             *) AC_MSG_ERROR([Invalid value for --enable-dbg-if])
   358             *) AC_MSG_ERROR([Invalid value for --enable-debug-if])
   184                 ;;
   359                 ;;
   185         esac
   360         esac
   186     ],
   361     ],
   187     [dbg=0]
   362     [dbg=0]
   188 )
   363 )
   189 
   364 
   190 AM_CONDITIONAL(EC_DBG_IF, test "x$dbg" = x1)
   365 if test "x${dbg}" = "x1"; then
   191 AC_SUBST([EC_DBG_IF],${dbg})
   366     AC_DEFINE([EC_DEBUG_IF], [1], [Debug interfaces enabled])
       
   367 fi
       
   368 AM_CONDITIONAL(ENABLE_DEBUG_IF, test "x$dbg" = "x1")
       
   369 
       
   370 #------------------------------------------------------------------------------
       
   371 # Debug ring
       
   372 #------------------------------------------------------------------------------
       
   373 
       
   374 AC_ARG_ENABLE([debug-ring],
       
   375     AS_HELP_STRING([--enable-debug-ring],
       
   376                    [Create a debug ring to record frames @<:@NO@:>@]),
       
   377     [
       
   378         case "${enableval}" in
       
   379             yes) debugring=1
       
   380                 ;;
       
   381             no) debugring=0
       
   382                 ;;
       
   383             *) AC_MSG_ERROR([Invalid value for --enable-debug-ring])
       
   384                 ;;
       
   385         esac
       
   386     ],
       
   387     [debugring=0]
       
   388 )
       
   389 
       
   390 if test "x${debugring}" = "x1"; then
       
   391     AC_DEFINE([EC_DEBUG_RING], [1], [Debug ring enabled])
       
   392 fi
       
   393 
       
   394 #------------------------------------------------------------------------------
       
   395 # Dummy master module
       
   396 #------------------------------------------------------------------------------
       
   397 
       
   398 AC_ARG_ENABLE([dummy],
       
   399     AS_HELP_STRING([--enable-dummy],
       
   400                    [Build the dummy master module @<:@NO@:>@]),
       
   401     [
       
   402         case "${enableval}" in
       
   403             yes) dummy=1
       
   404                 ;;
       
   405             no) dummy=0
       
   406                 ;;
       
   407             *) AC_MSG_ERROR([Invalid value for --enable-dummy])
       
   408                 ;;
       
   409         esac
       
   410     ],
       
   411     [dummy=0]
       
   412 )
       
   413 
       
   414 AM_CONDITIONAL(ENABLE_DUMMY, test "x$dummy" = "x1")
   192 
   415 
   193 #------------------------------------------------------------------------------
   416 #------------------------------------------------------------------------------
   194 
   417 
   195 # Create config.kbuild
   418 # Create config.kbuild
   196 
   419 
   197 echo configure: creating config.kbuild...
   420 echo configure: creating config.kbuild...
   198 
   421 
   199 cat > config.kbuild <<EOF
   422 cat > config.kbuild <<EOF
   200 # config.kbuild - created by configure
   423 # config.kbuild - created by configure
   201 EC_DBG_IF := ${dbg}
   424 ENABLE_8139TOO := ${enable8139too}
   202 EC_8139TOO_KERNEL := ${kernel8139too}
   425 KERNEL_8139TOO := ${kernel8139too}
   203 EC_RTAI_DIR := "${rtaidir}"
   426 ENABLE_E100 := ${enablee100}
   204 EC_MSR_DIR := "${msrdir}"
   427 KERNEL_E100 := ${kernele100}
       
   428 ENABLE_FORCEDETH := ${enableforcedeth}
       
   429 KERNEL_FORCEDETH := ${kernelforcedeth}
       
   430 ENABLE_E1000 := ${enablee1000}
       
   431 KERNEL_E1000 := ${kernele1000}
       
   432 RTAI_DIR := "${rtaidir}"
       
   433 MSR_DIR := "${msrdir}"
       
   434 ENABLE_DEBUG_IF := ${dbg}
       
   435 ENABLE_DUMMY := ${dummy}
   205 EOF
   436 EOF
   206 
   437 
   207 #------------------------------------------------------------------------------
   438 #------------------------------------------------------------------------------
   208 
   439 
   209 AC_CONFIG_FILES([
   440 AC_CONFIG_FILES([
   210         Makefile
   441         Makefile
   211         master/Makefile
   442         master/Makefile
   212         devices/Makefile
   443         devices/Makefile
       
   444         devices/e1000/Makefile
   213         script/Makefile
   445         script/Makefile
   214         script/init.d/Makefile
   446         script/init.d/Makefile
   215         script/sysconfig/Makefile
   447         script/sysconfig/Makefile
   216         include/Makefile
   448         include/Makefile
   217         examples/Makefile
   449         examples/Makefile
   218         examples/mini/Makefile
   450         examples/mini/Makefile
   219         examples/rtai/Makefile
   451         examples/rtai/Makefile
   220         examples/msr/Makefile
   452         examples/msr/Makefile
       
   453         dummy/Makefile
   221 ])
   454 ])
   222 AC_OUTPUT
   455 AC_OUTPUT
   223 
   456 
   224 #------------------------------------------------------------------------------
   457 #------------------------------------------------------------------------------