path: root/mcon/U/d_PORTAR.U
diff options
Diffstat (limited to 'mcon/U/d_PORTAR.U')
1 files changed, 79 insertions, 0 deletions
diff --git a/mcon/U/d_PORTAR.U b/mcon/U/d_PORTAR.U
new file mode 100644
index 0000000..4be99b2
--- /dev/null
+++ b/mcon/U/d_PORTAR.U
@@ -0,0 +1,79 @@
+?RCS: $Id: d_PORTAR.U,v 1994/10/29 16:08:42 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?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 Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: $Log: d_PORTAR.U,v $
+?RCS: Revision 1994/10/29 16:08:42 ram
+?RCS: patch36: added ?F: line for metalint file checking
+?RCS: Revision 3.0 1993/08/18 12:05:40 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?MAKE:d_PORTAR: cat +cc rm Setvar
+?MAKE: -pick add $@ %<
+?S: This variable conditionally handles definition of PORTAR,
+?S: a creation of greater minds than I can imagine.
+?C: This manifest constant must be defined to 1 for some implementations
+?C: of ar.h to get the portable ar most everybody uses.
+?H:#$d_PORTAR PORTAR 1 /**/
+: 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>
+main() {
+ char *arfmag = ARFMAG;
+ int sarmag = SARMAG;
+ struct ar_hdr arh;
+ strncpy(arh.ar_fmag, arfmag, 2);
+#ifdef PORTAR
+ printf("D\n");
+ printf("U\n");
+ exit(0);}
+if $cc portar.c -o portar >/dev/null 2>&1 || \
+ $cc -DPORTAR=1 portar.c -o portar >/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
+ echo "(Strange, I couldn't get my test program to compile.)"
+ echo "We'll just define PORTAR in this case."
+ val="$define"
+set d_PORTAR
+eval $setvar
+$rm -f portar*