summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-03-28 17:15:15 +0200
committerNicholas Clark <nick@ccl4.org>2012-06-19 10:29:20 +0200
commit5729ffdda207fd02149cc5ed14dbfdce8c47cac3 (patch)
tree1e907a5be677d3a4e394bda028cd370f4e148d7b /cflags.SH
parentcdc1aa425ff891f079f6e8b0787d0d9aa145bd47 (diff)
downloadperl-5729ffdda207fd02149cc5ed14dbfdce8c47cac3.tar.gz
In cflags.SH trim the case statement of file basenames.
Add examples showing how to use cflags.SH to tweak the compiler flags used for individual object files. Previously cflags.SH contained a somewhat stale pre-canned list of file basenames including removed files such as usersub (deleted before 5.000 shipped), and a partial list of 5.000 XS extensions. Whilst it's possible to generate the correct list in cflags by parsing MANIFEST (and adding a few fixups), it's still not actually *useful*, as cflags gets overwritten as soon as config.sh changes. Hence the most end-user useful solution with minimal maintenance is to eliminate the list entirely, and document how the user should add to it as necessary.
Diffstat (limited to 'cflags.SH')
-rwxr-xr-xcflags.SH61
1 files changed, 14 insertions, 47 deletions
diff --git a/cflags.SH b/cflags.SH
index ac03b85f1f..6420bf3916 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -273,56 +273,23 @@ for file do
: or customize here
case "$file" in
- DB_File) ;;
- GDBM_File) ;;
- NDBM_File) ;;
- ODBM_File) ;;
- POSIX) ;;
- SDBM_File) ;;
- av) ;;
- byterun) ;;
- deb) ;;
- dl) ;;
- doio) ;;
- doop) ;;
- dump) ;;
- globals) ;;
- gv) ;;
- hv) ;;
- locale) ;;
- madly) ;;
- main) ;;
- malloc) ;;
- mg) ;;
- miniperlmain) ;;
- numeric) ;;
- op) ;;
- opmini) ;;
- pad) ;;
- perl) ;;
- perlapi) ;;
- perlmain) ;;
- perly) ;;
- pp) ;;
- pp_ctl) ;;
- pp_hot) ;;
- pp_pack) ;;
- pp_sort) ;;
- pp_sys) ;;
- regcomp) ;;
- regexec) ;;
- run) ;;
- scope) ;;
- sv) ;;
- taint) ;;
- toke) ;;
- universal) ;;
- usersub) ;;
- utf8) ;;
- util) ;;
*) ;;
+
+ *) : Customization examples follow: ;;
+ av) ccflags=`echo $ccflags | sed -e s/-pipe//` ;;
+ deb) ccflags="$ccflags -fno-jump-tables" ;;
+ hv) warn=`echo $warn | sed -e s/-Wextra//` ;;
+ toke) optimize=-O0 ;;
esac
+ : The examples are intentionally unreachable as the '*)' case always
+ : matches. To use them, move before the '*)' and edit as appropriate.
+ : It is not a good idea to set ccflags to an absolute value here, as it
+ : often contains general -D defines which are needed for correct
+ : compilation. It is better to edit ccflags as shown, using interpolation
+ : to add flags, or sed to remove flags.
+
+
case "$cc" in
*g++*)
# Extra paranoia in case people have bad canned ccflags: