aug_sysdep.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. /*
  2. * $Id$
  3. *
  4. * POSTGRES module, portions of this code were templated using
  5. * the mysql module, thus it's similarity.
  6. *
  7. *
  8. * Copyright (C) 2003 August.Net Services, LLC
  9. *
  10. * This file is part of ser, a free SIP server.
  11. *
  12. * ser is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2 of the License, or
  15. * (at your option) any later version
  16. *
  17. * For a license to use the ser software under conditions
  18. * other than those described here, or to purchase support for this
  19. * software, please contact iptel.org by e-mail at the following addresses:
  20. * [email protected]
  21. *
  22. * ser is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  30. *
  31. * ---
  32. *
  33. * History
  34. * -------
  35. * 2003-04-06 initial code written (Greg Fausak/Andy Fullford)
  36. *
  37. */
  38. /*
  39. ** ________________________________________________________________________
  40. **
  41. **
  42. ** $RCSfile$
  43. ** $Revision$
  44. **
  45. ** Last change $Date$
  46. ** Last change $Author$
  47. ** $State$
  48. ** $Locker$
  49. **
  50. ** Original author: Andrew Fullford
  51. **
  52. ** Copyright (C) August Associates 1995
  53. **
  54. ** ________________________________________________________________________
  55. */
  56. /* AM_TYPE: (INSTALL_INC) */
  57. #ifndef AUG_SYSDEP_H
  58. #define AUG_SYSDEP_H
  59. /*
  60. ** As necessary, detect operating system, cpu, and compiler
  61. ** combinations, and establish defines that describe the
  62. ** characteristics and requirements for the combination.
  63. **
  64. ** As each special case is encountered elsewhere in the code,
  65. ** a new define should be added here for each affected system.
  66. **
  67. ** Defines take names like:
  68. **
  69. ** AUG_HAS_xxxx System has capability xxxx
  70. ** AUG_NO_xxxx System doesn't have capability xxxx
  71. ** AUG_BAD_xxxx System has xxxx, but it's broken
  72. **
  73. ** Every system gets AUG_CONFIGURATION so we can reject unconfigured
  74. ** compiles. This should be set to an os/cpu/compiler description.
  75. */
  76. #undef AUG_CONFIGURATION
  77. /*
  78. ** This list should be maintained as the definitive list of capabilities.
  79. ** Add each new define here with a description and then in each system
  80. ** dependent section as appropriate.
  81. **
  82. ** Please stick to the "#undef" format -- the aug_sysdep.sh script
  83. ** uses these to report configurations.
  84. */
  85. #undef AUG_HAS_SELECT_H /* Select macros in <sys/select.h> instead of
  86. <sys/time.h> or <sys/time.h> */
  87. #undef AUG_BAD_FD_SET /* FD_SET et al are broken (HP-UX) */
  88. #undef AUG_HAS_LP /* SysV style "lp" and "lpstat" commands */
  89. #undef AUG_HAS_LP_REQUEST /* Has the /usr/spool/lp/request directory.
  90. Probably only ever in HP-UX */
  91. #undef AUG_HAS_LPR /* BSD style "lpr" and "/etc/printcap" */
  92. #undef AUG_NO_PUTENV /* Use setenv() instead of putenv() */
  93. #undef AUG_HAS_PREAD /* Has pread() (combined seek/read) */
  94. /* If neither AUG_HAS_RAND48 nor AUG_HAS_RANDOM, rand() will be used */
  95. #undef AUG_HAS_RAND48 /* Has lrand48/srand48 calls */
  96. #undef AUG_HAS_RANDOM /* Has random/srandom calls */
  97. #undef AUG_HAS_SINCOS /* -libm has a fast sincos() implementation */
  98. #undef AUG_NO_IOVEC /* Some system may not have readv/writev */
  99. #undef AUG_NO_TIMES /* Some system may not have times(2) */
  100. #undef AUG_HAS_PSAX /* ps takes "-ax" arg to show all procs */
  101. #undef AUG_NO_TZARG /* get/settimeofday takes no timezone arg */
  102. #undef AUG_NO_CRYPT_H /* crypt(3) declared in unistd.h instead of
  103. crypt.h. */
  104. #undef AUG_NO_TERMIOS /* System does not have the termios interface */
  105. #undef AUG_NO_TERMIO_H /* No termio.h, only termios.h used */
  106. #undef AUG_NO_DB /* System doesn't support UCB's db(3) */
  107. #undef AUG_NO_GETPAGESIZE /* System does not have getpagesize() */
  108. #undef AUG_NO_PTHREADS /* System does not have Posix Threads support */
  109. /*
  110. ----------------------------------------------------------------------------
  111. ----- SGI Irix with sgi C --------------------------------------------------
  112. ----------------------------------------------------------------------------
  113. */
  114. #if defined(sgi) || defined(__sgi) || defined(__sgi__)
  115. #define AUG_HAS_LP
  116. #define AUG_CONFIGURATION "SGI Irix with sgi C"
  117. #define AUG_HAS_RAND48
  118. typedef unsigned int augUInt32;
  119. #endif /* sgi */
  120. /*
  121. ----------------------------------------------------------------------------
  122. ----- Sun Solaris 2.x on SPARC or x86, with SUNpro C or GCC ----------------
  123. ----------------------------------------------------------------------------
  124. */
  125. #if defined(sun) || defined(__sun) || defined(__sun__)
  126. #define AUG_HAS_LP
  127. #define AUG_HAS_PREAD
  128. #define AUG_HAS_RAND48
  129. #if defined(i386) || defined(__i386)
  130. #if defined(__GNUC__)
  131. #define AUG_CONFIGURATION "Sun Solaris x86 with GCC"
  132. #else
  133. #define AUG_CONFIGURATION "Sun Solaris x86 with SUNpro C"
  134. #endif
  135. typedef unsigned int augUInt32;
  136. #endif
  137. #if defined(sparc) || defined(__sparc)
  138. #if defined(__svr4__) || defined(__SVR4)
  139. #if defined(__GNUC__)
  140. #define AUG_CONFIGURATION "Sun Solaris 2.x SPARC with GCC"
  141. #else
  142. #define AUG_CONFIGURATION "Sun Solaris 2.x SPARC with SUNpro C"
  143. #endif
  144. #endif /* svr4 */
  145. typedef unsigned int augUInt32;
  146. #endif /* sparc */
  147. #endif /* sun */
  148. /*
  149. ----------------------------------------------------------------------------
  150. ----- Linux x86 with GCC ---------------------------------------------------
  151. ----------------------------------------------------------------------------
  152. */
  153. #ifdef __linux
  154. #define AUG_HAS_LPR
  155. #define AUG_HAS_RANDOM /* Actually has AUG_HAS_RAND48 too */
  156. #define AUG_HAS_PSAX
  157. /* AUG_DEBIAN supplied on cc command line where appropriate */
  158. #ifndef AUG_DEBIAN
  159. #define AUG_NO_CRYPT_H
  160. #endif
  161. #if __GNUC__ <= 2 && __GNUC_MINOR__ <= 7
  162. /* Basically, assume this is a really of version of Linux -- ie "gomer" */
  163. #define AUG_NO_PTHREADS
  164. #endif
  165. #if defined(__i386)
  166. #if defined(__GNUC__)
  167. #define AUG_CONFIGURATION "Linux x86 with GCC"
  168. #endif
  169. typedef unsigned int augUInt32;
  170. #endif /* i386 */
  171. #endif /* linux */
  172. /*
  173. ----------------------------------------------------------------------------
  174. ----- FreeBSD x86 with GCC -------------------------------------------------
  175. ----------------------------------------------------------------------------
  176. */
  177. #ifdef __FreeBSD__
  178. #define AUG_HAS_LPR
  179. #define AUG_HAS_RANDOM
  180. #define AUG_HAS_PSAX
  181. #define AUG_HAS_PREAD
  182. #define AUG_NO_CRYPT_H
  183. #define AUG_NO_TERMIO_H
  184. #define AUG_NO_DB
  185. /* FreeBSD lacks these error codes. */
  186. #define ENODATA ENOBUFS
  187. #define EPROTO EPROTOTYPE
  188. #define EUNATCH ENOPROTOOPT
  189. /* FreeBSD lacks these termios codes. */
  190. #define TCGETS TIOCGETA
  191. #define TCSETS TIOCSETA
  192. #define TCGETA TIOCGETA
  193. #define TCSETA TIOCSETA
  194. #define TCSETSW TIOCSETAW
  195. #define TCFLSH TIOCFLUSH
  196. #define termio termios
  197. #if defined(__i386)
  198. #if defined(__GNUC__)
  199. #define AUG_CONFIGURATION "FreeBSD x86 with GCC"
  200. #endif
  201. typedef unsigned int augUInt32;
  202. #endif /* i386 */
  203. #endif /* freebsd */
  204. /*
  205. ----------------------------------------------------------------------------
  206. ----- HP-UX pa-risc with HP C ----------------------------------------------
  207. ----------------------------------------------------------------------------
  208. */
  209. #ifdef __hpux
  210. #define AUG_BAD_FD_SET /* Not even fixed in HP-UX 10.x */
  211. #define AUG_HAS_LP
  212. #define AUG_HAS_LP_REQUEST
  213. #define AUG_HAS_RAND48
  214. #define AUG_HAS_SINCOS
  215. #if !defined(__GNUC__)
  216. #define AUG_CONFIGURATION "HP-UX pa-risc with HP C"
  217. #endif
  218. typedef unsigned int augUInt32;
  219. #endif /* hpux */
  220. /*
  221. ----------------------------------------------------------------------------
  222. ----- AIX Configuration with xlC -------------------------------------------
  223. ----------------------------------------------------------------------------
  224. */
  225. #ifdef _AIX
  226. #define AUG_HAS_LP
  227. #define AUG_HAS_LP_REQUEST
  228. #define AUG_HAS_SELECT_H
  229. #define AUG_HAS_RAND48
  230. #define AUG_NO_CRYPT_H
  231. #if !defined(__GNUC__)
  232. #define AUG_CONFIGURATION "AIX Configuration with xlC"
  233. #endif
  234. typedef unsigned int augUInt32;
  235. #endif /* _AIX */
  236. /*
  237. ----------------------------------------------------------------------------
  238. ----- Sun IUS with GCC (formerly Interactive Unix) -----------------------
  239. ----------------------------------------------------------------------------
  240. */
  241. /*
  242. ** This is only sufficient to build a basic libaug.a so selected
  243. ** utilities can be ported with relative ease.
  244. **
  245. ** None of the folio stuff builds (no unix domain sockets), so when
  246. ** collecting a fresh copy of $AUG/libaug, run "rm -f *fol*".
  247. */
  248. #ifndef _AIX /* xlC can't handle these expressions */
  249. #if #system(svr3) && #cpu(i386)
  250. #define AUG_HAS_LP
  251. #define AUG_HAS_RAND48
  252. #define AUG_NO_CRYPT_H
  253. #define AUG_CONFIGURATION "Sun IUS x86 with GCC"
  254. typedef unsigned int augUInt32;
  255. #include <sys/bsdtypes.h>
  256. #endif /* IUS */
  257. #endif /* ! _AIX */
  258. /*
  259. ----------------------------------------------------------------------------
  260. */
  261. #ifndef AUG_CONFIGURATION
  262. error: os/cpu/compiler combination not configured in $Source$ $Revision$
  263. #endif
  264. #endif /* AUG_SYSDEP_H */