configure
changeset 360 09af3515dd42
parent 354 396ac66670ad
child 363 40b351ab5a93
equal deleted inserted replaced
359:346435b94063 360:09af3515dd42
    27 
    27 
    28 # Number of can bus to use 
    28 # Number of can bus to use 
    29 MAX_CAN_BUS_ID=1
    29 MAX_CAN_BUS_ID=1
    30 
    30 
    31 # max bytes to transmit by SDO Put 4 if you only support expedited transfert.
    31 # max bytes to transmit by SDO Put 4 if you only support expedited transfert.
    32 # For a normal transfert, (usually for a string), put the maximum string size to transfer.
    32 #For a normal transfert, (usually for a string), put the maximum string size to transfer.
    33 SDO_MAX_LENGTH_TRANSFERT=32
    33 SDO_MAX_LENGTH_TRANSFERT=32
    34 
    34 
    35 # Number of SDO from differents nodes that the node can manage concurrently.   
    35 # Number of SDO from differents nodes that the node can manage concurrently.   
    36 # for a slave node, usually put 1.
    36 #for a slave node, usually put 1.
    37 SDO_MAX_SIMULTANEOUS_TRANSFERTS=4
    37 SDO_MAX_SIMULTANEOUS_TRANSFERTS=4
    38 
    38 
    39 # Used for NMTable[bus][nodeId]	  
    39 # Used for NMTable[bus][nodeId]	  
    40 # You can put less of 128 if on the netwo
    40 # You can put less of 128 if on the netwo
    41 # are connected only smaller nodeId node.
    41 # are connected only smaller nodeId node.
    55 # Default to little-endian
    55 # Default to little-endian
    56 CANOPEN_BIG_ENDIAN=
    56 CANOPEN_BIG_ENDIAN=
    57 
    57 
    58 # Max number of active errors managed in error_data structure.
    58 # Max number of active errors managed in error_data structure.
    59 EMCY_MAX_ERRORS=8
    59 EMCY_MAX_ERRORS=8
       
    60 
       
    61 #Timeout in milliseconds for LSS.
       
    62 LSS_TIMEOUT_MS=1000
       
    63 #Timeout in milliseconds for LSS FastScan.
       
    64 LSS_FS_TIMEOUT_MS=100
    60 
    65 
    61 ###########################################################################
    66 ###########################################################################
    62 #                             DEFAULT BUILD OPTIONS                       #
    67 #                             DEFAULT BUILD OPTIONS                       #
    63 ###########################################################################
    68 ###########################################################################
    64 
    69 
   107 			echo "On user request: Won't optimize with \"-Ox\"";;
   112 			echo "On user request: Won't optimize with \"-Ox\"";;
   108 	--disable-dll)	DISABLE_DLL=1;
   113 	--disable-dll)	DISABLE_DLL=1;
   109 			echo "On user request: Won't create and link to dll";;
   114 			echo "On user request: Won't create and link to dll";;
   110 	--enable-lss)	ENABLE_LSS=1;
   115 	--enable-lss)	ENABLE_LSS=1;
   111 			echo "On user request: LSS services enabled";;
   116 			echo "On user request: LSS services enabled";;
       
   117 	--enable-lss-fs)	ENABLE_LSS_FS=1;
       
   118 			echo "On user request: LSS FastScan service enabled";;
   112 	--debug=*)	DEBUG=$optarg;;
   119 	--debug=*)	DEBUG=$optarg;;
   113 	--MAX_CAN_BUS_ID=*)	MAX_CAN_BUS_ID=$1;;
   120 	--MAX_CAN_BUS_ID=*)	MAX_CAN_BUS_ID=$1;;
   114 	--SDO_MAX_LENGTH_TRANSFERT=*)	SDO_MAX_LENGTH_TRANSFERT=$1;;
   121 	--SDO_MAX_LENGTH_TRANSFERT=*)	SDO_MAX_LENGTH_TRANSFERT=$1;;
   115 	--SDO_MAX_SIMULTANEOUS_TRANSFERTS=*)	SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;;
   122 	--SDO_MAX_SIMULTANEOUS_TRANSFERTS=*)	SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;;
   116 	--NMT_MAX_NODE_ID=*)	NMT_MAX_NODE_ID=$1;;
   123 	--NMT_MAX_NODE_ID=*)	NMT_MAX_NODE_ID=$1;;
   117 	--SDO_TIMEOUT_MS=*)	SDO_TIMEOUT_MS=$1;;
   124 	--SDO_TIMEOUT_MS=*)	SDO_TIMEOUT_MS=$1;;
   118 	--CANOPEN_BIG_ENDIAN=*)	CANOPEN_BIG_ENDIAN=$1;;
   125 	--CANOPEN_BIG_ENDIAN=*)	CANOPEN_BIG_ENDIAN=$1;;
   119 	--MAX_NB_TIMER=*) MAX_NB_TIMER=$1;;
   126 	--MAX_NB_TIMER=*) MAX_NB_TIMER=$1;;
   120 	--EMCY_MAX_ERRORS=*) EMCY_MAX_ERRORS=$1;;
   127 	--EMCY_MAX_ERRORS=*) EMCY_MAX_ERRORS=$1;;
       
   128 	--LSS_TIMEOUT_MS=*)	LSS_TIMEOUT_MS=$optarg;;
       
   129 	--LSS_FS_TIMEOUT_MS=*)	LSS_FS_TIMEOUT_MS=$optarg;;
   121 	--help)
   130 	--help)
   122 		echo	"Usage: ./configure [options]"
   131 		echo	"Usage: ./configure [options]"
   123 		echo	"Options:"
   132 		echo	"Options:"
   124 		echo 	" --cc=foo      Use C compiler 'foo' instead of defaults ${CC1} or ${CC2}."
   133 		echo 	" --cc=foo      Use C compiler 'foo' instead of defaults ${CC1} or ${CC2}."
   125 		echo 	" --cxx=foo     Use C++ compiler 'foo' instead of defaults g++."
   134 		echo 	" --cxx=foo     Use C++ compiler 'foo' instead of defaults g++."
   142 		echo	"               \"lincan\" lincan driver"
   151 		echo	"               \"lincan\" lincan driver"
   143 		echo	"                 see http://www.ocera.org/download/components/WP7/lincan-0.3.3.html"
   152 		echo	"                 see http://www.ocera.org/download/components/WP7/lincan-0.3.3.html"
   144 		echo 	" --timers=foo  Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')"
   153 		echo 	" --timers=foo  Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')"
   145 		echo 	" --disable-dll Disable run-time dynamic linking of can, led and nvram drivers"
   154 		echo 	" --disable-dll Disable run-time dynamic linking of can, led and nvram drivers"
   146 		echo 	" --enable-lss  Enable the LSS services"
   155 		echo 	" --enable-lss  Enable the LSS services"
       
   156 		echo 	" --enable-lss-fs  Enable the LSS FastScan service"
   147 		echo	" --disable-Ox  Disable gcc \"-Ox\" optimizations."
   157 		echo	" --disable-Ox  Disable gcc \"-Ox\" optimizations."
   148 		echo	" --debug=foo,foo,..   Enable debug messages, ERR -> only errors, WAR)."
   158 		echo	" --debug=foo,foo,..   Enable debug messages, ERR -> only errors, WAR)."
   149 		echo	"               \"PDO\" send errors and warnings through PDO messages"
   159 		echo	"               \"PDO\" send errors and warnings through PDO messages"
   150 		echo	"               \"ERR\" print errors only, to stdout"
   160 		echo	"               \"ERR\" print errors only, to stdout"
   151 		echo	"               \"WAR\" print errors and warnings, to stdout"
   161 		echo	"               \"WAR\" print errors and warnings, to stdout"
   156 		echo	" --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO"
   166 		echo	" --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO"
   157 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently"
   167 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently"
   158 		echo	" --NMT_MAX_NODE_ID [=128] can be reduced to gain memory on small network"
   168 		echo	" --NMT_MAX_NODE_ID [=128] can be reduced to gain memory on small network"
   159 		echo	" --SDO_TIMEOUT_MS [=3000] Timeout in milliseconds for SDO (None to disable the feature)"
   169 		echo	" --SDO_TIMEOUT_MS [=3000] Timeout in milliseconds for SDO (None to disable the feature)"
   160 		echo	" --EMCY_MAX_ERRORS [=8] Max number of active errors managed in error_data structure"
   170 		echo	" --EMCY_MAX_ERRORS [=8] Max number of active errors managed in error_data structure"
       
   171 		echo	" --LSS_TIMEOUT_MS [=1000] Timeout in milliseconds for LSS services."
       
   172 		echo	"                          LSS must be enabled with \"--enable-lss\""
       
   173 		echo	" --LSS_FS_TIMEOUT_MS [=100] Timeout in milliseconds for LSS FastScan service."
       
   174 		echo	"                            LSS FastScan must be enabled with \"--enable-lss-fs\""
   161 		exit 0;;
   175 		exit 0;;
   162 	*)		echo "Unknown argument ${1}"; exit -1;;
   176 	*)		echo "Unknown argument ${1}"; exit -1;;
   163 	esac
   177 	esac
   164 
   178 
   165 	shift
   179 	shift
   284 
   298 
   285 ###########################################################################
   299 ###########################################################################
   286 #              TARGET/DRIVER SPECIFIC CFLAGS and OPTIONS                  #
   300 #              TARGET/DRIVER SPECIFIC CFLAGS and OPTIONS                  #
   287 ###########################################################################
   301 ###########################################################################
   288 if [ "$SUB_TARGET" = "hcs12" ]; then
   302 if [ "$SUB_TARGET" = "hcs12" ]; then
   289 	# Only if we want to compile for a µC HCS12
   303 	# Only if we want to compile for a C HCS12
   290        # it is a big endian architecture.
   304        # it is a big endian architecture.
   291        CANOPEN_BIG_ENDIAN=1
   305        CANOPEN_BIG_ENDIAN=1
   292 	# search for gcc hcs12 compiler m6811-elf-gcc or m68hc12-gcc ?
   306 	# search for gcc hcs12 compiler m6811-elf-gcc or m68hc12-gcc ?
   293 	if [ "$CC" = "" ]; then
   307 	if [ "$CC" = "" ]; then
   294 		which m6811-elf-gcc >/dev/null 2>&1
   308 		which m6811-elf-gcc >/dev/null 2>&1
   518  CANOPEN_BIG_ENDIAN\
   532  CANOPEN_BIG_ENDIAN\
   519  US_TO_TIMEVAL_FACTOR\
   533  US_TO_TIMEVAL_FACTOR\
   520  TIMEVAL\
   534  TIMEVAL\
   521  TIMEVAL_MAX\
   535  TIMEVAL_MAX\
   522  RTCAN_SOCKET\
   536  RTCAN_SOCKET\
   523  EMCY_MAX_ERRORS; do
   537  EMCY_MAX_ERRORS\
       
   538  LSS_TIMEOUT_MS\
       
   539  LSS_FS_TIMEOUT_MS; do
   524 if [ "${!i}" = "" ]; then
   540 if [ "${!i}" = "" ]; then
   525 echo "/* $i is not defined */" >> include/config.h
   541 echo "/* $i is not defined */" >> include/config.h
   526 else
   542 else
   527 echo "#define $i ${!i}" >> include/config.h
   543 echo "#define $i ${!i}" >> include/config.h
   528 fi
   544 fi
   613 fi
   629 fi
   614 
   630 
   615 if [ $ENABLE_LSS ]; then
   631 if [ $ENABLE_LSS ]; then
   616 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DCO_ENABLE_LSS;
   632 	SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DCO_ENABLE_LSS;
   617 	SUB_ENABLE_LSS=1
   633 	SUB_ENABLE_LSS=1
       
   634 	if [ $ENABLE_LSS_FS ]; then
       
   635 		SUB_PROG_CFLAGS=$SUB_PROG_CFLAGS\ -DCO_ENABLE_LSS_FS;
       
   636 	fi
   618 else
   637 else
   619 	SUB_ENABLE_LSS=0
   638 	SUB_ENABLE_LSS=0
   620 fi
   639 fi
   621 
   640 
   622 ###########################################################################
   641 ###########################################################################