5 # Generate Sample Free Pascal configuration file
9 echo 'samplecfg fpcdir confdir'
10 echo 'fpcdir = Path where FPC is installed'
11 echo 'confdir = Path to /etc'
16 [ -d $sysdir ] || mkdir
$sysdir
21 # Detect if we have write permission in root.
22 if [ -w $sysdir ] ; then
23 echo Write permission
in $sysdir.
24 thefile
=$sysdir/ppc386.cfg
26 echo No
write premission
in $sysdir.
27 thefile
=$HOME/.ppc386.cfg
30 if [ -f $thefile ] ; then
31 mv $thefile $thefile.orig
>/dev
/null
2>&1
33 echo Saved old config to
$thefile.orig
35 echo Could not save old config. Bailing out...
40 # Find path to libgcc.a
41 GCCSPEC
=`(gcc -v 2>&1)| head -n 1| awk '{ print $4 } '`
42 GCCDIR
=`dirname $GCCSPEC`
43 echo Found libgcc.a
in $GCCDIR
46 echo Writing sample configuration
file to
$thefile
47 cat <<EOFCFG > $thefile
49 # Example ppc386.cfg for Free Pascal Compiler
52 # ----------------------
53 # Defines (preprocessor)
54 # ----------------------
57 # nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed
59 # -d is the same as #DEFINE
60 # -u is the same as #UNDEF
63 # When not m68k is defined at the commandline, define i386
69 # Some examples (for switches see below, and the -? helppages)
71 # Try compiling with the -dRELEASE or -dDEBUG on the commandline
74 # For a release compile with optimizes and strip debuginfo
78 #WRITE Compiling Release Version
81 # For a debug version compile with debuginfo and all codegeneration checks on
85 #WRITE Compiling Debug Version
92 # All assembler blocks are intel styled by default
95 # All assembler blocks are AT&T styled by default
99 # -S2 switch some Delphi 2 extension on
100 # -Sc supports operators like C (*=,+=,/= and -=)
101 # -Sg allows LABEL and GOTO
102 # -Si support C++ stlyed INLINE
103 # -Sm support macros like C (global)
104 # -So tries to be TP/BP 7.0 compatible
105 # -Ss constructor name must be init (destructor must be done)
106 # -St allows static keyword in objects
108 # Allow goto, inline, C-operators, C-vars
115 # Uncomment the next line if you always want static/dynamic units by default
116 # (can be overruled with -CD, -CS at the commandline)
120 # Set the default heapsize to 8Mb
123 # Set default codegeneration checks (iocheck, overflow, range, stack)
130 # -Og generate smaller code
131 # -OG generate faster code (default)
132 # -Or keep certain variables in registers (still BUGGY!!!)
133 # -Ou enable uncertain optimizations (see docs)
134 # -O1 level 1 optimizations (quick optimizations)
135 # -O2 level 2 optimizations (-O1 + slower optimizations)
136 # -O3 level 3 optimizations (same as -O2u)
137 # -Op target processor
138 # -Op1 set target processor to 386/486
139 # -Op2 set target processor to Pentium/PentiumMMX (tm)
140 # -Op3 set target processor to PPro/PII/c6x86/K6 (tm)
142 # Optimize always for Size and PII
146 # -----------------------
147 # Set Filenames and Paths
148 # -----------------------
150 # Slashes are also allowed under dos
152 # path to the messagefile, not necessary anymore but can be used to override
153 # the default language
154 #-Fr$1/msg/errore.msg
155 #-Fr$1/msg/errorn.msg
157 # searchpath for includefiles
158 #-Fi/pp/inc;/pp/rtl/inc
160 # searchpath for units and other system dependent things
162 -Fu$1/units/\$target/*
163 -Fu$1/units/\$target/rtl
164 #-Fu~/fpc/packages/*;~/fpc/rtl/linux
166 # searchpath for libraries
176 # generate always debugging information for GDB (slows down the compiling
180 # always pass an option to the linker
183 # Always strip debuginfo from the executable
191 # Write always a nice FPC logo ;)
195 # e : Show errors (default) d : Show debug info
196 # w : Show warnings u : Show used files
197 # n : Show notes t : Show tried files
198 # h : Show hints m : Show defined macros
199 # i : Show general info p : Show compiled procedures
200 # l : Show linenumbers c : Show conditionals
201 # a : Show everything 0 : Show nothing (except errors)
203 # Display Info, Warnings, Notes and Hints
205 # If you don't want so much verbosity use