summaryrefslogtreecommitdiff
path: root/mcon/U/d_PORTAR.U
blob: 7e5a76407d1f8e67f0e08a7484290fc242ef0c20 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
?RCS: $Id: d_PORTAR.U 167 2013-05-08 17:58:00Z rmanfredi $
?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: $Log: d_PORTAR.U,v $
?RCS: Revision 3.0.1.1  1994/10/29  16:08:42  ram
?RCS: patch36: added ?F: line for metalint file checking
?RCS:
?RCS: Revision 3.0  1993/08/18  12:05:40  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?MAKE:d_PORTAR: cat +cc rm Setvar
?MAKE:	-pick add $@ %<
?S:d_PORTAR:
?S:	This variable conditionally handles definition of PORTAR,
?S:	a creation of greater minds than I can imagine.
?S:.
?C:PORTAR:
?C:	This manifest constant must be defined to 1 for some implementations
?C:	of ar.h to get the portable ar most everybody uses.
?C:.
?L:ar_fmag:
?L:ARFMAG:
?L:SARMAG:
?H:#$d_PORTAR PORTAR 1	/**/
?H:.
?F:!portar
?LINT:set d_PORTAR
: see if we need to define PORTAR
echo " "
echo 'Checking to see if we need to define PORTAR for portable archives...' >&4
$cat >portar.c <<'EOCP'
#include <ar.h>
int main() {
	char *arfmag = ARFMAG;
	int sarmag = SARMAG;
	struct ar_hdr arh;

	strncpy(arh.ar_fmag, arfmag, 2);

#ifdef PORTAR
	printf("D\n");
#else
	printf("U\n");
#endif
	exit(0);}
EOCP
if $cc -o portar portar.c >/dev/null 2>&1 || \
	$cc -DPORTAR=1 -o portar portar.c >/dev/null 2>&1 ; then
	case "`./portar`" in
	D)
		val="$define"
		echo "We'll be defining PORTAR for you."
		;;
	U)
		val="$undef"
		echo "We don't seem to need PORTAR defined here."
		;;
	*)
		val="$define"
		echo "(My test program gave me an unexpected value!)"
		echo "I'll just define PORTAR to be sure."
		;;
	esac
else
	echo "(Strange, I couldn't get my test program to compile.)"
	echo "We'll just define PORTAR in this case."
	val="$define"
fi
set d_PORTAR
eval $setvar
$rm -f portar*