Config.FreeBSD.pp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. //
  2. // Config.FreeBSD.pp
  3. //
  4. // This file defines some custom config variables for the FreeBSD
  5. // platform. It makes some initial guesses about compiler features,
  6. // etc.
  7. //
  8. // *******************************************************************
  9. // NOTE: you should not attempt to copy this file verbatim as your own
  10. // personal Config.pp file. Instead, you should start with an empty
  11. // Config.pp file, and add lines to it when you wish to override
  12. // settings given in here. In the normal ppremake system, this file
  13. // will always be read first, and then your personal Config.pp file
  14. // will be read later, which gives you a chance to override the
  15. // default settings found in this file. However, if you start by
  16. // copying the entire file, it will be difficult to tell which
  17. // settings you have customized, and it will be difficult to upgrade
  18. // to a subsequent version of Panda.
  19. // *******************************************************************
  20. #define IS_FREEBSD 1
  21. // Compiler flags
  22. // How to invoke the C and C++ compilers.
  23. #if $[eq $[USE_COMPILER], GCC]
  24. #define CC gcc
  25. #define CXX g++
  26. #define AR ar
  27. // gcc might run into template limits on some parts of Panda.
  28. // I upped this from 25 to build on OS X (GCC 3.3) -- skyler.
  29. #define C++FLAGS_GEN -ftemplate-depth-30
  30. #else
  31. #define CC cc
  32. #define CXX CC
  33. #define AR ar
  34. #endif
  35. // FreeBSD doesn't (yet) have any funny architecture flags.
  36. #defer ARCH_FLAGS
  37. // How to compile a C or C++ file into a .o file. $[target] is the
  38. // name of the .o file, $[source] is the name of the source file,
  39. // $[ipath] is a space-separated list of directories to search for
  40. // include files, and $[flags] is a list of additional flags to pass
  41. // to the compiler.
  42. #defer COMPILE_C $[CC] $[CFLAGS_GEN] $[ARCH_FLAGS] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  43. #defer COMPILE_C++ $[CXX] $[C++FLAGS_GEN] $[ARCH_FLAGS] -c -o $[target] $[ipath:%=-I%] $[flags] $[source]
  44. // What flags should be passed to both C and C++ compilers to enable
  45. // debug symbols? This will be supplied when OPTIMIZE (above) is set
  46. // to 1, 2, or 3.
  47. #defer DEBUGFLAGS -g
  48. // What flags should be passed to both C and C++ compilers to enable
  49. // compiler optimizations? This will be supplied when OPTIMIZE
  50. // (above) is set to 2, 3, or 4.
  51. #defer OPTFLAGS -O2
  52. // By convention, any source file that contains the string _no_opt_ in
  53. // its filename won't have the above compiler optimizations run for it.
  54. #defer no_opt $[findstring _no_opt_,$[source]]
  55. // What define variables should be passed to the compilers for each
  56. // value of OPTIMIZE? We separate this so we can pass these same
  57. // options to interrogate, guaranteeing that the correct interfaces
  58. // are generated. Do not include -D here; that will be supplied
  59. // automatically.
  60. #defer CDEFINES_OPT1 $[EXTRA_CDEFS]
  61. #defer CDEFINES_OPT2 $[EXTRA_CDEFS]
  62. #defer CDEFINES_OPT3 $[EXTRA_CDEFS]
  63. #defer CDEFINES_OPT4 $[EXTRA_CDEFS]
  64. // What additional flags should be passed for each value of OPTIMIZE
  65. // (above)? We separate out the compiler-optimization flags, above,
  66. // so we can compile certain files that give optimizers trouble (like
  67. // the output of lex and yacc) without them, but with all the other
  68. // relevant flags.
  69. #defer CFLAGS_OPT1 $[CDEFINES_OPT1:%=-D%] -Wall $[DEBUGFLAGS]
  70. #defer CFLAGS_OPT2 $[CDEFINES_OPT2:%=-D%] -Wall $[DEBUGFLAGS] $[if $[no_opt],,$[OPTFLAGS]]
  71. #defer CFLAGS_OPT3 $[CDEFINES_OPT3:%=-D%] $[DEBUGFLAGS] $[if $[no_opt],,$[OPTFLAGS]]
  72. #defer CFLAGS_OPT4 $[CDEFINES_OPT4:%=-D%] $[if $[no_opt],,$[OPTFLAGS]]
  73. // What additional flags should be passed to both compilers when
  74. // building shared (relocatable) sources? Some architectures require
  75. // special support for this.
  76. #defer CFLAGS_SHARED -fPIC
  77. // How to generate a C or C++ executable from a collection of .o
  78. // files. $[target] is the name of the binary to generate, and
  79. // $[sources] is the list of .o files. $[libs] is a space-separated
  80. // list of dependent libraries, and $[lpath] is a space-separated list
  81. // of directories in which those libraries can be found.
  82. #defer LINK_BIN_C $[cc_ld] $[ARCH_FLAGS] -o $[target] $[sources] $[flags] $[lpath:%=-L%] $[libs:%=-l%]\
  83. $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[bin_frameworks]]
  84. #defer LINK_BIN_C++ $[cxx_ld] $[ARCH_FLAGS] \
  85. -o $[target] $[sources]\
  86. $[flags]\
  87. $[lpath:%=-L%] $[libs:%=-l%]\
  88. $[fpath:%=-Wl,-F%] $[patsubst %,-framework %, $[bin_frameworks]]
  89. // How to generate a static C or C++ library. $[target] is the
  90. // name of the library to generate, and $[sources] is the list of .o
  91. // files that will go into the library.
  92. #defer STATIC_LIB_C $[AR] cru $[target] $[sources]
  93. #defer STATIC_LIB_C++ $[AR] cru $[target] $[sources]
  94. // How to run ranlib, if necessary, after generating a static library.
  95. // $[target] is the name of the library. Set this to the empty string
  96. // if ranlib is not necessary on your platform.
  97. #defer RANLIB ranlib $[target]
  98. // Where to put the so_locations file, used by an Irix MIPSPro
  99. // compiler, to generate a map of shared library memory locations.
  100. #defer SO_LOCATIONS $[DTOOL_INSTALL]/etc/so_locations
  101. // How to generate a shared C or C++ library. $[source] and $[target]
  102. // as above, and $[libs] is a space-separated list of dependent
  103. // libraries, and $[lpath] is a space-separated list of directories in
  104. // which those libraries can be found.
  105. #defer SHARED_LIB_C $[cc_ld] -shared $[LFLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  106. #defer SHARED_LIB_C++ $[cxx_ld] -shared $[LFLAGS] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  107. #define BUNDLE_LIB_C++
  108. // How to install a data file or executable file. $[local] is the
  109. // local name of the file to install, and $[dest] is the name of the
  110. // directory to put it in.
  111. // On Unix systems, we strongly prefer using the install program to
  112. // install files. This has nice features like automatically setting
  113. // the permissions bits, and also is usually clever enough to install
  114. // a running program without crashing the running instance. However,
  115. // it doesn't understanding installing a program from a subdirectory,
  116. // so we have to cd into the source directory first.
  117. #defer install_dash_p $[if $[KEEP_TIMESTAMPS],-p,]
  118. #defer INSTALL $[if $[ne $[dir $[local]], ./],cd ./$[dir $[local]] &&] install -m $[INSTALL_UMASK_DATA] $[install_dash_p] $[notdir $[local]] $[dest]/
  119. #defer INSTALL_PROG $[if $[ne $[dir $[local]], ./],cd ./$[dir $[local]] &&] install -m $[INSTALL_UMASK_PROG] $[install_dash_p] $[notdir $[local]] $[dest]/
  120. // What additional flags should we pass to interrogate?
  121. #if $[eq $[shell uname -m], amd64] // if FreeBSD is 64bit
  122. #define SYSTEM_IGATE_FLAGS -D_LP64 -D__const=const -Dvolatile -Dmutable
  123. #else
  124. #define SYSTEM_IGATE_FLAGS -D__i386__ -D__const=const -Dvolatile -Dmutable
  125. #endif
  126. // Is the platform big-endian (like an SGI workstation) or
  127. // little-endian (like a PC)? Define this to the empty string to
  128. // indicate little-endian, or nonempty to indicate big-endian.
  129. #define WORDS_BIGENDIAN
  130. // Does the C++ compiler support namespaces?
  131. #define HAVE_NAMESPACE 1
  132. // Does the C++ compiler support ios::binary?
  133. #define HAVE_IOS_BINARY 1
  134. // How about the typename keyword?
  135. #define HAVE_TYPENAME 1
  136. // Will the compiler avoid inserting extra bytes in structs between a
  137. // base struct and its derived structs? It is safe to define this
  138. // false if you don't know, but if you know that you can get away with
  139. // this you may gain a tiny performance gain by defining this true.
  140. // If you define this true incorrectly, you will get lots of
  141. // assertion failures on execution.
  142. #define SIMPLE_STRUCT_POINTERS
  143. // Does gettimeofday() take only one parameter?
  144. #define GETTIMEOFDAY_ONE_PARAM
  145. // Do we have getopt() and/or getopt_long_only() built into the
  146. // system?
  147. #define HAVE_GETOPT 1
  148. #define HAVE_GETOPT_LONG_ONLY 1
  149. // Are the above getopt() functions defined in getopt.h, or somewhere else?
  150. #define PHAVE_GETOPT_H 1
  151. // Can we determine the terminal width by making an ioctl(TIOCGWINSZ) call?
  152. #define IOCTL_TERMINAL_WIDTH 1
  153. // Do the system headers define a "streamsize" typedef? How about the
  154. // ios::binary enumerated value? And other ios typedef symbols like
  155. // ios::openmode and ios::fmtflags?
  156. #define HAVE_STREAMSIZE 1
  157. #define HAVE_IOS_BINARY 1
  158. #define HAVE_IOS_TYPEDEFS 1
  159. // Can we safely call getenv() at static init time?
  160. #define STATIC_INIT_GETENV 1
  161. // Can we read the files /proc/self/* to determine our
  162. // environment variables at static init time?
  163. #define HAVE_PROC_CURPROC_FILE 1
  164. #define HAVE_PROC_CURPROC_MAP 1
  165. #define HAVE_PROC_CURPROC_CMDLINE 1
  166. // Do we have a global pair of argc/argv variables that we can read at
  167. // static init time? Should we prototype them? What are they called?
  168. #define HAVE_GLOBAL_ARGV
  169. #define PROTOTYPE_GLOBAL_ARGV
  170. #define GLOBAL_ARGV
  171. #define GLOBAL_ARGC
  172. // Should we include <iostream> or <iostream.h>? Define PHAVE_IOSTREAM
  173. // to nonempty if we should use <iostream>, or empty if we should use
  174. // <iostream.h>.
  175. #define PHAVE_IOSTREAM 1
  176. // Do we have a true stringstream class defined in <sstream>?
  177. #define PHAVE_SSTREAM 1
  178. // Does fstream::open() require a third parameter, specifying the
  179. // umask? Versions of gcc prior to 3.2 had this.
  180. #define HAVE_OPEN_MASK
  181. // Do we have the lockf() function available?
  182. #define HAVE_LOCKF 1
  183. // Do the compiler or system libraries define wchar_t for you?
  184. #define HAVE_WCHAR_T 1
  185. // Does <string> define the typedef wstring? Most do, but for some
  186. // reason, versions of gcc before 3.0 didn't do this.
  187. #define HAVE_WSTRING 1
  188. // Do we have <new>?
  189. #define PHAVE_NEW 1
  190. // Do we have <io.h>?
  191. #define PHAVE_IO_H
  192. // Do we have <malloc.h>?
  193. #define PHAVE_MALLOC_H
  194. // Do we have <alloca.h>?
  195. #define PHAVE_ALLOCA_H
  196. // Do we have <locale.h>?
  197. #define PHAVE_LOCALE_H 1
  198. // Do we have <string.h>?
  199. #define PHAVE_STRING_H 1
  200. // Do we have <stdlib.h>?
  201. #define PHAVE_STDLIB_H 1
  202. // Do we have <limits.h>?
  203. #define PHAVE_LIMITS_H 1
  204. // Do we have <minmax.h>?
  205. #define PHAVE_MINMAX_H
  206. // Do we have <sys/types.h>?
  207. #define PHAVE_SYS_TYPES_H 1
  208. #define PHAVE_SYS_TIME_H 1
  209. // Do we have <unistd.h>?
  210. #define PHAVE_UNISTD_H 1
  211. // Do we have <utime.h>?
  212. #define PHAVE_UTIME_H 1
  213. // Do we have <dirent.h>?
  214. #define PHAVE_DIRENT_H 1
  215. // Do we have <glob.h> (and do we want to use it instead of dirent.h)?
  216. #define PHAVE_GLOB_H 1
  217. // Do we have <sys/soundcard.h> (and presumably a Linux-style audio
  218. // interface)?
  219. #define PHAVE_SYS_SOUNDCARD_H 1
  220. // Do we have <ucontext.h> (and therefore makecontext() / swapcontext())?
  221. #define PHAVE_UCONTEXT_H 1
  222. // Do we have <linux/input.h> ? This enables us to use raw mouse input.
  223. #define PHAVE_LINUX_INPUT_H
  224. // Do we have <stdint.h>?
  225. #define PHAVE_STDINT_H 1
  226. // Do we have RTTI (and <typeinfo>)?
  227. #define HAVE_RTTI 1
  228. // We need 64-bit file i/o
  229. #define __USE_LARGEFILE64 1
  230. // The dynamic library file extension (usually .so .dll or .dylib):
  231. #define DYNAMIC_LIB_EXT .so
  232. #define STATIC_LIB_EXT .a
  233. #define BUNDLE_EXT
  234. #if $[isdir /usr/PCBSD/local] // if we're running PC-BSD
  235. #define EXTRA_IPATH /usr/PCBSD/local/include/
  236. #define EXTRA_LPATH /usr/PCBSD/local/lib/
  237. #endif
  238. #define EXTRA_IPATH /usr/local/include/
  239. #define EXTRA_LPATH /usr/local/lib/