aug_sysdep.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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 misconfigured
  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(x86_64) || defined(__x86_64)
  138. #if defined(__GNUC__)
  139. #define AUG_CONFIGURATION "Sun Solaris x86_64 with GCC"
  140. #else
  141. #define AUG_CONFIGURATION "Sun Solaris x86_64 with SUNpro C"
  142. #endif
  143. typedef unsigned int augUInt32;
  144. #endif
  145. #if defined(sparc) || defined(__sparc)
  146. #if defined(__svr4__) || defined(__SVR4)
  147. #if defined(__GNUC__)
  148. #define AUG_CONFIGURATION "Sun Solaris 2.x SPARC with GCC"
  149. #else
  150. #define AUG_CONFIGURATION "Sun Solaris 2.x SPARC with SUNpro C"
  151. #endif
  152. #endif /* svr4 */
  153. typedef unsigned int augUInt32;
  154. #endif /* sparc */
  155. #endif /* sun */
  156. /*
  157. ----------------------------------------------------------------------------
  158. ----- Linux x86 with GCC ---------------------------------------------------
  159. ----------------------------------------------------------------------------
  160. */
  161. #ifdef __linux
  162. #define AUG_HAS_LPR
  163. #define AUG_HAS_RANDOM /* Actually has AUG_HAS_RAND48 too */
  164. #define AUG_HAS_PSAX
  165. /* AUG_DEBIAN supplied on cc command line where appropriate */
  166. #ifndef AUG_DEBIAN
  167. #define AUG_NO_CRYPT_H
  168. #endif
  169. #if __GNUC__ <= 2 && __GNUC_MINOR__ <= 7
  170. /* Basically, assume this is a really of version of Linux -- ie "gomer" */
  171. #define AUG_NO_PTHREADS
  172. #endif
  173. #if defined(__i386)
  174. #if defined(__GNUC__)
  175. #define AUG_CONFIGURATION "Linux x86 with GCC"
  176. #endif
  177. typedef unsigned int augUInt32;
  178. #endif /* x86 */
  179. #if defined(__x86_64)
  180. #if defined(__GNUC__)
  181. #define AUG_CONFIGURATION "Linux x86_64 with GCC"
  182. #endif
  183. typedef unsigned int augUInt32;
  184. #endif /* x86-64 */
  185. #endif /* linux */
  186. /*
  187. ----------------------------------------------------------------------------
  188. ----- FreeBSD x86 with GCC -------------------------------------------------
  189. ----------------------------------------------------------------------------
  190. */
  191. #ifdef __FreeBSD__
  192. #define AUG_HAS_LPR
  193. #define AUG_HAS_RANDOM
  194. #define AUG_HAS_PSAX
  195. #define AUG_HAS_PREAD
  196. #define AUG_NO_CRYPT_H
  197. #define AUG_NO_TERMIO_H
  198. #define AUG_NO_DB
  199. /* FreeBSD lacks these error codes. */
  200. #define ENODATA ENOBUFS
  201. #define EPROTO EPROTOTYPE
  202. #define EUNATCH ENOPROTOOPT
  203. /* FreeBSD lacks these termios codes. */
  204. #define TCGETS TIOCGETA
  205. #define TCSETS TIOCSETA
  206. #define TCGETA TIOCGETA
  207. #define TCSETA TIOCSETA
  208. #define TCSETSW TIOCSETAW
  209. #define TCFLSH TIOCFLUSH
  210. #define termio termios
  211. #if defined(__i386)
  212. #if defined(__GNUC__)
  213. #define AUG_CONFIGURATION "FreeBSD x86 with GCC"
  214. #endif
  215. typedef unsigned int augUInt32;
  216. #endif /* x86 */
  217. #if defined(__x86_64)
  218. #if defined(__GNUC__)
  219. #define AUG_CONFIGURATION "FreeBSD x86_64 with GCC"
  220. #endif
  221. typedef unsigned int augUInt32;
  222. #endif /* x86_64 */
  223. #endif /* freebsd */
  224. /*
  225. ----------------------------------------------------------------------------
  226. ----- HP-UX pa-risc with HP C ----------------------------------------------
  227. ----------------------------------------------------------------------------
  228. */
  229. #ifdef __hpux
  230. #define AUG_BAD_FD_SET /* Not even fixed in HP-UX 10.x */
  231. #define AUG_HAS_LP
  232. #define AUG_HAS_LP_REQUEST
  233. #define AUG_HAS_RAND48
  234. #define AUG_HAS_SINCOS
  235. #if !defined(__GNUC__)
  236. #define AUG_CONFIGURATION "HP-UX pa-risc with HP C"
  237. #endif
  238. typedef unsigned int augUInt32;
  239. #endif /* hpux */
  240. /*
  241. ----------------------------------------------------------------------------
  242. ----- AIX Configuration with xlC -------------------------------------------
  243. ----------------------------------------------------------------------------
  244. */
  245. #ifdef _AIX
  246. #define AUG_HAS_LP
  247. #define AUG_HAS_LP_REQUEST
  248. #define AUG_HAS_SELECT_H
  249. #define AUG_HAS_RAND48
  250. #define AUG_NO_CRYPT_H
  251. #if !defined(__GNUC__)
  252. #define AUG_CONFIGURATION "AIX Configuration with xlC"
  253. #endif
  254. typedef unsigned int augUInt32;
  255. #endif /* _AIX */
  256. /*
  257. ----------------------------------------------------------------------------
  258. ----- Sun IUS with GCC (formerly Interactive Unix) -----------------------
  259. ----------------------------------------------------------------------------
  260. */
  261. /*
  262. ** This is only sufficient to build a basic libaug.a so selected
  263. ** utilities can be ported with relative ease.
  264. **
  265. ** None of the folio stuff builds (no unix domain sockets), so when
  266. ** collecting a fresh copy of $AUG/libaug, run "rm -f *fol*".
  267. */
  268. #ifndef _AIX /* xlC can't handle these expressions */
  269. #if #system(svr3) && #cpu(i386)
  270. #define AUG_HAS_LP
  271. #define AUG_HAS_RAND48
  272. #define AUG_NO_CRYPT_H
  273. #define AUG_CONFIGURATION "Sun IUS x86 with GCC"
  274. typedef unsigned int augUInt32;
  275. #include <sys/bsdtypes.h>
  276. #endif /* IUS */
  277. #endif /* ! _AIX */
  278. /*
  279. ----------------------------------------------------------------------------
  280. */
  281. #ifndef AUG_CONFIGURATION
  282. #error: os/cpu/compiler combination not configured in $Source$ $Revision$
  283. #endif
  284. #endif /* AUG_SYSDEP_H */