3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: Copyright (c) 1998 Andy Dougherty
13 ?RCS: You may distribute under the terms of either the GNU General Public
14 ?RCS: License or the Artistic License, as specified in the README file.
18 ?X: This unit is just a quick shorthand for the compile command
19 ?X: to be used in all the other metaconfig units.
21 ?MAKE:Compile: +cc +optimize +ccflags +ldflags +libs
22 ?MAKE: -pick add $@ %<
23 ?LINT:define compile compile_ok
24 ?V:compile compile_ok mc_file
26 ?S: This shell variable is used internally by Configure to provide
27 ?S: a convenient shorthand for the typical compile command, namely
28 ?S: $cc $optimize $ccflags $ldflags -o $1 $1.c $libs > /dev/null 2>&1
29 ?S: Note that the output filename does _not_ include the _exe
30 ?S: extension. Instead we assume that the linker will be
31 ?S: "helpful" and automatically appending the correct suffix.
32 ?S: OS/2 users will apparently need to supply the -Zexe flag to
33 ?S: get this behavior.
35 ?S: To use this variable, say something like:
36 ?S: echo 'int main() { exit(0); }' > try.c
38 ?S: if eval $compile; then
39 ?S: echo "success" # and do whatever . . .
41 ?S: echo "failure" # and do whatever . . .
43 ?S: To add extra flags cc flags (e.g. -DWHATEVER) just put them
45 ?S: set try -DTRY_THIS_FLAG
48 ?S: This shell variable is used internally by Configure to provide
49 ?S: a convenient shorthand for the typical compile command that you
50 ?S: expect to work ok. It is the same as $compile, except we
51 ?S: deliberately let the user see any error messages.
53 : define a shorthand compile call
57 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
58 : define a shorthand compile call for compilations that should be ok.
62 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'