Testing out the PPD42 Air Quality Sensor, with an MSP430 Launchpad and graphing the data with GNUplot.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
5.1 KiB

5 years ago
  1. This is PORTING Tue Nov 13 14:45:26 MST 2001
  2. If you want to port rxtx to a new Unix platform do the following.
  3. *IMPORTANT* you will need gnu make.
  4. There are probably three areas you will need to focus on:
  5. configure.in
  6. src/SerialImp.c src/SerialImp.h src/ParallelImp.c
  7. RXTXCommDriver.java (just add the ports for your OS)
  8. configure.in grabs information about the OS, Java, ... and tries to set sane
  9. values for the Makefile. Look towards the bottom of configure.in and just
  10. copy *bsd or HP-UX. Modify to your liking.
  11. Edit configure.in, run autoconf, run configure, run make. repeat. An endless
  12. loop analagous to shampoo instructions.
  13. SerialImp.c and ParallelImp.c may require system specific includes and possibly
  14. a small amount of #ifdef's in the code. Lock file information will need to
  15. be added to SerialImp.h
  16. SerialImp.h will need defines for the location of lock files and the lock file
  17. type if they are used. See BSD or Linux as examples.
  18. Common problems include the following varibles in the Makefile
  19. JAVAINCLUDE
  20. JAVANATINC
  21. CLASSPATH
  22. Which are defined in configure.in
  23. We will gladly help with any UNIX platform. Send questions to
  24. taj@www.linux.org.uk. New OS's usually require tweaks.
  25. If its not compiling try backing out functionality until it compiles.
  26. win32 support has not been tested. Contact taj@www.linux.org.uk if your
  27. interested in developing win32 support.
  28. For all Unix flavors... If the package did not work out of the box please
  29. see BUGS and send a comment.
  30. Here are more details sent to the rxtx mail list:
  31. Here are some tips for starters.
  32. There are three files you will need to modify.
  33. configure.in
  34. HP-UX)
  35. # compiler flags required to build. Often enables POSIX termios
  36. # support and related #defines
  37. CFLAGS="-g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1
  38. -D_NO_XOPEN4=1"
  39. # location for the library libSerial.so
  40. RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
  41. #Libraries to build. libSerial.la and libParallel.la are options
  42. # libSerial.la is usually ported first and has had more work/tests
  43. TARGETLIB="\$(target_alias)/libSerial.la"
  44. # Handle java quirks here.
  45. case $JAVA_VERSION in
  46. HP-UX\ Java\ C.01.2*|HP-UX\ Java\ C.01.3*)
  47. # function call
  48. fix_parameters $JPATH/jre/lib/javax.comm.properties
  49. # location for comm.jar and jcl.jar (RXTX)
  50. JHOME=$JPATH"/jre/lib/ext"
  51. # classpath for building (hackish)
  52. CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/jre/lib/ext/comm.jar:$CLASSPATH"
  53. # location for libSerial.so .. again I see.
  54. RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
  55. ;;
  56. *)
  57. echo "$JAVA_VERSION untests"
  58. # possibly more java specific cases...
  59. esac;
  60. That should be enough to get Makefile with autoconf/automake/configure.
  61. the autogen.sh script can be used to bring the version of scripts you have
  62. into the top rxtx directory. Helpfull if you cant get the same versions
  63. used. hmm I need to update the INSTALL info here.
  64. libtool 1.3.5
  65. autoconf 2.13
  66. automake 1.4
  67. gnu make 3.79.1
  68. Makefile.am is changed to create new Makefiles
  69. Makefile.in is generated from it with automake
  70. Makefile is generated with the configure script
  71. configure.in is changed to create new configure scripts
  72. configure is generated from configure.in with automake
  73. A hard coded Makefile is also possible. I can send you the output of a
  74. typical make session off the list if you like.
  75. Source changes:
  76. RXTXCommDriver.java
  77. Port enumeration needs to know which ports to check.
  78. private void registerScannedPorts(int PortType){}
  79. has code like the following listing the ports on that system. Again
  80. os.name is used to determine the system.
  81. ....
  82. else if(osName.equals("HP-UX"))
  83. {
  84. String[] Temp = {
  85. "tty0p",// HP-UX serial ports
  86. "tty1p" // HP-UX serial ports
  87. };
  88. CandidatePortPrefixes=Temp;
  89. }
  90. Next, one should fix the port locking. RXTX supports FHS locks, UUCP and
  91. no locks. One could start with no locking at first and then add the lock
  92. capability later:
  93. SerialImp.h
  94. #if defined(__hpux__)
  95. /* modif cath */
  96. /* The directory the device files are in */
  97. # define DEVICEDIR "/dev/"
  98. /* the directory to place the lock files */
  99. # define LOCKDIR "/usr/spool/uucp"
  100. /* what the prefix is for lockfiles example: LK.134.124.124 */
  101. # define LOCKFILEPREFIX "LK."
  102. /* UUCP of FHS locking */
  103. # define UUCP
  104. #endif /* __hpux__ */
  105. for starters you may do something like:
  106. #if defined(WIN32)
  107. # define DEVICEDIR ""
  108. # define LOCKDIR ""
  109. # define LOCKFILEPREFIX ""
  110. #endif /* WIN32 */
  111. to disable lock files.
  112. That should be it. Some changes to SerialImp.c may be needed for compiler
  113. errors.