samplecfg 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. #
  2. # $Id$
  3. #
  4. # Generate Sample Free Pascal configuration file
  5. #
  6. if [ $# != 1 ]; then
  7. echo 'Usage :'
  8. echo 'samplecfg fpcdir'
  9. echo 'fpcdir = Path where FPC is installed'
  10. exit 1
  11. fi
  12. if [ -f /etc/ppc386.cfg ] ; then
  13. mv /etc/ppc386.cfg /etc/ppc386.orig >/dev/null 2>&1
  14. if [ $? == 0 ]; then
  15. echo Saved old config to /etc/ppc386.orig
  16. else
  17. echo Could not save old config. Bailing out...
  18. fi
  19. fi
  20. # Find path to libgcc.a
  21. GCCSPEC=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
  22. GCCDIR=`dirname $GCCSPEC`
  23. echo Found libgcc.a in $GCCDIR
  24. # Write the file
  25. echo Writing sample configuration file to /etc/ppc386.cfg
  26. cat <<EOFCFG > /etc/ppc386.cfg
  27. #
  28. # Example ppc386.cfg for Free Pascal Compiler Version 0.99.12
  29. #
  30. # ----------------------
  31. # Defines (preprocessor)
  32. # ----------------------
  33. #
  34. # nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed
  35. #
  36. # -d is the same as #DEFINE
  37. # -u is the same as #UNDEF
  38. #
  39. # When not m68k is defined at the commandline, define i386
  40. #IFNDEF m68k
  41. #DEFINE i386
  42. #ENDIF
  43. #
  44. # Some examples (for switches see below, and the -? helppages)
  45. #
  46. # Try compiling with the -dRELEASE or -dDEBUG on the commandline
  47. #
  48. # For a release compile with optimizes and strip debuginfo
  49. #IFDEF RELEASE
  50. -OG2p2
  51. -Xs
  52. #WRITE Compiling Release Version
  53. #ENDIF
  54. # For a debug version compile with debuginfo and all codegeneration checks on
  55. #IFDEF DEBUG
  56. -g
  57. -Crtoi
  58. #WRITE Compiling Debug Version
  59. #ENDIF
  60. # ----------------
  61. # Parsing switches
  62. # ----------------
  63. # All assembler blocks are intel styled by default
  64. #-Rintel
  65. # All assembler blocks are AT&T styled by default
  66. #-Ratt
  67. # Semantic checking
  68. # -S2 switch some Delphi 2 extension on
  69. # -Sc supports operators like C (*=,+=,/= and -=)
  70. # -Sg allows LABEL and GOTO
  71. # -Si support C++ stlyed INLINE
  72. # -Sm support macros like C (global)
  73. # -So tries to be TP/BP 7.0 compatible
  74. # -Ss constructor name must be init (destructor must be done)
  75. # -St allows static keyword in objects
  76. # Allow goto, inline, C-operators, C-vars
  77. -Sgic
  78. # ---------------
  79. # Code generation
  80. # ---------------
  81. # Uncomment the next line if you always want static/dynamic units by default
  82. # (can be overruled with -CD, -CS at the commandline)
  83. #-CS
  84. #-CD
  85. # Set the default heapsize to 8Mb
  86. #-Ch8000000
  87. # Set default codegeneration checks (iocheck, overflow, range, stack)
  88. #-Ci
  89. #-Co
  90. #-Cr
  91. #-Ct
  92. # Optimizer switches
  93. # -Og generate smaller code
  94. # -OG generate faster code (default)
  95. # -Or keep certain variables in registers (still BUGGY!!!)
  96. # -Ou enable uncertain optimizations (see docs)
  97. # -O1 level 1 optimizations (quick optimizations)
  98. # -O2 level 2 optimizations (-O1 + slower optimizations)
  99. # -O3 level 3 optimizations (same as -O2u)
  100. # -Op target processor
  101. # -Op1 set target processor to 386/486
  102. # -Op2 set target processor to Pentium/PentiumMMX (tm)
  103. # -Op3 set target processor to PPro/PII/c6x86/K6 (tm)
  104. # Optimize always for Size and Pentium
  105. #-OG2p2
  106. # -----------------------
  107. # Set Filenames and Paths
  108. # -----------------------
  109. # Slashes are also allowed under dos
  110. # path to the messagefile, not necessary anymore but can be used to override
  111. # the default language
  112. #-Fr$1/msg/errore.msg
  113. #-Fr$1/msg/errorn.msg
  114. # searchpath for includefiles
  115. #-Fi/pp/inc;/pp/rtl/inc
  116. # searchpath for units and other system dependent things
  117. #IFDEF Go32V1
  118. #IFDEF FPC_LINK_STATIC
  119. -Fu$1/rtl/go32v1/static
  120. -Fu$1/units/go32v1/static
  121. #ENDIF
  122. -Fu$1/rtl/go32v1
  123. -Fu$1/units/go32v1
  124. #ENDIF
  125. #IFDEF Go32V2
  126. #IFDEF FPC_LINK_STATIC
  127. -Fu$1/rtl/go32v2/static
  128. -Fu$1/units/go32v2/static
  129. #ENDIF
  130. -Fu$1/rtl/go32v2
  131. -Fu$1/units/go32v2
  132. #ENDIF
  133. #IFDEF Win32
  134. #IFDEF FPC_LINK_STATIC
  135. -Fu$1/rtl/win32/static
  136. -Fu$1/units/win32/static
  137. #ENDIF
  138. -Fu$1/rtl/win32
  139. -Fu$1/units/win32
  140. #ENDIF
  141. #IFDEF OS2
  142. #IFDEF FPC_LINK_STATIC
  143. -Fu$1/rtl/os2/static
  144. -Fu$1/units/os2/static
  145. #ENDIF
  146. -Fu$1/rtl/os2
  147. -Fu$1/units/os2
  148. #ENDIF
  149. #IFDEF Linux
  150. # For statically, smartlinked units
  151. #IFDEF FPC_LINK_STATIC
  152. -Fu$1/rtl/static
  153. -Fu$1/units/static
  154. #ENDIF
  155. # For Dynamically linked units
  156. #IFDEF FPC_LINK_DYNAMIC
  157. -Fu$1/rtl/shared
  158. -Fu$1/units/shared
  159. #ENDIF
  160. -Fu$1/rtl/linux
  161. -Fu$1/units/linux
  162. #-Fu~/pp/units;~/pp/rtl/linux
  163. #-Fu/usr/lib/fpc/0.99.12/units;/usr/lib/fpc/0.99.12/rtl
  164. #ENDIF
  165. # searchpath for libraries
  166. -Fl$GCCDIR
  167. #-Fl/pp/lib
  168. #-Fl/lib;/usr/lib
  169. # -------------
  170. # Linking
  171. # -------------
  172. # generate always debugging information for GDB (slows down the compiling
  173. # process)
  174. #-g
  175. # always pass an option to the linker
  176. #-k-s
  177. # Always strip debuginfo from the executable
  178. -Xs
  179. # -------------
  180. # Miscellaneous
  181. # -------------
  182. # Write always a nice FPC logo ;)
  183. -l
  184. # Verbosity
  185. # e : Show errors (default) d : Show debug info
  186. # w : Show warnings u : Show used files
  187. # n : Show notes t : Show tried files
  188. # h : Show hints m : Show defined macros
  189. # i : Show general info p : Show compiled procedures
  190. # l : Show linenumbers c : Show conditionals
  191. # a : Show everything 0 : Show nothing (except errors)
  192. # Display Info, Warnings, Notes and Hints
  193. -viwnh
  194. # If you don't want so much verbosity use
  195. #-vw
  196. #
  197. # That's all folks
  198. #
  199. EOFCFG