jack1 codebase
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.

120 lines
4.3KB

  1. /*
  2. * This file documents the process of porting JACK to new platforms.
  3. * It is part of the JACK reference manual, built using doxygen.
  4. */
  5. /**
  6. @page porting-guide Porting JACK
  7. The @ref index is designed to be portable to any system supporting the
  8. relevant POSIX and C language standards. It currently works with
  9. GNU/Linux and Mac OS X on several different processor architectures.
  10. This document describes the steps needed to port JACK to another
  11. platform, and the methods used to provide portability.
  12. - @ref portrequirements
  13. - @ref portoverview
  14. - @ref portopsys
  15. - @ref portcpu
  16. - @ref portissues
  17. @section portrequirements Requirements
  18. - Each platform should build directly from CVS or from a tarball
  19. using the GNU @c ./configure tools. Platform-specific toolsets can
  20. by used for development, but the GNU tools should at least work for
  21. basic distribution and configuration.
  22. - For long-term maintainability we want to minimize the use of
  23. conditional compilation in source files.
  24. - We should provide generic versions of all system-dependent
  25. headers, so platforms need only provide those they modify.
  26. - In some cases, operating system-specific information must be able
  27. to override processor-specific data.
  28. @section portoverview Overview
  29. JACK relies on two types of platform-specific headers:
  30. - @ref portopsys
  31. - @ref portcpu
  32. OS-specific headers take precedence over CPU-specific headers.
  33. The JACK @c configure.host script and its system-dependent header
  34. directories were adapted from the @c libstdc++-v3 component of the GNU
  35. Compiler Collective, <http://gcc.gnu.org>.
  36. @section portopsys Operating System Dependencies
  37. JACK is intended to conform with C99, as defined in International
  38. Standard ISO/IEC 9899. Because many existing C compilers do not fully
  39. support this standard, some new features should be avoided for better
  40. portablility. For example, variables should not be declared in the
  41. middle of a compound statement, because many compilers still cannot
  42. handle that extension to the language.
  43. Whenever possible, OS dependencies should be isolated in OS-specific
  44. header files. Each target OS may optionally provide a @c
  45. <sysdeps/os_defines.h> header, otherwise @c
  46. conf/os/generic/os_defines.h will be used. The @c configure.host
  47. script distinguishes OS variations using a case statement based on the
  48. host system's type and version.
  49. Some needed POSIX features may be missing on certain platforms. If
  50. so, the preferred solution is to provide a substitute, like the @c
  51. fakepoll.c implementation for Mac OS X.
  52. If conditional compilation is required in mainline
  53. platform-independent code, avoid using the system name. Instead, @c
  54. #define a descriptive name in your @c <sysdeps/os_defines.h>, and test
  55. it like this:
  56. @code
  57. #ifdef JACK_USE_MACH_THREADS
  58. allocate_mach_serverport(engine, client);
  59. client->running = FALSE;
  60. #endif
  61. @endcode
  62. Be sure to place any generic implementation alternative in the @c
  63. #else or use an @c #ifndef, so other OS ports are not required to know
  64. your platform's conditional labels.
  65. @section portcpu Processor Dependencies
  66. JACK uses some low-level machine operations for thread-safe updates to
  67. shared memory. A low-level implementation of @c <sysdeps/atomicity.h>
  68. is provided for every target processor architecture. There is also a
  69. generic implementation using POSIX spin locks, but that is not a good
  70. enough solution for serious use.
  71. The GCC package provides versions that work on most modern hardware.
  72. We've tried to keep things as close to the original as possible, while
  73. removing a bunch of os-specific files that didn't seem relevant. A
  74. primary goal has been to avoid changing the CPU-dependent @c
  75. <sysdeps/atomicity.h> headers.
  76. The relevant GCC documentation provides some helpful background,
  77. especially the @c atomicity.h discussion at
  78. <http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html>.
  79. @section portissues Issues Not Addressed
  80. - Cross-compilation has not been tested, or even thought through in
  81. much detail. The @a host is the system on which JACK will run.
  82. This may differ from the @a build system doing the compilation.
  83. These are selected using the standard @c ./configure options @c
  84. --host and @c --build. Usually, @c ./config.guess can print the
  85. appropriate canonical name for any system on which it runs.
  86. - Platform-specific build tools like Apple's Project Builder are not
  87. well-supported.
  88. */