1 ?RCS: $Id: Compile.U,v $
3 ?RCS: Copyright (c) 1998 Andy Dougherty
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
10 ?X: This unit is just a quick shorthand for the compile command
11 ?X: to be used in all the other metaconfig units.
13 ?MAKE:Compile: +cc +optimize +ccflags +ldflags +libs
14 ?MAKE: -pick add $@ %<
15 ?LINT:define compile compile_ok
16 ?V:compile compile_ok mc_file
18 ?S: This shell variable is used internally by Configure to provide
19 ?S: a convenient shorthand for the typical compile command, namely
20 ?S: $cc $optimize $ccflags $ldflags -o $1 $1.c $libs > /dev/null 2>&1
21 ?S: Note that the output filename does _not_ include the _exe
22 ?S: extension. Instead we assume that the linker will be
23 ?S: "helpful" and automatically appending the correct suffix.
24 ?S: OS/2 users will apparently need to supply the -Zexe flag to
25 ?S: get this behavior.
27 ?S: To use this variable, say something like:
28 ?S: echo 'int main() { exit(0); }' > try.c
30 ?S: if eval $compile; then
31 ?S: echo "success" # and do whatever . . .
33 ?S: echo "failure" # and do whatever . . .
35 ?S: To add extra flags cc flags (e.g. -DWHATEVER) just put them
37 ?S: set try -DTRY_THIS_FLAG
40 ?S: This shell variable is used internally by Configure to provide
41 ?S: a convenient shorthand for the typical compile command that you
42 ?S: expect to work ok. It is the same as $compile, except we
43 ?S: deliberately let the user see any error messages.
45 : define a shorthand compile call
49 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
50 : define a shorthand compile call for compilations that should be ok.
54 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'