1 ?X: These units are based on the ones supplied with dist-3.0
2 ?X: patchlevel 22. They have been changed or enhanced to work with
3 ?X: perl5alpha. I would appreciate hearing about any changes,
4 ?X: corrections, or enhancements.
5 ?X: Andy Dougherty doughera@lafcol.lafayette.edu
8 ?X: Easton, PA 18042-1782
9 ?X: Sat Apr 2 15:45:17 EST 1994
10 ?RCS: $Id: ccflags.U,v 3.0.1.3 1993/09/13 15:58:29 ram Exp $
12 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
14 ?RCS: You may redistribute only under the terms of the Artistic Licence,
15 ?RCS: as specified in the README file that comes with the distribution.
16 ?RCS: You may reuse parts of this distribution only within the terms of
17 ?RCS: that same Artistic Licence; a copy of which may be found at the root
18 ?RCS: of the source tree for dist 3.0.
20 ?RCS: $Log: ccflags.U,v $
21 ?RCS: Revision 3.0.1.3 1993/09/13 15:58:29 ram
22 ?RCS: patch10: explicitely mention -DDEBUG just in case they need it (WAD)
23 ?RCS: patch10: removed all the "tans" variable usage (WAD)
25 ?RCS: Revision 3.0.1.2 1993/08/27 14:39:38 ram
26 ?RCS: patch7: added support for OSF/1 machines
28 ?RCS: Revision 3.0.1.1 1993/08/25 14:00:24 ram
29 ?RCS: patch6: added defaults for cppflags, ccflags and ldflags
31 ?RCS: Revision 3.0 1993/08/18 12:05:31 ram
32 ?RCS: Baseline for dist 3.0 netwide release.
34 ?MAKE:ccflags ldflags lkflags cppflags optimize: test cat Myread Guess \
35 Oldconfig cc gccversion mips_type +usrinc package contains
36 ?MAKE: -pick add $@ %<
38 ?S: This variable contains any additional C compiler flags desired by
39 ?S: the user. It is up to the Makefile to use this.
42 ?S: This variable holds the flags that will be passed to the C pre-
43 ?S: processor. It is up to the Makefile to use it.
46 ?S: This variable contains any optimizer/debugger flag that should be used.
47 ?S: It is up to the Makefile to use it.
50 ?S: This variable contains any additional C loader flags desired by
51 ?S: the user. It is up to the Makefile to use this.
54 ?S: This variable contains any additional C partial linker flags desired by
55 ?S: the user. It is up to the Makefile to use this.
57 ?T:inctest thisincl xxx flag inclwanted
61 ?INIT:: no include file wanted by default
64 : determine optimize, if desired, or use for debug flag also
72 Some C compilers have problems with their optimizers, by default, $package
73 compiles with the -O flag to use the optimizer. Alternately, you might want
74 to use the symbolic debugger, which uses the -g flag (on traditional Unix
75 systems). Either flag can be specified here. To use neither flag, specify
79 rp="What optimizer/debugger flag should be used?"
83 'none') optimize=" ";;
88 *gcc*) if $test "$gccversion" = "1"; then
89 dflt='-fpcc-struct-return'
94 *-g*) dflt="$dflt -DDEBUGGING";;
96 ?X: check for POSIXized ISC
98 *gcc*) if test -d /etc/conf/kconfig.d &&
99 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
106 *) dflt="$ccflags" ;;
109 ?X: In USG mode, a MIPS system may need some BSD includes
113 *) inclwanted="$inclwanted $usrinc/bsd";;
115 for thisincl in $inclwanted; do
116 if $test -d $thisincl; then
117 if $test x$thisincl != x$usrinc; then
120 *) dflt="$dflt -I$thisincl";;
126 ?X: Include test function (header, symbol)
127 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
129 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
137 *) dflt="$dflt -D$2";;
142 ?X: SCO unix uses NO_PROTOTYPE instead of _NO_PROTO
143 ?X: OSF/1 uses __LANGUAGE_C__ instead of LANGUAGE_C
146 set signal.h __LANGUAGE_C__; eval $inctest
148 set signal.h LANGUAGE_C; eval $inctest
150 set signal.h NO_PROTOTYPE; eval $inctest
151 set signal.h _NO_PROTO; eval $inctest
158 Your C compiler may want other flags. For this question you should include
159 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
160 but you should NOT include libraries or ld flags like -lwhatever. If you
161 want $package to honor its debug switch, you should include -DDEBUGGING here.
162 To use no flags, specify the word "none".
164 Your C compiler might also need additional flags, such as -DJMPCLOBBER
167 ?X: strip leading space
171 rp="Any additional cc flags?"
178 : the following weeds options from ccflags that are of no interest to cpp
181 *gcc*) if $test "$gccversion" = "1"; then
182 cppflags="$cppflags -D__GNUC__"
187 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
196 -D*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";;
200 *-*) echo "(C preprocessor flags: $cppflags)";;
205 : flags used in final linking phase
216 rp="Any additional ld flags (NOT including libraries)?"
222 rmlist="$rmlist pdp11"
225 : partial linking may need other flags
227 '') case "$ldflags" in
234 rp="Partial linking flags to be used (NOT including -r)?"