makecfg 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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.0
  42. #
  43. # Note: Older versions (before 10 March 1998) doesn't like spaces at the
  44. # start of lines!
  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. -OGa5
  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. # Allow goto, inline, C-operators
  93. -Sgic
  94. # ---------------
  95. # Code generation
  96. # ---------------
  97. # Uncomment the next line if you always want static/dynamic linking by default
  98. # (can be overruled with -CD, -CS at the commandline)
  99. #-CS
  100. #-CD
  101. # Set the default heapsize to 8Mb
  102. #-Ch8000000
  103. # Set default codegeneration checks (iocheck, overflow, range, stack)
  104. #-Ci
  105. #-Co
  106. #-Cr
  107. #-Ct
  108. # Optimize always for Size and Pentium
  109. #-OGa5
  110. # -----------------------
  111. # Set Filenames and Paths
  112. # -----------------------
  113. # Slashes are also allowed under dos
  114. # path to the messagefile, not necessary anymore but can be used to override
  115. # the default language
  116. #-Fr$3/errore.msg
  117. #-Fr$3/errorn.msg
  118. # path to the gcclib
  119. -Fg$4
  120. # searchpath for includefiles
  121. #-Fi/pp/inc;/pp/rtl/inc
  122. # searchpath for units (does the same as -Up)
  123. # For statically, smartlinked units
  124. #IFDEF FPC_LINK_STATIC
  125. -Fu$2/staticunits
  126. #ENDIF
  127. # For Dynamically linked units
  128. #IFDEF FPC_LINK_DYNAMIC
  129. -Fu$2/sharedunits
  130. #ENDIF
  131. # For normal units
  132. -Fu$2/linuxunits
  133. #-Fu/pp/units;/pp/rtl/dos/go32v2
  134. #-Fu/usr/lib/ppc/units;/usr/lib/ppc/linuxunits
  135. # searchpath for libraries
  136. #-Fl/pp/lib
  137. #-Fl/lib;/usr/lib
  138. # -------------
  139. # Linking
  140. # -------------
  141. # generate always debugging information for GDB (slows down the compiling
  142. # process)
  143. #-g
  144. # always pass an option to the linker
  145. #-k-s
  146. # Always strip debuginfo from the executable
  147. #-Xs
  148. # -------------
  149. # Miscellaneous
  150. # -------------
  151. # Write always a nice FPC logo ;)
  152. -l
  153. # Verbosity
  154. # e : Show errors (default) d : Show debug info
  155. # w : Show warnings u : Show used files
  156. # n : Show notes t : Show tried files
  157. # h : Show hints m : Show defined macros
  158. # i : Show general info p : Show compiled procedures
  159. # l : Show linenumbers c : Show conditionals
  160. # a : Show everything 0 : Show nothing (except errors)
  161. # Display Info, Warnings, Notes and Hints
  162. -viwnh
  163. # If you don't want so much verbosity use
  164. #-vw
  165. #
  166. # That's all folks
  167. #
  168. EOFCFG
  169. EOFCREATE
  170. chmod 755 $1