makecfg 4.8 KB

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