configure
changeset 719 438a979fda5d
parent 698 a0b50d6ce746
child 736 a915095ab9e7
equal deleted inserted replaced
718:0b33d9cdbdeb 719:438a979fda5d
    26 ###########################################################################
    26 ###########################################################################
    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 transfer.
    32 #For a normal transfert, (usually for a string), put the maximum string size to transfer.
    32 #For a normal transfer, (usually for a string), put the maximum string size to transfer.
    33 SDO_MAX_LENGTH_TRANSFERT=32
    33 SDO_MAX_LENGTH_TRANSFER=32
    34 
    34 
    35 # For block transfert, number of segments transmitted at once.
    35 # For block transfer, number of segments transmitted at once.
    36 # SDO_BLOCK_SIZE CAN frames must fit into the CAN Tx buffer
    36 # SDO_BLOCK_SIZE CAN frames must fit into the CAN Tx buffer
    37 SDO_BLOCK_SIZE=16
    37 SDO_BLOCK_SIZE=16
    38 
    38 
    39 # Number of SDO from differents nodes that the node can manage concurrently.
    39 # Number of SDO from differents nodes that the node can manage concurrently.
    40 #for a slave node, usually put 1.
    40 #for a slave node, usually put 1.
    41 SDO_MAX_SIMULTANEOUS_TRANSFERTS=4
    41 SDO_MAX_SIMULTANEOUS_TRANSFERS=4
    42 
    42 
    43 # Used for NMTable[bus][nodeId]
    43 # Used for NMTable[bus][nodeId]
    44 # You can put less of 128 if on the netwo
    44 # You can put less of 128 if on the netwo
    45 # are connected only smaller nodeId node.
    45 # are connected only smaller nodeId node.
    46 NMT_MAX_NODE_ID=128
    46 NMT_MAX_NODE_ID=128
   123 			echo "On user request: LSS services enabled";;
   123 			echo "On user request: LSS services enabled";;
   124 	--enable-lss-fs)	ENABLE_LSS_FS=1;
   124 	--enable-lss-fs)	ENABLE_LSS_FS=1;
   125 			echo "On user request: LSS FastScan service enabled";;
   125 			echo "On user request: LSS FastScan service enabled";;
   126 	--debug=*)	DEBUG=$optarg;;
   126 	--debug=*)	DEBUG=$optarg;;
   127 	--MAX_CAN_BUS_ID=*)	MAX_CAN_BUS_ID=$optarg;;
   127 	--MAX_CAN_BUS_ID=*)	MAX_CAN_BUS_ID=$optarg;;
   128 	--SDO_MAX_LENGTH_TRANSFERT=*)	SDO_MAX_LENGTH_TRANSFERT=$optarg;;
   128 	--SDO_MAX_LENGTH_TRANSFER=*)	SDO_MAX_LENGTH_TRANSFER=$optarg;;
   129 	--SDO_BLOCK_SIZE=*)	SDO_BLOCK_SIZE=$optarg;;
   129 	--SDO_BLOCK_SIZE=*)	SDO_BLOCK_SIZE=$optarg;;
   130 	--SDO_MAX_SIMULTANEOUS_TRANSFERTS=*)	SDO_MAX_SIMULTANEOUS_TRANSFERTS=$optarg;;
   130 	--SDO_MAX_SIMULTANEOUS_TRANSFERS=*)	SDO_MAX_SIMULTANEOUS_TRANSFERS=$optarg;;
   131 	--NMT_MAX_NODE_ID=*)	NMT_MAX_NODE_ID=$optarg;;
   131 	--NMT_MAX_NODE_ID=*)	NMT_MAX_NODE_ID=$optarg;;
   132 	--SDO_TIMEOUT_MS=*)	SDO_TIMEOUT_MS=$optarg;;
   132 	--SDO_TIMEOUT_MS=*)	SDO_TIMEOUT_MS=$optarg;;
   133 	--CANOPEN_BIG_ENDIAN=*)	CANOPEN_BIG_ENDIAN=$optarg;;
   133 	--CANOPEN_BIG_ENDIAN=*)	CANOPEN_BIG_ENDIAN=$optarg;;
   134 	--MAX_NB_TIMER=*) MAX_NB_TIMER=$optarg;;
   134 	--MAX_NB_TIMER=*) MAX_NB_TIMER=$optarg;;
   135 	--EMCY_MAX_ERRORS=*) EMCY_MAX_ERRORS=$optarg;;
   135 	--EMCY_MAX_ERRORS=*) EMCY_MAX_ERRORS=$optarg;;
   181 		echo	"               \"WAR\" print errors and warnings, to stdout"
   181 		echo	"               \"WAR\" print errors and warnings, to stdout"
   182 		echo	"               \"MSG\" print messages content, to stdout"
   182 		echo	"               \"MSG\" print messages content, to stdout"
   183 		echo
   183 		echo
   184 		echo	"Stack compilation constants"
   184 		echo	"Stack compilation constants"
   185 		echo	" --MAX_CAN_BUS_ID [=1] Number of can bus to use"
   185 		echo	" --MAX_CAN_BUS_ID [=1] Number of can bus to use"
   186 		echo	" --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO"
   186 		echo	" --SDO_MAX_LENGTH_TRANSFER [=32] max bytes to transmit by SDO"
   187 		echo	" --SDO_BLOCK_SIZE [=16] max CAN frames transmitted at once for block transfert"
   187 		echo	" --SDO_BLOCK_SIZE [=16] max CAN frames transmitted at once for block transfer"
   188 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently"
   188 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERS [=4] Number of SDO that the node can manage concurrently"
   189 		echo	" --NMT_MAX_NODE_ID [=128] can be reduced to gain memory on small network"
   189 		echo	" --NMT_MAX_NODE_ID [=128] can be reduced to gain memory on small network"
   190 		echo	" --SDO_TIMEOUT_MS [=3000] Timeout in milliseconds for SDO (None to disable the feature)"
   190 		echo	" --SDO_TIMEOUT_MS [=3000] Timeout in milliseconds for SDO (None to disable the feature)"
   191 		echo	" --EMCY_MAX_ERRORS [=8] Max number of active errors managed in error_data structure"
   191 		echo	" --EMCY_MAX_ERRORS [=8] Max number of active errors managed in error_data structure"
   192 		echo	" --LSS_TIMEOUT_MS [=1000] Timeout in milliseconds for LSS services."
   192 		echo	" --LSS_TIMEOUT_MS [=1000] Timeout in milliseconds for LSS services."
   193 		echo	"                          LSS must be enabled with \"--enable-lss\""
   193 		echo	"                          LSS must be enabled with \"--enable-lss\""
   413     SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lAnaCommon
   413     SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lAnaCommon
   414 fi
   414 fi
   415 
   415 
   416 
   416 
   417 if [ "$SUB_CAN_DRIVER" = "vscom" ]; then
   417 if [ "$SUB_CAN_DRIVER" = "vscom" ]; then
   418     SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lvs_can_api
   418     if  [ "$SUB_OS_NAME" = "Linux" ]; then
       
   419 	if [ "$SUB_ARCH_NAME" = "x86" ]; then
       
   420 	    SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -LLinux\ -lvs_can_api
       
   421         elif [ "$SUB_ARCH_NAME" = "x86_64" ]; then
       
   422 	    SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -L\'Linux\ x86-64\'\ -lvs_can_api_x86-64
       
   423 	else
       
   424 	    echo "!!! ERROR !!! Please adapt the configure script for your SUB_ARCH_NAME" $SUB_ARCH_NAME
       
   425         fi
       
   426     else
       
   427 	echo "!!! ERROR !!! Please adapt the configure script for your SUB_OS_NAME" $SUB_OS_NAME
       
   428     fi
   419 fi
   429 fi
   420 
   430 
   421 if [ "$SUB_CAN_DRIVER" = "anagate_win32" ]; then
   431 if [ "$SUB_CAN_DRIVER" = "anagate_win32" ]; then
   422     SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lAnaGateCan
   432     SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lAnaGateCan
   423 fi
   433 fi
   551 echo "Using ${CC} as a C compiler"
   561 echo "Using ${CC} as a C compiler"
   552 
   562 
   553 if [ "$SUB_ARCH_NAME" = "x86_64" -a "$CC" = "gcc" ]; then
   563 if [ "$SUB_ARCH_NAME" = "x86_64" -a "$CC" = "gcc" ]; then
   554 	# Only if we are on x86_64 and using gcc
   564 	# Only if we are on x86_64 and using gcc
   555 	# For shared library generation, it needs this
   565 	# For shared library generation, it needs this
   556 	SUB_PROG_CFLAGS=-fPIC
   566 	SUB_PROG_CFLAGS+=\ -fPIC
   557 fi
   567 fi
   558 
   568 
   559 if [ "$BINUTILS_PREFIX" = "" ]; then
   569 if [ "$BINUTILS_PREFIX" = "" ]; then
   560 	SUB_BINUTILS_PREFIX=`echo "$CC" | sed 's/gcc$//'`
   570 	SUB_BINUTILS_PREFIX=`echo "$CC" | sed 's/gcc$//'`
   561 else
   571 else
   578 	fi
   588 	fi
   579 fi
   589 fi
   580 
   590 
   581 if [ "$SUB_TARGET" = "unix" ]; then
   591 if [ "$SUB_TARGET" = "unix" ]; then
   582 	if [ "$LD" = "" ]; then
   592 	if [ "$LD" = "" ]; then
   583 		LD=$CC
   593 		LD=$CXX
   584 	fi
   594 	fi
   585 fi
   595 fi
   586 
   596 
   587 echo "Using ${LD} as a linker"
   597 echo "Using ${LD} as a linker"
   588 
   598 
   660 echo "#ifndef _CONFIG_H_" >> include/config.h
   670 echo "#ifndef _CONFIG_H_" >> include/config.h
   661 echo "#define _CONFIG_H_" >> include/config.h
   671 echo "#define _CONFIG_H_" >> include/config.h
   662 echo "" >> include/config.h
   672 echo "" >> include/config.h
   663 for i in \
   673 for i in \
   664  MAX_CAN_BUS_ID\
   674  MAX_CAN_BUS_ID\
   665  SDO_MAX_LENGTH_TRANSFERT\
   675  SDO_MAX_LENGTH_TRANSFER\
   666  SDO_BLOCK_SIZE\
   676  SDO_BLOCK_SIZE\
   667  SDO_MAX_SIMULTANEOUS_TRANSFERTS\
   677  SDO_MAX_SIMULTANEOUS_TRANSFERS\
   668  NMT_MAX_NODE_ID\
   678  NMT_MAX_NODE_ID\
   669  SDO_TIMEOUT_MS\
   679  SDO_TIMEOUT_MS\
   670  MAX_NB_TIMER\
   680  MAX_NB_TIMER\
   671  CANOPEN_BIG_ENDIAN\
   681  CANOPEN_BIG_ENDIAN\
   672  US_TO_TIMEVAL_FACTOR\
   682  US_TO_TIMEVAL_FACTOR\
   683 fi
   693 fi
   684 done
   694 done
   685 echo "" >> include/config.h
   695 echo "" >> include/config.h
   686 
   696 
   687 for i in \
   697 for i in \
   688  SDO_MAX_SIMULTANEOUS_TRANSFERTS\
   698  SDO_MAX_SIMULTANEOUS_TRANSFERS\
   689  NMT_MAX_NODE_ID\
   699  NMT_MAX_NODE_ID\
   690  EMCY_MAX_ERRORS; do
   700  EMCY_MAX_ERRORS; do
   691 	echo "#define REPEAT_"$i"_TIMES(repeat)\\">> include/config.h
   701 	echo "#define REPEAT_"$i"_TIMES(repeat)\\">> include/config.h
   692 	times=${!i}
   702 	times=${!i}
   693 	result=""
   703 	result=""