makecfg 5.1 KB

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