]> rtime.felk.cvut.cz Git - CanFestival-3.git/blobdiff - configure
Remover SillySlave from LSS build
[CanFestival-3.git] / configure
index bb5025dae602e01c991d018cc83bda6b68f6170f..983391fddfcc99c72de888ff091915afc0e53740 100755 (executable)
--- a/configure
+++ b/configure
@@ -67,11 +67,6 @@ LSS_FS_TIMEOUT_MS=100
 #                             DEFAULT BUILD OPTIONS                       #
 ###########################################################################
 
-# Leave empty for automatic detection
-CC=
-CXX=
-LD=
-
 #default target
 SUB_TARGET=
 
@@ -92,6 +87,10 @@ if [ "$XENO_CONFIG" = "" ]; then
        XENO_CONFIG=/usr/xenomai/bin/xeno-config
 fi
 
+if [ "$RTAI_CONFIG" = "" ]; then
+       RTAI_CONFIG=/usr/realtime/bin/rtai-config
+fi
+
 ###########################################################################
 #                          ARGUMENTS PARSING                              #
 ###########################################################################
@@ -102,6 +101,7 @@ while [ $# -ge 1 ]; do
        --cc=*)         CC=$optarg;;
        --cxx=*)        CXX=$optarg;;
        --ld=*)         LD=$optarg;;
+       --binutils=*)   BINUTILS_PREFIX=$optarg;;
        --arch=*)       SUB_ARCH_NAME=$optarg;;
        --os=*)         SUB_OS_NAME=$optarg;;
        --kerneldir=*)  SUB_KERNELDIR=$optarg;;
