97 --target=*) SUB_TARGET=$optarg;; |
95 --target=*) SUB_TARGET=$optarg;; |
98 --can=*) SUB_CAN_DRIVER=$optarg;; |
96 --can=*) SUB_CAN_DRIVER=$optarg;; |
99 --timers=*) SUB_TIMERS_DRIVER=$optarg;; |
97 --timers=*) SUB_TIMERS_DRIVER=$optarg;; |
100 --disable-Ox) DISABLE_OPT=1; |
98 --disable-Ox) DISABLE_OPT=1; |
101 echo "On user request: Won't optimize with \"-Ox\"";; |
99 echo "On user request: Won't optimize with \"-Ox\"";; |
|
100 --disable-dll) DISABLE_DLL=1; |
|
101 echo "On user request: Won't create and link to dll";; |
102 --debug) DEBUG=1; |
102 --debug) DEBUG=1; |
103 echo "Debug messages enabled !!";; |
103 echo "Debug messages enabled !!";; |
104 --debugPDO) DEBUG=PDO; |
104 --debugPDO) DEBUG=PDO; |
105 echo "Debug messages (PDO) enabled !!";; |
105 echo "Debug messages (PDO) enabled !!";; |
106 --desable-timers) SUB_TIMERS_ENABLE=NO; |
|
107 echo "On user request: Will enable built-in timer dispatch Feature";; |
|
108 --MAX_CAN_BUS_ID=*) MAX_CAN_BUS_ID=$1;; |
106 --MAX_CAN_BUS_ID=*) MAX_CAN_BUS_ID=$1;; |
109 --SDO_MAX_LENGTH_TRANSFERT=*) SDO_MAX_LENGTH_TRANSFERT=$1;; |
107 --SDO_MAX_LENGTH_TRANSFERT=*) SDO_MAX_LENGTH_TRANSFERT=$1;; |
110 --SDO_MAX_SIMULTANEOUS_TRANSFERTS=*) SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;; |
108 --SDO_MAX_SIMULTANEOUS_TRANSFERTS=*) SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;; |
111 --NMT_MAX_NODE_ID=*) NMT_MAX_NODE_ID=$1;; |
109 --NMT_MAX_NODE_ID=*) NMT_MAX_NODE_ID=$1;; |
112 --SDO_TIMEOUT_MS=*) SDO_TIMEOUT_MS=$1;; |
110 --SDO_TIMEOUT_MS=*) SDO_TIMEOUT_MS=$1;; |
113 --CANOPEN_BIG_ENDIAN=*) CANOPEN_BIG_ENDIAN=$1;; |
111 --CANOPEN_BIG_ENDIAN=*) CANOPEN_BIG_ENDIAN=$1;; |
114 --MAX_NB_TIMER=*) MAX_NB_TIMER=$1;; |
112 --MAX_NB_TIMER=*) MAX_NB_TIMER=$1;; |
115 --help) echo "Usage: ./configure [options]" |
113 --help) echo "Usage: ./configure [options]" |
116 echo "Options:" |
114 echo "Options:" |
117 echo " --cc=foo Use compiler 'foo' instead of defaults ${CC1} or ${CC2}." |
115 echo " --cc=foo Use compiler 'foo' instead of defaults ${CC1} or ${CC2}." |
118 echo " --arch=foo Use architecture 'foo' instead of trying to autodetect." |
116 echo " --arch=foo Use architecture 'foo' instead of trying to autodetect." |
119 echo " --os=foo Use operative system 'foo' instead of trying to autodetect." |
117 echo " --os=foo Use operative system 'foo' instead of trying to autodetect." |
120 echo " --prefix=foo Use prefix 'foo' instead of default ${SUB_PREFIX}." |
118 echo " --prefix=foo Use prefix 'foo' instead of default ${SUB_PREFIX}." |
121 echo " --target=foo Use 'foo' as build target." |
119 echo " --target=foo Use 'foo' as build target." |
122 echo " \"generic\" for have independant CAN and TIMERS driver" |
120 echo " \"generic\" for have independant CAN and TIMERS driver" |
123 echo " \"unix\" for unix-like systems" |
121 echo " \"unix\" for unix-like systems" |
124 echo " \"win32\" for win32 systems" |
122 echo " \"win32\" for win32 systems" |
125 echo " \"hcs12\" for HCS12 micro-controller" |
123 echo " \"hcs12\" for HCS12 micro-controller" |
126 echo " --can=foo Use 'foo' as CAN driver (can be either 'peak', 'lincan' or 'virtual')" |
124 echo " \"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" |
127 echo " --timers=foo Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')" |
125 echo " --can=foo Use 'foo' as CAN driver" |
128 echo " --disable-Ox Disable gcc \"-Ox\" optimizations." |
126 echo " \"peak_linux\" use Linux build host installed Peak driver and library" |
129 echo " --debug Enable debug messages." |
127 echo " please see http://www.peak-system.com/linux/" |
130 echo " --debugPDO Enable debug messages, using PDO." |
128 echo " \"peak_win32\" use win32 PcanLight Peak driver and library with Cygwin" |
|
129 echo " please see http://www.peak-system.com/themen/download_gb.html" |
|
130 echo " \"virtual\" use unix pipe based virtual can driver" |
|
131 echo " \"socket\" use socket-can " |
|
132 echo " please see http://developer.berlios.de/projects/socketcan/" |
|
133 echo " \"lincan\" for HCS12 micro-controller" |
|
134 echo " please see http://www.ocera.org/download/components/WP7/lincan-0.3.3.html" |
|
135 echo " --timers=foo Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')" |
|
136 echo " --disable-dll Disable run-time dynamic linking of can, led and nvram drivers" |
|
137 echo " --disable-Ox Disable gcc \"-Ox\" optimizations." |
|
138 echo " --debug Enable debug messages." |
|
139 echo " --debugPDO Enable debug messages, using PDO." |
131 echo |
140 echo |
132 echo "Stack compilation constants" |
141 echo "Stack compilation constants" |
133 echo " --MAX_CAN_BUS_ID [=1] Number of can bus to use" |
142 echo " --MAX_CAN_BUS_ID [=1] Number of can bus to use" |
134 echo " --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO" |
143 echo " --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO" |
135 echo " --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently" |
144 echo " --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently" |
333 # Try to gess can |
337 # Try to gess can |
334 if [ "$SUB_CAN_DRIVER" = "" ]; then |
338 if [ "$SUB_CAN_DRIVER" = "" ]; then |
335 if [ "$SUB_TARGET" = "unix" ]; then |
339 if [ "$SUB_TARGET" = "unix" ]; then |
336 if [ -e /usr/lib/libpcan.so ]; then |
340 if [ -e /usr/lib/libpcan.so ]; then |
337 echo "Choosing installed Peak driver as CAN driver." |
341 echo "Choosing installed Peak driver as CAN driver." |
338 SUB_CAN_DRIVER=peak |
342 SUB_CAN_DRIVER=peak_linux |
|
343 elif [ "$SUB_OS_NAME" = "CYGWIN" -a "PCAN_LIB" != "" ]; then |
|
344 echo "Choosing installed Peak driver as CAN driver." |
|
345 SUB_CAN_DRIVER=peak_win32 |
339 else |
346 else |
340 echo "Choosing virtual CAN driver." |
347 echo "Choosing virtual CAN driver." |
341 SUB_CAN_DRIVER=virtual |
348 SUB_CAN_DRIVER=virtual |
342 fi |
349 fi |
343 fi |
|
344 if [ "$SUB_TARGET" = "win32" ]; then |
|
345 echo "CAN driver for windows --Not Implemented--" |
|
346 fi |
350 fi |
347 fi |
351 fi |
348 |
352 |
349 # If target is unix, default timers also |
353 # If target is unix, default timers also |
350 if [ "$SUB_TARGET" = "unix" -a "$SUB_TIMERS_DRIVER" = "" ]; then |
354 if [ "$SUB_TARGET" = "unix" -a "$SUB_TIMERS_DRIVER" = "" ]; then |
397 fi |
401 fi |
398 fi |
402 fi |
399 |
403 |
400 #### CAN_DRIVER #### |
404 #### CAN_DRIVER #### |
401 |
405 |
402 if [ "$SUB_CAN_DRIVER" = "peak" ]; then |
406 if [ "$SUB_CAN_DRIVER" = "peak_linux" ]; then |
403 if [ "$SUB_TIMERS_DRIVER" = "xeno" ]; then |
407 SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -lpcan |
404 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lrtdm |
408 fi |
405 fi |
409 |
406 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -lpcan |
410 PW32DIR=drivers/can_peak_win32 |
407 fi |
|
408 |
|
409 if [ "$SUB_CAN_DRIVER" = "peak_win32" ]; then |
411 if [ "$SUB_CAN_DRIVER" = "peak_win32" ]; then |
410 if [ "$PCAN_HEADER" = "" -o "PCAN_LIB" = "" ]; then |
412 if [ "$PCAN_HEADER" = "" -o "PCAN_LIB" = "" ]; then |
411 echo "!!! ERROR !!! Please set PCAN_LIB PCAN_HEADER [PCAN_INCLUDE] to appropriate paths ! " |
413 echo "!!! ERROR !!! Please set PCAN_LIB PCAN_HEADER [PCAN_INCLUDE] to appropriate paths ! " |
412 fi |
414 fi |
413 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ -liberty\ \'$PCAN_LIB\' |
415 SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ -liberty\ \'$PCAN_LIB\' |
414 echo "Converting PcanLib header files for gcc -> /drivers/can_peak_win32/cancfg.h" |
416 echo "Converting PcanLib header files for gcc -> $PW32DIR/cancfg.h" |
415 cat include/can_peak_win32/cancfg.h.head $PCAN_INCLUDE/$PCAN_HEADER > include/can_peak_win32/cancfg.h |
417 cat $PW32DIR/cancfg.h.head $PCAN_INCLUDE/$PCAN_HEADER > $PW32DIR/cancfg.h |
416 # second port handling |
418 # second port handling |
417 if [ "$PCAN2_HEADER" != "" ]; then |
419 if [ "$PCAN2_HEADER" != "" ]; then |
418 echo "Stripping down second Pcan Light header " |
420 echo "Stripping down second Pcan Light header " |
419 echo >> include/can_peak_win32/cancfg.h |
421 echo >> $PW32DIR/cancfg.h |
420 echo "// Stripped PcanLight header to prevent typedef conflicts ">> include/can_peak_win32/cancfg.h |
422 echo "// Stripped PcanLight header to prevent typedef conflicts ">> $PW32DIR/cancfg.h |
421 echo >> include/can_peak_win32/cancfg.h |
423 echo >> $PW32DIR/cancfg.h |
422 grep __stdcall $PCAN_INCLUDE/$PCAN2_HEADER >> include/can_peak_win32/cancfg.h |
424 grep __stdcall $PCAN_INCLUDE/$PCAN2_HEADER >> $PW32DIR/cancfg.h |
423 SUB_EXE_CFLAGS=$SUB_EXE_CFLAGS\ \'$PCAN2_LIB\' |
425 echo '#define PCAN2_HEADER_' >> $PW32DIR/cancfg.h |
424 echo '#define PCAN2_HEADER_' >> include/can_peak_win32/cancfg.h |
426 SUB_CAN_DLL_CFLAGS=$SUB_CAN_DLL_CFLAGS\ \'$PCAN2_LIB\' |
425 fi |
427 fi |
426 if grep -q CANHwType include/can_peak_win32/cancfg.h ; then |
428 if grep -q CANHwType $PW32DIR/cancfg.h ; then |
427 echo "Peak Init HwType, IO_Port and IRQ will be passed in environment :" |
429 echo "Peak Init HwType, IO_Port and IRQ will be passed in environment :" |
428 echo " PCANHwType PCANIO_Port PCANInterupt" |
430 echo " PCANHwType PCANIO_Port PCANInterupt" |
429 echo '#define extra_PCAN_init_params' >> include/can_peak_win32/cancfg.h |
431 echo '#define extra_PCAN_init_params' >> $PW32DIR/cancfg.h |
430 fi |
432 fi |
431 cat include/can_peak_win32/cancfg.h.tail >> include/can_peak_win32/cancfg.h |
433 cat $PW32DIR/cancfg.h.tail >> $PW32DIR/cancfg.h |
432 fi |
434 fi |
433 |
435 |
434 if [ "$SUB_CAN_DRIVER" = "none" ]; then |
436 if [ "$SUB_CAN_DRIVER" = "none" ]; then |
435 SUB_CAN_DRIVER= |
437 SUB_CAN_DRIVER= |
436 fi |
438 fi |