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