@@ -145,6 +145,8 @@ while [ $# -ge 1 ]; do
                echo    "               \"win32\" for win32 systems (native, mingw or VC++)"
                echo    "               \"hcs12\" for HCS12 micro-controller"
                echo    " --can=foo     Use 'foo' as CAN driver"
+               echo    "               \"anagate_linux\" use AnaGate CAN(duo) driver for linux"        
+               echo    "               \"anagate_win32\" use AnaGate CAN(duo) driver for win32"                                
                echo    "               \"peak_linux\" use Linux build host installed Peak driver and library"
                echo    "                 see http://www.peak-system.com/linux/"
                echo    "               \"peak_win32\" use win32 PcanLight Peak driver and library with Cygwin" 
@@ -157,8 +159,9 @@ while [ $# -ge 1 ]; do
                echo    "                 see http://www.ocera.org/download/components/WP7/lincan-0.3.3.html"
                echo    "               \"can4linux\" can4linux driver"
                echo    "                 see http://www.port.de/engl/canprod/hw_can4linux.html"
-               echo    " --timers=foo  Use 'foo' as TIMERS driver (can be 'unix', 'xeno' or 'kernel')"
-               echo    " --wx=foo  force result of WxWidgets detection (0 or 1)"
+               echo    " --timers=foo  Use 'foo' as TIMERS driver (can be 'unix', 'xeno', 'rtai' or 'kernel')"
+               echo    " --wx=foo      Force result of WxWidgets detection (0 or 1)"
+               echo    " --binutils=path   Override binutils path detection (as regards \$CC content)"
                echo    " --disable-dll Disable run-time dynamic linking of can, led and nvram drivers"
                echo    " --enable-lss  Enable the LSS services"
                echo    " --enable-lss-fs  Enable the LSS FastScan service"
@@ -243,12 +246,6 @@ fi
 echo "Host OS: ${SUB_OS_NAME}"
 echo "Host arch: ${SUB_ARCH_NAME}"
 
-if [ "$SUB_ARCH_NAME" = "x86_64" -a "$CC" = "gcc" ]; then
-       # Only if we are on x86_64 and using gcc
-       # For shared library generation, it needs this
-       SUB_PROG_CFLAGS=-fPIC
-fi
-
 if [ "$SUB_ARCH_NAME" = "ppc" -o "$SUB_ARCH_NAME" = "powerpc" ]; then
        # PowerPC uses big endian format
        CANOPEN_BIG_ENDIAN=1
@@ -285,6 +282,9 @@ if [ "$SUB_CAN_DRIVER" = "" ]; then
                elif [ -e /usr/lib/libcanlib.so ]; then 
                        echo "Choosing installed Kvaser driver as CAN driver. (unix)"
                        SUB_CAN_DRIVER=kvaser
+               elif [ -e /usr/local/lib/libAnaGateAPIDLL.so ]; then 
+                       echo "Choosing installed AnaGate driver as CAN driver. (unix)"
+                       SUB_CAN_DRIVER=anagate_linux
                elif [ "$SUB_OS_NAME" = "CYGWIN" -a "$KVASER_DLL_PATH" != "" ]; then
                        echo "Choosing installed Kvaser driver as CAN driver. (cygwin)"
                        SUB_CAN_DRIVER=kvaser
@@ -315,6 +315,14 @@ if [ "$SUB_CAN_DRIVER" = "peak" ]; then
        fi
 fi
 
+# Warn for unstalled peak driver if choosen
+if [ "$SUB_CAN_DRIVER" = "anagate_linux" ]; then
+       if [ ! -e /usr/local/lib/libAnaGateAPIDLL.so ]; then 
+               echo "AnaGateCAN driver hasn't been installed !"
+               exit -1
+       fi
+fi
+
 # Warn for unstalled kvaser driver if choosen
 if [ "$SUB_CAN_DRIVER" = "kvaser" ]; then
        if [ "$SUB_OS_NAME" = "CYGWIN" ]; then
@@ -376,6 +384,20 @@ if [ "$SUB_CAN_DRIVER" = "peak_linux" ]; then
     SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lpcan
 fi
 
+if [ "$SUB_CAN_DRIVER" = "anagate_linux" ]; then
+    SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lAnaGateAPIDLL
+    SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lAnaCommon
+fi
+
+
+if [ "$SUB_CAN_DRIVER" = "vscom" ]; then
+    SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lvs_can_api
+fi
+
+if [ "$SUB_CAN_DRIVER" = "anagate_win32" ]; then
+    SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lAnaGateCan
+fi
+
 PW32DIR=drivers/can_peak_win32
 if [ "$SUB_CAN_DRIVER" = "peak_win32" ]; then
        if [ "$PCAN_HEADER" = "" -o "$PCAN_LIB" = "" ]; then
@@ -425,8 +447,15 @@ fi
 
 if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then
        RT_LIB_DIR=`$XENO_CONFIG --library-dir`\ -Wl,-rpath\ `$XENO_CONFIG --library-dir`
-    SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ `$XENO_CONFIG --xeno-ldflags`\ -L$RT_LIB_DIR\ -lnative\ -lpcan
-       SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ `$XENO_CONFIG --xeno-cflags`
+    SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ `$XENO_CONFIG --xeno-ldflags`\ -L$RT_LIB_DIR\ -lnative\ -lrtdm
+       SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DUSE_XENO\ `$XENO_CONFIG --xeno-cflags`
+    RTCAN_SOCKET=1
+fi
+
+if [ "$SUB_TIMERS_DRIVER" = "rtai" ]; then
+       RT_LIB_DIR=`$RTAI_CONFIG --library-dir`\ -Wl,-rpath\ `$RTAI_CONFIG --library-dir`
+    SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ `$RTAI_CONFIG --lxrt-ldflags`\ -L$RT_LIB_DIR\ -llxrt\ -lrtdm
+       SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DUSE_RTAI\ `$RTAI_CONFIG --lxrt-cflags`
     RTCAN_SOCKET=1
 fi
 
@@ -481,7 +510,17 @@ fi
 
 echo "Using ${CC} as a C compiler"
 
-SUB_BINUTILS_PREFIX=`echo "$CC" | sed 's/gcc$//'`
+if [ "$SUB_ARCH_NAME" = "x86_64" -a "$CC" = "gcc" ]; then
+       # Only if we are on x86_64 and using gcc
+       # For shared library generation, it needs this
+       SUB_PROG_CFLAGS=-fPIC
+fi
+
+if [ "$BINUTILS_PREFIX" = "" ]; then
+       SUB_BINUTILS_PREFIX=`echo "$CC" | sed 's/gcc$//'`
+else
+       SUB_BINUTILS_PREFIX=$BINUTILS_PREFIX
+fi
 
 if [ "$CXX" = "" ]; then
        CXX=${SUB_BINUTILS_PREFIX}g++