diff -Nru pcc-1.2.0~DEVEL+20200630/arch/aarch64/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/aarch64/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/aarch64/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/aarch64/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.1/Sat Jun 13 14:55:53 2020// /local.c/1.1/Sat Jun 13 14:55:53 2020// -/local2.c/1.1/Sat Jun 13 14:55:53 2020// -/macdefs.h/1.1/Sat Jun 13 14:55:53 2020// +/local2.c/1.2/Sat Sep 4 10:38:37 2021// +/macdefs.h/1.2/Sat Sep 4 10:38:37 2021// /order.c/1.1/Sat Jun 13 14:55:53 2020// /table.c/1.1/Sat Jun 13 14:55:53 2020// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/aarch64/local2.c pcc-1.2.0~DEVEL+20220331/arch/aarch64/local2.c --- pcc-1.2.0~DEVEL+20200630/arch/aarch64/local2.c 2020-06-13 14:55:53.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/aarch64/local2.c 2021-09-04 10:38:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local2.c,v 1.1 2020/06/13 14:55:53 ragge Exp $ */ +/* $Id: local2.c,v 1.2 2021/09/04 10:38:37 gmcgarry Exp $ */ /* * Copyright (c) 2020 Puresoftware Ltd. @@ -528,17 +528,17 @@ /* load */ lval = getlval(r); expand(p, 0, "\tldrh A1,"); - printf("[%s," CONFMT "]\n", rnames[r->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[r->n_rval], lval+idx0); } else if (p->n_op == ASSIGN && l->n_op == OREG) { /* store */ lval = getlval(l); expand(p, 0, "\tstrh AR,"); - printf("[%s," CONFMT "]\n", rnames[l->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[l->n_rval], lval+idx0); } else if (p->n_op == SCONV || p->n_op == UMUL) { /* load */ lval = getlval(l); expand(p, 0, "\tldrh A1,"); - printf("[%s," CONFMT "]\n", rnames[l->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[l->n_rval], lval+idx0); } else if (p->n_op == NAME || p->n_op == ICON || p->n_op == OREG) { /* load */ lval = getlval(p); @@ -549,7 +549,7 @@ default: expand(p, 0, "\tldrh A1,"); } - printf("[%s," CONFMT "]\n", rnames[p->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[p->n_rval], lval+idx0); } else { comperr("halfword"); } @@ -670,7 +670,7 @@ void adrcon(CONSZ val) { - printf(CONFMT, val); + printf("#" CONFMT, val); } void @@ -698,7 +698,7 @@ else if (val < 0) fprintf(fp, "-%d", -val); } else - fprintf(fp, CONFMT, (CONSZ)val); + fprintf(fp, "#" CONFMT, (CONSZ)val); return; default: @@ -734,7 +734,7 @@ setlval(p, getlval(p) - size); break; case ICON: - printf(CONFMT, getlval(p) >> 32); + printf("#" CONFMT, getlval(p) >> 32); break; default: comperr("upput bad op %d size %d", p->n_op, size); @@ -756,7 +756,7 @@ if (getlval(p) != 0) fprintf(io, "+%lld", getlval(p)); } else - fprintf(io, CONFMT, getlval(p)); + fprintf(io, "#" CONFMT, getlval(p)); return; case OREG: diff -Nru pcc-1.2.0~DEVEL+20200630/arch/aarch64/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/aarch64/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/aarch64/macdefs.h 2020-06-13 14:55:53.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/aarch64/macdefs.h 2021-09-04 10:38:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.1 2020/06/13 14:55:53 ragge Exp $ */ +/* $Id: macdefs.h,v 1.2 2021/09/04 10:38:37 gmcgarry Exp $ */ /* * Copyright (c) 2020 Puresoftware Ltd. * @@ -82,13 +82,11 @@ typedef unsigned long long U_CONSZ; typedef long long OFFSZ; -#define CONFMT "#%lld" /* format for printing constants */ +#define CONFMT "%lld" /* format for printing constants */ #define LABFMT ".L%d" /* format for printing labels */ #define STABLBL "LL%d" /* format for stab (debugging) labels */ #define STAB_LINE_ABSOLUTE /* S_LINE fields use absolute addresses */ -#undef FIELDOPS /* no bit-field instructions */ - /* Definitions mostly used in pass2 */ #define BYTEOFF(x) ((x)&03) diff -Nru pcc-1.2.0~DEVEL+20200630/arch/amd64/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/amd64/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/amd64/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/amd64/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.94/Fri Apr 10 20:00:08 2020// -/local.c/1.102/Sun Dec 2 18:40:45 2018// +/local.c/1.104/Sun Aug 29 09:21:56 2021// /local2.c/1.70/Sat Nov 24 21:03:55 2018// -/macdefs.h/1.41/Wed Mar 27 13:31:44 2019// +/macdefs.h/1.42/Fri Oct 8 15:59:06 2021// /order.c/1.19/Sun Dec 3 17:34:15 2017// /table.c/1.57/Sat Nov 24 21:03:55 2018// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/amd64/local.c pcc-1.2.0~DEVEL+20220331/arch/amd64/local.c --- pcc-1.2.0~DEVEL+20200630/arch/amd64/local.c 2018-12-02 18:40:45.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/amd64/local.c 2021-08-29 09:21:56.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.102 2018/12/02 18:40:45 ragge Exp $ */ +/* $Id: local.c,v 1.104 2021/08/29 09:21:56 gmcgarry Exp $ */ /* * Copyright (c) 2008 Michael Shalayeff * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). @@ -126,7 +126,11 @@ #endif c = getexname(p->n_sp); +#ifndef PASS1 sp = picsymtab("", c, mcmodel & MCLARGE ? "@GOTOFF" : "@GOTPCREL"); +#else + sp = picsymtab("", c, "@GOTOFF"); +#endif sp->sap = attr_add(sp->sap, attr_new(ATTR_AMD64_BEENHERE, 1)); q = block(NAME, NIL, NIL, INCREF(p->n_type), p->n_df, p->n_ap); q->n_sp = sp; @@ -343,10 +347,12 @@ case EXTERN: case EXTDEF: +#ifdef TLS if (q->sflags & STLS) { p = tlsref(p); break; } +#endif if (kflag == 0 || statinit) break; if (blevel > 0) @@ -539,10 +545,14 @@ sp = p->n_left->n_sp; if ((s = strstr(sp->sname, "@GOTPCREL")) != NULL) { +#ifndef PASS1 if (mcmodel & MCLARGE) memcpy(s, "@PLTOFF", sizeof("@PLTOFF")); else memcpy(s, "@PLT", sizeof("@PLT")); +#else + memcpy(s, "@PLTOFF", sizeof("@PLTOFF")); +#endif p->n_left->n_op = ICON; } return; @@ -599,7 +609,12 @@ if (p->n_sp->sclass == STATIC || p->n_sp->sclass == USTATIC) return 1; #endif + +#ifdef MACHOABI + return (!kflag || p->n_sp->sclass == EXTERN); +#else return !kflag; +#endif } /* @@ -834,7 +849,7 @@ printf("\t.weakref %s,%s\n", sn, wr); } else #endif - if ((ga = attr_find(sp->sap, GCC_ATYP_ALIAS)) != NULL) { + if ((ga = attr_find(sp->sap, GCC_ATYP_ALIAS)) != NULL) { char *an = ga->sarg(0); char *sn = getsoname(sp); char *v; diff -Nru pcc-1.2.0~DEVEL+20200630/arch/amd64/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/amd64/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/amd64/macdefs.h 2019-03-27 13:31:44.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/amd64/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.41 2019/03/27 13:31:44 ragge Exp $ */ +/* $Id: macdefs.h,v 1.42 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2008 Michael Shalayeff * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). @@ -114,8 +114,7 @@ #endif #define TARGET_TIMODE /* has TI/TF/TC types (128 bit) */ -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE /* little-endian only */ diff -Nru pcc-1.2.0~DEVEL+20200630/arch/arm/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/arm/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/arm/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/arm/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.30/Wed Mar 9 18:19:56 2016// -/local.c/1.35/Wed Nov 13 16:25:10 2019// -/local2.c/1.40/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.21/Wed Nov 13 16:25:10 2019// +/local.c/1.36/Mon Aug 9 00:23:24 2021// +/local2.c/1.41/Sat Sep 4 10:38:37 2021// +/macdefs.h/1.23/Fri Oct 8 15:59:06 2021// /order.c/1.10/Wed Mar 9 18:19:56 2016// /table.c/1.20/Sun Nov 13 22:30:18 2011// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/arm/local2.c pcc-1.2.0~DEVEL+20220331/arch/arm/local2.c --- pcc-1.2.0~DEVEL+20200630/arch/arm/local2.c 2016-09-26 16:45:42.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/arm/local2.c 2021-09-04 10:38:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local2.c,v 1.40 2016/09/26 16:45:42 ragge Exp $ */ +/* $Id: local2.c,v 1.41 2021/09/04 10:38:37 gmcgarry Exp $ */ /* * Copyright (c) 2007 Gregory McGarry (g.mcgarry@ieee.org). * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). @@ -176,14 +176,6 @@ ftype = ipp->ipp_type; -#if 0 - printf("\t.align 2\n"); - if (ipp->ipp_vis) - printf("\t.global %s\n", exname(ipp->ipp_name)); - printf("\t.type %s,%%function\n", exname(ipp->ipp_name)); -#endif - printf("%s:\n", exname(ipp->ipp_name)); - /* * We here know what register to save and how much to * add to the stack. @@ -441,7 +433,7 @@ if (p->n_op == LS && r->n_op == ICON && getlval(r) < 32) { expand(p, INBREG, "\tmov A1,AL,lsr "); - printf(CONFMT COM "64-bit left-shift\n", 32 - getlval(r)); + printf("#" CONFMT COM "64-bit left-shift\n", 32 - getlval(r)); expand(p, INBREG, "\tmov U1,UL,asl AR\n"); expand(p, INBREG, "\torr U1,U1,A1\n"); expand(p, INBREG, "\tmov A1,AL,asl AR\n"); @@ -449,14 +441,14 @@ expand(p, INBREG, "\tmov A1,#0" COM "64-bit left-shift\n"); expand(p, INBREG, "\tmov U1,AL"); if (getlval(r) - 32 != 0) - printf(",asl " CONFMT, getlval(r) - 32); + printf(",asl #" CONFMT, getlval(r) - 32); printf("\n"); } else if (p->n_op == LS && r->n_op == ICON) { expand(p, INBREG, "\tmov A1,#0" COM "64-bit left-shift\n"); expand(p, INBREG, "\tmov U1,#0\n"); } else if (p->n_op == RS && r->n_op == ICON && getlval(r) < 32) { expand(p, INBREG, "\tmov U1,UL,asl "); - printf(CONFMT COM "64-bit right-shift\n", 32 - getlval(r)); + printf("#" CONFMT COM "64-bit right-shift\n", 32 - getlval(r)); expand(p, INBREG, "\tmov A1,AL,lsr AR\n"); expand(p, INBREG, "\torr A1,A1,U1\n"); if (ty == LONGLONG) @@ -474,7 +466,7 @@ shifttype = "lsr"; } if (getlval(r) - 32 != 0) - printf(",%s " CONFMT, shifttype, getlval(r) - 32); + printf(",%s #" CONFMT, shifttype, getlval(r) - 32); printf("\n"); } else if (p->n_op == RS && r->n_op == ICON) { expand(p, INBREG, "\tmov A1,#0" COM "64-bit right-shift\n"); @@ -663,33 +655,33 @@ /* load */ lval = getlval(r); expand(p, 0, "\tldrb A1,"); - printf("[%s," CONFMT "]\n", rnames[r->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[r->n_rval], lval+idx0); expand(p, 0, "\tldrb AL,"); - printf("[%s," CONFMT "]\n", rnames[r->n_rval], lval+idx1); + printf("[%s,#" CONFMT "]\n", rnames[r->n_rval], lval+idx1); expand(p, 0, "\torr AL,A1,AL,asl #8\n"); } else if (p->n_op == ASSIGN && l->n_op == OREG) { /* store */ lval = getlval(l); expand(p, 0, "\tstrb AR,"); - printf("[%s," CONFMT "]\n", rnames[l->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[l->n_rval], lval+idx0); expand(p, 0, "\tmov A1,AR,asr #8\n"); expand(p, 0, "\tstrb A1,"); - printf("[%s," CONFMT "]\n", rnames[l->n_rval], lval+idx1); + printf("[%s,#" CONFMT "]\n", rnames[l->n_rval], lval+idx1); } else if (p->n_op == SCONV || p->n_op == UMUL) { /* load */ lval = getlval(l); expand(p, 0, "\tldrb A1,"); - printf("[%s," CONFMT "]\n", rnames[l->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[l->n_rval], lval+idx0); expand(p, 0, "\tldrb A2,"); - printf("[%s," CONFMT "]\n", rnames[l->n_rval], lval+idx1); + printf("[%s,#" CONFMT "]\n", rnames[l->n_rval], lval+idx1); expand(p, 0, "\torr A1,A1,A2,asl #8\n"); } else if (p->n_op == NAME || p->n_op == ICON || p->n_op == OREG) { /* load */ lval = getlval(p); expand(p, 0, "\tldrb A1,"); - printf("[%s," CONFMT "]\n", rnames[p->n_rval], lval+idx0); + printf("[%s,#" CONFMT "]\n", rnames[p->n_rval], lval+idx0); expand(p, 0, "\tldrb A2,"); - printf("[%s," CONFMT "]\n", rnames[p->n_rval], lval+idx1); + printf("[%s,#" CONFMT "]\n", rnames[p->n_rval], lval+idx1); expand(p, 0, "\torr A1,A1,A2,asl #8\n"); } else { comperr("halfword"); @@ -855,7 +847,7 @@ void adrcon(CONSZ val) { - printf(CONFMT, val); + printf("#" CONFMT, val); } void @@ -888,7 +880,7 @@ else if (val < 0) fprintf(fp, "-%d", -val); } else - fprintf(fp, CONFMT, (CONSZ)val); + fprintf(fp, "#" CONFMT, (CONSZ)val); return; default: @@ -924,7 +916,7 @@ setlval(p, getlval(p) - size); break; case ICON: - printf(CONFMT, getlval(p) >> 32); + printf("#" CONFMT, getlval(p) >> 32); break; default: comperr("upput bad op %d size %d", p->n_op, size); @@ -948,7 +940,7 @@ if (getlval(p) != 0) fprintf(io, "+%lld", getlval(p)); } else - fprintf(io, CONFMT, getlval(p)); + fprintf(io, "#" CONFMT, getlval(p)); return; case OREG: diff -Nru pcc-1.2.0~DEVEL+20200630/arch/arm/local.c pcc-1.2.0~DEVEL+20220331/arch/arm/local.c --- pcc-1.2.0~DEVEL+20200630/arch/arm/local.c 2019-11-13 16:25:10.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/arm/local.c 2021-08-09 00:23:24.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.35 2019/11/13 16:25:10 ragge Exp $ */ +/* $Id: local.c,v 1.36 2021/08/09 00:23:24 gmcgarry Exp $ */ /* * Copyright (c) 2007 Gregory McGarry (g.mcgarry@ieee.org). * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). @@ -401,7 +401,6 @@ int ninval(CONSZ off, int fsz, NODE *p) { - union { float f; double d; int i[2]; } u; struct symtab *q; TWORD t; int i, j; diff -Nru pcc-1.2.0~DEVEL+20200630/arch/arm/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/arm/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/arm/macdefs.h 2019-11-13 16:25:10.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/arm/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.21 2019/11/13 16:25:10 ragge Exp $ */ +/* $Id: macdefs.h,v 1.23 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -93,13 +93,11 @@ typedef unsigned long long U_CONSZ; typedef long long OFFSZ; -#define CONFMT "#%lld" /* format for printing constants */ +#define CONFMT "%lld" /* format for printing constants */ #define LABFMT ".L%d" /* format for printing labels */ #define STABLBL "LL%d" /* format for stab (debugging) labels */ #define STAB_LINE_ABSOLUTE /* S_LINE fields use absolute addresses */ -#undef FIELDOPS /* no bit-field instructions */ - /* Definitions mostly used in pass2 */ #define BYTEOFF(x) ((x)&03) @@ -205,8 +203,7 @@ { -1, }, \ { -1, }, \ -#define BACKTEMP /* stack grows negatively for temporaries */ -#define BACKAUTO /* stack grows negatively for automatics */ +#define STACK_DOWN /* stack grows negatively for temporaries */ #define ARGINIT (4*8) /* # bits above fp where arguments start */ #define AUTOINIT (12*8) /* # bits above fp where automatics start */ diff -Nru pcc-1.2.0~DEVEL+20200630/arch/hppa/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/hppa/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/hppa/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/hppa/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.28/Wed Jun 6 09:28:01 2012// /local.c/1.41/Tue Aug 18 10:15:08 2015// /local2.c/1.32/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.22/Sat Mar 5 15:53:04 2016// +/macdefs.h/1.23/Fri Oct 8 15:59:06 2021// /order.c/1.10/Sun Jun 5 08:54:42 2011// /table.c/1.16/Tue Sep 18 10:57:10 2012// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/hppa/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/hppa/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/hppa/macdefs.h 2016-03-05 15:53:04.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/hppa/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.22 2016/03/05 15:53:04 ragge Exp $ */ +/* $Id: macdefs.h,v 1.23 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2007 Michael Shalayeff @@ -96,8 +96,7 @@ #define LABFMT ".L%d" /* format for printing labels */ #define STABLBL ".LL%d" /* format for stab (debugging) labels */ -#undef BACKAUTO /* stack grows upwards */ -#undef BACKTEMP /* stack grows upwards */ +#undef STACK_DOWN /* stack grows upwards */ #define FIELDOPS /* have bit field ops */ #define TARGET_ENDIAN TARGET_BE diff -Nru pcc-1.2.0~DEVEL+20200630/arch/i386/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/i386/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/i386/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/i386/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -2,7 +2,7 @@ /flocal.c/1.17/Sun Apr 22 21:07:40 2012// /local.c/1.209/Tue Dec 10 19:13:23 2019// /local2.c/1.193/Wed May 13 19:32:22 2020// -/macdefs.h/1.100/Sun Mar 24 20:43:21 2019// +/macdefs.h/1.101/Fri Oct 8 15:59:06 2021// /order.c/1.64/Sat Mar 11 09:22:09 2017// /table.c/1.151/Wed May 1 06:35:26 2019// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/i386/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/i386/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/i386/macdefs.h 2019-03-24 20:43:21.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/i386/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.100 2019/03/24 20:43:21 ragge Exp $ */ +/* $Id: macdefs.h,v 1.101 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -132,8 +132,7 @@ #define MYALIGN /* user power-of-2 alignment */ #endif -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE diff -Nru pcc-1.2.0~DEVEL+20200630/arch/i86/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/i86/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/i86/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/i86/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -3,7 +3,7 @@ /flocal.c/1.1/Tue Sep 16 10:47:35 2014// /local.c/1.4/Tue Nov 13 17:47:32 2018// /local2.c/1.9/Tue Nov 13 17:47:32 2018// -/macdefs.h/1.8/Tue Nov 13 17:47:32 2018// +/macdefs.h/1.9/Fri Oct 8 15:59:06 2021// /order.c/1.4/Tue Nov 13 17:47:32 2018// /table.c/1.5/Sat Dec 27 21:18:19 2014// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/i86/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/i86/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/i86/macdefs.h 2018-11-13 17:47:32.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/i86/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.8 2018/11/13 17:47:32 ragge Exp $ */ +/* $Id: macdefs.h,v 1.9 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -112,8 +112,7 @@ #define ARGOFFSET 4 #endif -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE diff -Nru pcc-1.2.0~DEVEL+20200630/arch/m16c/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/m16c/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/m16c/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/m16c/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -2,7 +2,7 @@ /code.c/1.25/Thu May 29 19:20:02 2014// /local.c/1.22/Tue Aug 18 10:15:08 2015// /local2.c/1.44/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.27/Sat Mar 5 15:53:04 2016// +/macdefs.h/1.28/Fri Oct 8 15:59:06 2021// /order.c/1.22/Sun Jun 1 11:35:02 2014// /table.c/1.35/Sun Jun 5 08:54:42 2011// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/m16c/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/m16c/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/m16c/macdefs.h 2016-03-05 15:53:04.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/m16c/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.27 2016/03/05 15:53:04 ragge Exp $ */ +/* $Id: macdefs.h,v 1.28 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -101,8 +101,7 @@ #define CONFMT "%lld" /* format for printing constants */ #define LABFMT "L%d" /* format for printing labels */ -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE diff -Nru pcc-1.2.0~DEVEL+20200630/arch/m68k/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/m68k/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/m68k/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/m68k/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.8/Sat Jan 30 17:26:19 2016// /local.c/1.17/Sun Dec 2 10:50:00 2018// /local2.c/1.18/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.12/Sun Dec 2 10:50:00 2018// +/macdefs.h/1.13/Fri Oct 8 15:59:06 2021// /order.c/1.5/Sat Jan 30 17:26:19 2016// /table.c/1.13/Tue Oct 27 14:48:50 2015// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/m68k/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/m68k/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/m68k/macdefs.h 2018-12-02 10:50:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/m68k/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -100,8 +100,7 @@ #define ARGOFFSET 8 #endif -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_BE /* big-endian */ diff -Nru pcc-1.2.0~DEVEL+20200630/arch/mips/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/mips/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/mips/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/mips/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -2,7 +2,7 @@ /code.c/1.27/Wed Jan 6 16:11:24 2016// /local.c/1.39/Sun Dec 2 10:56:58 2018// /local2.c/1.32/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.25/Sun Dec 2 10:56:58 2018// +/macdefs.h/1.27/Fri Oct 8 15:59:06 2021// /order.c/1.12/Sun Nov 30 21:00:24 2008// /table.c/1.18/Tue Jan 5 12:23:22 2016// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/mips/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/mips/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/mips/macdefs.h 2018-12-02 10:56:58.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/mips/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.25 2018/12/02 10:56:58 ragge Exp $ */ +/* $Id: macdefs.h,v 1.27 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -117,8 +117,7 @@ #define STABLBL "LL%d" /* format for stab (debugging) labels */ #endif -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE @@ -364,3 +363,4 @@ #define USE_IEEEFP_64 #define DBL_PREFIX IEEEFP_64 #define LDBL_PREFIX IEEEFP_64 +#define DEFAULT_FPI_DEFS { &fpi_binary32, &fpi_binary64, &fpi_binary64 } diff -Nru pcc-1.2.0~DEVEL+20200630/arch/mips64/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/mips64/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/mips64/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/mips64/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -2,7 +2,7 @@ /code.c/1.1/Wed Jul 6 07:49:48 2016// /local.c/1.2/Sun Dec 2 20:25:55 2018// /local2.c/1.2/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.3/Wed Nov 13 16:19:30 2019// +/macdefs.h/1.4/Fri Oct 8 15:59:06 2021// /order.c/1.1/Wed Jul 6 07:49:48 2016// /table.c/1.1/Wed Jul 6 07:49:48 2016// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/mips64/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/mips64/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/mips64/macdefs.h 2019-11-13 16:19:30.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/mips64/macdefs.h 2021-10-08 15:59:06.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.3 2019/11/13 16:19:30 ragge Exp $ */ +/* $Id: macdefs.h,v 1.4 2021/10/08 15:59:06 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -119,8 +119,7 @@ #define STABLBL "LL%d" /* format for stab (debugging) labels */ #endif -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/code.c pcc-1.2.0~DEVEL+20220331/arch/nova/code.c --- pcc-1.2.0~DEVEL+20200630/arch/nova/code.c 2016-06-27 11:47:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/code.c 2021-10-13 17:07:36.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: code.c,v 1.13 2016/06/27 11:47:06 ragge Exp $ */ +/* $Id: code.c,v 1.15 2021/10/13 17:07:36 ragge Exp $ */ /* * Copyright (c) 2006 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -35,6 +35,7 @@ #define p1nfree nfree #define p1fwalk fwalk #define p1tcopy ccopy +#define p1listf listf #endif /* @@ -228,7 +229,7 @@ if (p->n_op != FUNARG) return; p->n_rval = xoff; - xoff += tsize(p->n_type, p->n_df, p->n_ap)/SZSHORT; + xoff -= tsize(p->n_type, p->n_df, p->n_ap)/SZSHORT; } /* @@ -256,7 +257,7 @@ r->n_type = l->n_type; } - xoff = 1; + xoff = -2; p1listf(p->n_right, fnummer); return p; } diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/nova/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/nova/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,8 +1,8 @@ -/README/1.5/Mon Jun 27 11:47:06 2016// -/code.c/1.13/Mon Jun 27 11:47:06 2016// -/local.c/1.19/Mon Jun 27 11:47:06 2016// -/local2.c/1.16/Mon Jun 27 11:47:06 2016// -/macdefs.h/1.12/Mon Jun 27 11:47:06 2016// -/order.c/1.7/Mon Jun 27 11:47:06 2016// -/table.c/1.4/Mon Jun 27 11:47:06 2016// +/README/1.8/Tue Jan 11 08:22:37 2022// +/code.c/1.15/Wed Oct 13 17:07:36 2021// +/local.c/1.21/Tue Jan 11 08:22:37 2022// +/local2.c/1.21/Tue Jan 11 08:22:37 2022// +/macdefs.h/1.19/Tue Jan 11 08:22:37 2022// +/order.c/1.9/Sun Nov 21 16:31:04 2021// +/table.c/1.10/Tue Jan 11 08:22:37 2022// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/local2.c pcc-1.2.0~DEVEL+20220331/arch/nova/local2.c --- pcc-1.2.0~DEVEL+20200630/arch/nova/local2.c 2016-06-27 11:47:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/local2.c 2022-01-11 08:22:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local2.c,v 1.16 2016/06/27 11:47:06 ragge Exp $ */ +/* $Id: local2.c,v 1.21 2022/01/11 08:22:37 ragge Exp $ */ /* * Copyright (c) 2006 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -35,10 +35,7 @@ void acon(NODE *p); int argsize(NODE *p); -static int totstk, maxargsz; -struct conlbl { struct conlbl *next; int lbl; CONSZ l; char *n; int isch; }; -struct conlbl *pole; - +static int maxargsz; void deflab(int label) @@ -49,8 +46,6 @@ void prologue(struct interpass_prolog *ipp) { - totstk = p2maxautooff/(SZINT/SZCHAR) + maxargsz; - maxargsz = 0; #ifdef os_none if (ipp->ipp_vis) @@ -58,41 +53,28 @@ printf(" .ZREL\n"); printf("%s: .%s\n", ipp->ipp_name, ipp->ipp_name); printf(" .NREL\n"); - printf(" 0%o\n", totstk); + printf(" 0%o\n", p2maxautooff); printf(".%s:\n", ipp->ipp_name); + printf(" sta 3,@csp\n"); /* put ret pc on stack */ + printf(" jsr @prolog\n"); /* jump to prolog */ #else + printf("#BEGFTN\n"); if (ipp->ipp_vis) printf(" .globl %s\n", ipp->ipp_name); - if (totstk) - printf(" .word 0%o\n", totstk); printf("%s:\n", ipp->ipp_name); + printf(" sta 3,@spref\n"); /* put ret pc on stack */ + printf(" jsr @csav\n"); /* jump to prolog */ + printf(" .word 0%o\n", p2maxautooff); #endif - printf(" sta 3,@csp\n"); /* put ret pc on stack */ - printf(" jsr @prolog\n"); /* jump to prolog */ } void eoftn(struct interpass_prolog *ipp) { - struct conlbl *w; - char *ch; - if (ipp->ipp_ip.ip_lbl == 0) return; /* no code needs to be generated */ - printf(" jmp @epilog\n"); - if (pole == NULL) - return; - while (pole != NULL) { - w = pole, pole = w->next; - printf("." LABFMT ":\t", w->lbl); - ch = w->isch ? "*2" : ""; - if (w->n[0]) - printf("%s%s%s", w->n, ch, w->l ? "+" : ""); - if (w->l || w->n[0] == 0) - printf(CONFMT "%s", w->l, ch); - printf("\n"); - free(w); - } + printf(" jmp @cret\n"); + printf("#ENDFTN\n"); } /* @@ -247,44 +229,103 @@ } #endif +/* + * Compare long against 0. + * Value is in AC0/AC1. + */ static void -addacon(int lbl, CONSZ lval, char *name, int isch) +lzero(NODE *p) { - struct conlbl *w = xmalloc(sizeof(struct conlbl)); - w->next = pole, pole = w; - w->lbl = lbl; - w->l = lval; - w->n = name; - w->isch = isch; + int l = 0; + + switch (p->n_op) { + case EQ: + expand(p, 0, " add# 0,1,snr\n"); + break; + case NE: + expand(p, 0, " add# 0,1,szr\n"); + break; + case GE: + expand(p, 0, " movl# 0,0,snc\n"); + break; + case LT: + expand(p, 0, " movl# 0,0,szc\n"); + break; + case GT: + l = getlab2(); + expand(p, 0, " movl# 0,0,szc\n"); /* high word */ + printf(" jmp " LABFMT "\n", l); + expand(p, 0, " add# 0,1,szr\n"); + break; + case LE: + expand(p, 0, " movl# 0,0,szc\n jmp LC\n"); /* high word */ + expand(p, 0, " add# 0,1,snr\n"); + break; + default: + comperr("lzero %d", p->n_op); + } + expand(p, 0, " jmp LC\n"); + if (l) + printf(LABFMT ":\n", l); +} + +/* + * Compare two long values. + * Left value is in AC0/AC1, right in memory. + * AC2 is available for use. + */ +static void +lcmp(NODE *p) +{ + + expand(p, 0, " lda 2,AR\n"); + expand(p, 0, " sta 2,@sp\n"); + expand(p, 0, " lda 2,UR\n"); + expand(p, 0, " sta 2,@sp\n"); + + switch (p->n_op) { + case LE: + expand(p, 0, " jsr __pcc_lle\n"); + expand(p, 0, " jmp LC\n"); + break; + + default: + comperr("lcmp %d", p->n_op); + } } void zzzcode(NODE *p, int c) { - struct conlbl *w; - char *ch; - int pr; + struct attr *ap; + NODE *l; switch (c) { + case 'N': /* compare two long */ + lcmp(p); + break; + + case 'Q': /* struct assign */ + /* right is in ac2, left is name or oreg */ + l = getlr(p, 'L'); + if (l->n_op == NAME) { + l->n_op = ICON; + expand(p, 0, " lda 0,AL\n"); + l->n_op = NAME; + } else { /* in OREG */ + printf(" lda 0,[.word %d]\n", (int)getlval(l)); + printf(" add 3,0\n"); + } + ap = attr_find(p->n_ap, ATTR_P2STRUCT); + printf(" lda 1,[.word %d]\n", -(ap->iarg(0) >> 1)); + printf(" jsr __stcpy\n"); + break; - case 'A': - if (pole == NULL) - break; - w = pole, pole = w->next; - printf(",skp\n." LABFMT ":\t", w->lbl); - ch = w->isch ? "*2" : ""; - if (w->n[0]) - printf("%s%s%s", w->n, ch, w->l ? "+" : ""); - if (w->l || w->n[0] == 0) - printf(CONFMT "%s", w->l, ch); - free(w); - break; - - case 'B': /* push arg relative sp */ - printf("%d,", p->n_rval); - expand(p, 0, "A1"); + case 'Z': /* compare long against 0 */ + lzero(p); break; + default: comperr("zzzcode %c", c); } @@ -376,13 +417,14 @@ int val = getlval(p); switch (p->n_op) { + case NAME: case ICON: if (p->n_name[0] != '\0') { fprintf(fp, "%s", p->n_name); if (val) - fprintf(fp, "+0%o", val); + fprintf(fp, "+0%o", val & 0177777); } else - fprintf(fp, "0%o", val); + fprintf(fp, "0%o", val & 0177777); return; default: @@ -404,27 +446,25 @@ void upput(NODE *p, int size) { -comperr("upput"); -#if 0 - size /= SZCHAR; +//printf("upput\n"); +//fwalk(p, e2print, 0); switch (p->n_op) { case REG: - printf("%%%s", &rnames[p->n_rval][3]); + printf("1"); /* ac1 is always upper */ break; case NAME: case OREG: - setlval(p, getlval(p) + size); + setlval(p, getlval(p) + 1); adrput(stdout, p); - setlval(p, getlval(p) - size); + setlval(p, getlval(p) - 1); break; case ICON: - printf("$" CONFMT, getlval(p) >> 32); + printf("[.word " CONFMT "]", getlval(p) & 0177777); break; default: comperr("upput bad op %d size %d", p->n_op, size); } -#endif } void @@ -444,28 +484,20 @@ p = p->n_left; switch (p->n_op) { + case NAME: + fputc('@', io); + /* FALLTHROUGH */ case ICON: -#if 1 - /* addressable value of the constant */ - printf("." LABFMT, i = getlab2()); - addacon(i, getlval(p), p->n_name, - p->n_type == INCREF(CHAR) || p->n_type == INCREF(UCHAR)); -#else fputc('[', io); if (p->n_type == INCREF(CHAR) || p->n_type == INCREF(UCHAR)) - printf(".byteptr "); - conput(io, p); + fprintf(io, ".bptr "); + else + fprintf(io, ".word "); + if (p->n_type == LONG || p->n_type == ULONG) + printf(CONFMT, getlval(p) >> 16); + else + conput(io, p); fputc(']', io); -#endif - break; - - case NAME: - if (p->n_name[0] != '\0') { - fputs(p->n_name, io); - if (getlval(p) != 0) - fprintf(io, "+" CONFMT, getlval(p)); - } else - fprintf(io, CONFMT, getlval(p)); break; case OREG: @@ -476,11 +508,16 @@ putchar('-'); i = -i; } + if (regno(p) != AC2 && regno(p) != AC3) + comperr("bad index reg %d", regno(p)); printf("0%o,%s", i, rnames[regno(p)]); break; case REG: - fprintf(io, "%s", rnames[p->n_rval]); + if (p->n_type == LONG || p->n_type == ULONG) + fprintf(io, "0"); + else + fprintf(io, "%s", rnames[p->n_rval]); break; default: @@ -549,26 +586,23 @@ switch (c) { case CLASSA: - num = (r[CLASSA]+r[CLASSB]) < AREGCNT; + /* must have at least one reg free to guarantee */ + if (r[CLASSB]*2+r[CLASSA] < 3) + num = 1; break; case CLASSB: - num = (r[CLASSB]+r[CLASSA]) < BREGCNT; + if (r[CLASSB] || r[CLASSA]) + num = 0; break; case CLASSC: num = r[CLASSC] < CREGCNT; break; - case CLASSD: - num = r[CLASSD] < DREGCNT; - break; - case CLASSE: - num = r[CLASSE] < EREGCNT; - break; } return num; } char *rnames[] = { - "0", "1", "2", "3", "2", "3", "cfp", "csp" + "0", "1", "2", "3", "lc0", "fp0", "cfp", "csp", }; /* @@ -577,7 +611,7 @@ int gclass(TWORD t) { - return ISPTR(t) ? CLASSB : CLASSA; + return (t==LONG||t==ULONG) ? CLASSB : CLASSA; } /* @@ -633,24 +667,3 @@ { return 0; } - -#ifdef MYSTOREMOD -void -storemod(NODE *q, int off, int reg) -{ - NODE *l, *r, *p; - - if (off < MAXZP*2) { - q->n_op = NAME; - q->n_name = ""; - setlval(q, -off/2 + ZPOFF); - } else { - l = mklnode(REG, 0, reg, INCREF(q->n_type)); - r = mklnode(ICON, off, 0, INT); - p = mkbinode(PLUS, l, r, INCREF(q->n_type)); - q->n_op = UMUL; - q->n_left = p; - } - q->n_rval = q->n_su = 0; -} -#endif diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/local.c pcc-1.2.0~DEVEL+20220331/arch/nova/local.c --- pcc-1.2.0~DEVEL+20200630/arch/nova/local.c 2016-06-27 11:47:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/local.c 2022-01-11 08:22:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.19 2016/06/27 11:47:06 ragge Exp $ */ +/* $Id: local.c,v 1.21 2022/01/11 08:22:37 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -333,9 +333,21 @@ char * exname(char *p) { +#define NCHNAM 256 + static char text[NCHNAM+1]; + int i; + if (p == NULL) return ""; - return p; + + text[0] = '_'; + for (i=1; *p && isclass != AUTO) - return; /* not our business */ - if (ISPTR(sp->stype) || sp->stype < LONG) - return; - if (sp->soffset >= (MAXZP * SZINT)) - return; /* already above */ - /* have to move */ - /* XXX remember old autooff for reorg of smaller vars */ - if (autooff < MAXZP * SZINT) - autooff = MAXZP * SZINT; - oalloc(sp, &autooff); -#endif } void diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/nova/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/nova/macdefs.h 2016-06-27 11:47:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/macdefs.h 2022-01-11 08:22:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.12 2016/06/27 11:47:06 ragge Exp $ */ +/* $Id: macdefs.h,v 1.19 2022/01/11 08:22:37 ragge Exp $ */ /* * Copyright (c) 2006 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -45,7 +45,7 @@ #define SZLONG 32 #define SZSHORT 16 #define SZLONGLONG 64 -#define SZPOINT(t) 16 /* Actually 15 */ +#define SZPOINT(t) 16 /* * Alignment constraints @@ -85,8 +85,16 @@ /* Default char is unsigned */ #define CHAR_UNSIGNED #define WORD_ADDRESSED +#undef STACK_DOWN /* nova stack grows upward */ +#define STACK_TYPE INT /* type for accessing stack */ #define BOOL_TYPE UCHAR #define MYALIGN /* provide private alignment function */ +#undef FIELDOPS /* no bit-field instructions */ +#define TARGET_ENDIAN TARGET_LE /* XXX should be both */ +#define AUTOINIT 16 /* first var one word above offset */ +#define ARGINIT 16 /* start args one word below fp */ +#define FINDMOPS /* can in/decrement memory directly. */ +#define NEWNEED /* new-style needs definitions */ /* * Use large-enough types. @@ -99,15 +107,6 @@ #define LABFMT "L%d" /* format for printing labels */ #define STABLBL "LL%d" /* format for stab (debugging) labels */ -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ -#define ARGINIT 16 /* first arg at 0 offset */ -#define AUTOINIT 32 /* first var below 32-bit offset */ - - -#undef FIELDOPS /* no bit-field instructions */ -#define TARGET_ENDIAN TARGET_BE - /* Definitions mostly used in pass2 */ #define BYTEOFF(x) ((x)&01) @@ -118,70 +117,62 @@ ((t) == LONG || (t) == ULONG || (t) == FLOAT) ? 2 : 1) /* - * The Nova has two register classes. Note that the space used in - * zero page is considered stack. - * Register 6 and 7 are FP and SP (in zero page). + * The Nova has three register classes. + * Register 6 and 7 are FP and SP (in zero page or HW regs). * * The classes used on Nova are: - * A - AC0-AC3 (as non-index registers) : reg 0-3 - * B - AC2-AC3 (as index registers) : reg 4-5 - * FP/SP as 6/7. + * A - AC0-AC3 (AC3 not available) : reg 0-3 + * B - LC0 (long, AC0-1 concatenated) : reg 4 + * C - FP0 (floating point) : 5 */ #define AC0 0 #define AC1 1 #define AC2 2 #define AC3 3 +#define LC0 4 +#define FP0 5 +#define FP 6 +#define SP 7 -#define MAXREGS 8 /* 0-29 */ +#define MAXREGS 8 /* 0-5 */ #define RSTATUS \ - SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG, \ - SBREG|TEMPREG, SBREG|TEMPREG, 0, 0 + SAREG|TEMPREG, SAREG|TEMPREG, SAREG|TEMPREG, 0, \ + SBREG|TEMPREG, 0, SCREG|TEMPREG, 0, 0 + #define ROVERLAP \ - { -1 }, { -1 }, { 4, -1 }, { 5, -1 }, { 2, -1 }, { 3, -1 }, \ - { -1 }, { -1 } + { LC0, -1 }, { LC0, -1 }, { -1 }, { -1 }, \ + { 0, 1, -1 }, { -1 }, { -1 }, { -1 }, /* Return a register class based on the type of the node */ /* Used in tshape, avoid matching fp/sp as reg */ -#define PCLASS(p) (p->n_op == REG && regno(p) > 5 ? 0 : \ - ISPTR(p->n_type) ? SBREG : SAREG) +#define PCLASS(p) \ + (p->n_type == LONG || p->n_type == ULONG ? SBREG : SAREG) /* XXX FP */ -#define NUMCLASS 2 /* highest number of reg classes used */ +#define NUMCLASS 3 /* highest number of reg classes used */ int COLORMAP(int c, int *r); -#define GCLASS(x) (x < 4 ? CLASSA : CLASSB) +#define GCLASS(x) (x < 4 ? CLASSA : x == LC0 ? CLASSB : CLASSC) #define DECRA(x,y) (((x) >> (y*6)) & 63) /* decode encoded regs */ #define ENCRD(x) (x) /* Encode dest reg in n_reg */ #define ENCRA1(x) ((x) << 6) /* A1 */ #define ENCRA2(x) ((x) << 12) /* A2 */ #define ENCRA(x,y) ((x) << (6+y*6)) /* encode regs in int */ -#define RETREG(x) (0) /* ? Sanity */ - -#define FPREG 6 /* frame pointer */ -#define STKREG 7 /* stack pointer */ +#define RETREG(t) (t==LONG || t==ULONG ? LC0 : ISPTR(t) ? AC2 : AC0) -#define MAXZP 030 /* number of locations used as stack */ -#define ZPOFF 050 /* offset of zero page regs */ +#define FPREG AC3 /* frame pointer, kept in AC3 */ +#define STKREG SP /* stack pointer */ #ifdef os_none #define MYINSTRING #endif -#undef MYSTOREMOD -#define MYLONGTEMP(p,w) { \ - if (w->r_class == 0) { \ - w->r_color = freetemp(szty(p->n_type)); \ - w->r_class = FPREG; \ - } \ - if (w->r_color < MAXZP*2) { /* color in bytes */ \ - p->n_op = NAME; \ - setlval(p, w->r_color/2 + ZPOFF); \ - p->n_name = ""; \ - break; \ - } \ -} /* * special shapes for sp/fp. */ #define SLDFPSP (MAXSPECIAL+1) /* load fp or sp */ + +/* floating point definitions */ +#define FDFLOAT +#define DEFAULT_FPI_DEFS { &fpi_ffloat, &fpi_dfloat, &fpi_dfloat } diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/order.c pcc-1.2.0~DEVEL+20220331/arch/nova/order.c --- pcc-1.2.0~DEVEL+20200630/arch/nova/order.c 2016-06-27 11:47:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/order.c 2021-11-21 16:31:04.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: order.c,v 1.7 2016/06/27 11:47:06 ragge Exp $ */ +/* $Id: order.c,v 1.9 2021/11/21 16:31:04 ragge Exp $ */ /* * Copyright (c) 2006 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -39,14 +39,10 @@ int notoff(TWORD t, int r, CONSZ off, char *cp) { - if (r != 4 && r != 5) - return 1; /* can only index ac2 and ac3 */ -#if 0 - if (t == CHAR || t == UCHAR) { - if (off < -256 || off > 254) - return 1; - } else -#endif + if (x2debug) + printf("notoff: t %x r %d off %ld\n", t, r, off); + if (r < 2 || r > 3) + return 1; /* can only index ac2/3 */ if (off < -128 || off > 127) return 1; return(0); /* YES */ @@ -64,17 +60,14 @@ if (x2debug) printf("offstar(%p)\n", p); - if (regno(p) == 4 || regno(p) == 5) - return; /* Is already OREG */ - r = p->n_right; - if ((p->n_op == PLUS || p->n_op == MINUS) && r->n_op == ICON) { - if (!isreg(p->n_left) || - (regno(p->n_left) != 4 && regno(p->n_left) != 5)) - (void)geninsn(p->n_left, INBREG); + if ((p->n_op == PLUS || p->n_op == MINUS) && + r->n_op == ICON && (getlval(r) >= -128 && getlval(r) <= 127)) { + if (!isreg(p->n_left)) + (void)geninsn(p->n_left, INAREG); return; } - (void)geninsn(p, INBREG); + (void)geninsn(p, INAREG); } /* @@ -134,26 +127,6 @@ } /* - * Special handling of some instruction register allocation. - */ -struct rspecial * -nspecial(struct optab *q) -{ - switch (q->op) { - case UMUL: - { - static struct rspecial s[] = { - { NLEFT, 4 }, { NRES, AC0 }, - { NEVER, AC3 }, { NEVER, AC0 }, }; - return s; - } - - } - comperr("nspecial entry %d", q - table); - return 0; /* XXX gcc */ -} - -/* * Set evaluation order of a binary node if it differs from default. */ int diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/README pcc-1.2.0~DEVEL+20220331/arch/nova/README --- pcc-1.2.0~DEVEL+20200630/arch/nova/README 2016-06-27 11:47:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/README 2022-01-11 08:22:37.000000000 +0000 @@ -1,260 +1,173 @@ Calling conventions, stack frame and zero page: -The variables that normally are placed on the stack or in registers in C -are instead allocated in the zero page and saved on a (fictive) stack -when calling functions. Some locations have predefined functions though. -Arrays allocated as automatics are stored on the stack with a pointer -in zero page to its destination. +The stack will first increment, then store values. +Frame pointer is kept in AC3 and ZP "fp" (or HW FP). +Stack pointer is kept in ZP "sp". +Stack reference pointer is kept in ZP "spref". +Stack reference pointer is the top of stack and used to restore stack +after a function call. This offset on the stack is unallocated and used +when calling subroutines (usually to store return address). -#ifdef 2bsd -0-7 Unused (by us) -10 Stack pointer -11 Frame pointer -12-14 Unused -15 Prolog private word -16 Prolog address, written in crt0 -17 Epilog address, written in crt0 -20-27 (Auto-increment), scratch -30-37 (Auto-decrement), scratch -40-47 Used by HW stack and MMPU -50-77 Permanent, save before use. -100-377 Addresses for subroutines, written by the linker -#elif rdos 0-17 Unused (by us) -20-27 (Auto-increment), scratch +20-26 (Auto-increment), scratch +27 Stack pointer (if no in hardware) 30-37 (Auto-decrement), scratch 40-47 Used by HW stack and MMPU -50-377 Addresses for subroutines, written by the linker -#endif +50-377 Addresses for subroutines/... -The normal registers (AC0-AC3) are all considered scratch registers. +The normal registers (AC0-AC2) are all considered scratch registers. + +#ifdef 2bsd +long data type is "pdp-endian", which means that the low address +contains the high word, and the high address is the low word. +The word itself is little-endian, as opposed to the HW addressing +used on nova with byte instructions (nova3/nova4). +#endif Register classes are assigned as: - AC0-AC3: AREGs. - AC2-AC3: BREGs. - ...and eventually register pairs/floats as EREGs, double in FREGs. - -In byte code the left half of a word is the first byte (big-endian). -This is bit 0-7 in Nova syntax. -The stack is growing towards lower adresses (as opposed to the HW stack). -Stack pointer points to the last used stack entry, which means: -PUSH: store value, dec sp -POP: inc sp, fetch val - -Note that internally is the first 24 words stored in loc 50-77! -So an offset is subtracted in adrput(). - -Functions which modifies stack (like calls to alloca) will have a frame -pointer to which everything relates. Functions that do not only have -stack pointer. - -Space for all possible arguments are allocated on stack by the compiler, -so no pushing and popping. - -Stack layout (with frame pointer): - - ! arg1 ! 2 - ! arg0 ! 1 - fp -> ! ret pc! 0 <- stack pointer when enter new function - ! old fp! -1 - sp -> ! saved ! -2 - - -Stack references to zero page are converted to NAMEs, using word addresses. -References to the stack itself are using byte offsets. - -Arguments are transferred on the stack. To avoid unneccessary double instructions -they are copied to the zp use area initially. XXX? Need tests here. -Return values in ac0 and ac1. - -A reference to a struct member in assembler, a = b->c; b is in ZP 50 (or on stack) -+ is zeropage-addressing -* is fp-adressing, assume fp in ac3 - -# offset 0 -+ lda 0,@50 # load value from indirect ZP 50 into ac0 -or -* lda 2,,3 # load value from (ac3) into ac2 -* lda 0,,2 # load value from (ac2) into ac0 - -# offset 12 -+ lda 2,50 # load value from ZP 50 into ac2 -+ lda 0,12,2 # load value from (ac2+12) into ac0 -or -* lda 2,,3 # load value from (ac3) into ac2 -* lda 0,12,2 # load value from 12(ac2) into ac0 - -# offset 517 -+ lda %2,50 # load value from ZP 50 into ac2 -+ lda %0,.L42-.,%1 # load offset from .L42 PC-indexed -+ addz %0,%2,skp # add offset to ac2 and skip -+.L42: .word 517 # offset value -+ lda %0,,%2 # load value from (ac2) into ac0 -or - -The prolog/epilog; they are implemented as subroutines. -Both can be omitted if the function do not need it. - - - .word 012 # total words that needs to be saved -func: - mov 3,0 # avoid trashing return address - jsr @prolog # go to prolog - ... - jmp @epilog # jump to epilog + AC0-AC2: AREGs. + AC0+AC1: BREG (long, concatenated). -#ifdef prolog - lda 0,sp - sta 3,@sp - lda 1,fp - sta 1,@sp - sta 0,fp - lda 1,[Css] - sub 1,0 - sta 0,sp -#endif +In byte code the right half of a word is the first byte (little-endian). +This is different to how the hardware handle it. -... +Stack frame layout (with frame pointer). 2+1 words to save on stack: +Stack grows upward - lda 2,fp - lda 3,-1,2 - lda 0,-2,2 - sta 0,fp - sta 2,sp - jmp 0,3 - - -# -# decrement from stack, and save permanent registers. -# push retreg -# push fp -# mov sp,fp -# sub $w,sp -# -# prolog: return in ac3, fun in ac0. -prolog: lda 1,sp - sta 0,@sp - lda 0,fp - sta 0,@sp - sta 1,fp - lda 0,-3,3 - sub 0,1 - sta 1,sp - jmp 0,3 - -epilog: lda 3,fp - sta 3,sp - lda 3,@fp - lda 2,@fp - sta 2,fp - jmp 0,3 + sp -> ! free ! 3 <- also spref + ! w2 ! 2 + ! w1 ! 1 + fp -> ! ospref! 0 + ! ofp ! -1 + ! arg0 ! -2 <- stack pointer when enter new function + ! arg1 ! -3 +ospref->! opc ! -4 + +Return values are in ac0 (and ac1). + +The prolog/epilog (csav/cret) are implemented as subroutines, called +from the ZP dispatcher (for overlay handling). +Both can be omitted if the function do not need it, but the FP in AC3 +must be restored. + +sp is either in loc 027 (auto-inc) or in HW stack. + +In ZP (from srt0.s) a bunch of words are defined: + .zrel +spref: .word 0 +fp: .word 0 +curseg: .word 0 +C0: .word 0 +C1: .word 1 + ... - +calling function 2-arg: (cleanup done in return function) + sta arg2,@sp / push arg2 + sta arg1,@sp / push arg1 + jsr @[.word _fun] / jsr @[.word _fun] +in function: (2 words needed on stack) +_fun: .word 2 / .word 2 + ... + jmp @cret / jmp @cret +"Thunks" generated by the linker in non-overlayed space +_t_foo: lda 0,C1 # new segment in ac0 + lda 2,.+2 # destination function address in ac2 + jmp segcmn + .word _foo + +Switch segment (if needed) and setup for new function +segcmn: lda 1,curseg + sta 0,curseg # update before call + sub# 0,1,szr + nioc mmu # supervisor call if changing segment +csav: + lda 1,0,3 / lda 1,0,3 # fetch # words needed on stack + inc 3,2 / inc 3,2 # put return address in ac2 + + sta 0,@sp / push 0 # store old seg + lda 0,fp / mffp 0 # fetch fp + sta 0,@sp / push 0 # ...and push + lda 0,spref / lda 0,spref # fetch spref + sta 0,@sp / push 0 # ...and push + lda 3,sp / mfsp 3 # fetch sp + sta 3,fp / mtfp 3 # save sp as new fp + + add 3,1 / add 3,1 # calc new stack pointer + sta 1,sp / mtsp 1 # store + sta 1,spref / sta 1,spref # store spref as well + jmp 0,2 / jmp 0,2 # return + +cret: + lda 2,0,3 / lda 2,0,3 # old sp/spref + sta 2,spref / sta 2,spref + lda 3,-1,3 / lda 3,-1,3 # old fp + sta 3,fp / mtfp 3 # restore fp + sta 2,sp / mtsp 2 # cleanup stack + jmp @0,2 / jmp @0,2 -prolog: - lda 2,sp # sp points to the first argument - sta 2,30 # store at auto-dec location - sta 0,@30 # store fun return address - lda 0,fp # fetch old fp - sta 0,@30 # store saved fp - sta 2,fp # save frame pointer - - lda 0,-3,3 # stack size to subtract - neg 0,0,snr # Any words? - jmp 1f # no, get away - lda 1,$51 # fetch zp offset - sub 0,1 # get highest word - sta 1,31 # at auto-dec location - -2: lda 1,@31 # fetch word to copy - sta 1,@30 # on stack - inc 0,0,szr # count words - jmp 1b # more to go - -1: lda 0,30 # finished, get stackptr - sta 0,sp # - jmp 0,3 # get back! - -# epilog, need save frame pointer in ac3 -epilog: - lda 0,-3,3 # get words to save - neg 0,0,snr # any words to save? - jmp 1f # No, get out - - lda 1,$51 # get zp offset - sub 0,1 # Highest word - sta 1,31 # auto-dec loc - - lda 2,fp # get fp - adczl 1,1 # -2 - add 1,2 # 2 now offset - sta 2,30 # auto-dec loc - -2: lda 1,@30 - sta 1,@31 - inc 0,0,szr - jmp 2b - -1: lda 2,fp # fetch current fp - lda 3,-1,2 # return pc - lda 0,-2,2 # fetch old fp - sta 0,fp # restore fp - sta 2,sp # stack pointer restored - jmp 0,3 # Done! - -#if 0 -Assembler syntax and functions. - -The assembler syntax mimics the DG assembler but uses AT&T syntax. -Load and store to addresses is written "lda 0,foo" to load from address foo. -If foo is not in zero page then the assembler will put the lda in the -text area close to the instruction and do an indirect pc-relative load. - -Arithmetic instruction: - subsl# %0,%1,snr skip code may be omitted - subsl# %0,%1 - -Load/store/jmp/jsr/isz/dsz: - lda %1,@disp,2 or - mov *disp(%2),%1 - index may be omitted if 0 (ZP) - disp can only be +-127 words. - - It's allowed to write "mov $32,%0" which will be converted - to an indirect load by the assembler. - - Example of AT&T arguments: - 01234 - Zero-page - L11 - Relative. Will be converted to - indirect + addr if distance too long - (%2) - indexed - 012(%2) - indexed with offset - * in front of any of these will generate indirection -#endif -lbyte: movr 2,2 # get byte ID into C bit - lda 0,,2 # word into ac0 - mov 2,2,snc # skip if right byte - movs 0,0 # swap bytes - jmp 0,3 # get back - -sbyte: sta 3,@sp - - movr 2,2 # get byte ID into C bit - lda 1,,2 # get word - lda 3,[377] # get mask - and 3,0,snc # clear left input + skip if right byte - movs 1,1 # swap bytes - and 3,1 # clear old bits - add 0,1,snc # swap back if necessary - movs 1,1 # swap - sta 1,2 - - lda 3,sp - isz sp - jmp @0,3 +# little-endian bytes. +# load byte, ptr in ac2, ret in ac0 +lbyte: sta 3,@spref # save return address + + lda 1,[377] # get byte mask + movr 2,2,szc # skip next if right word + movs 1,1 # swap mask + lda 0,,2 # load word into ac0 + and 1,0,szc # mask our wanted word + movs 0,0 # swap back if left + + lda 3,fp # restore ac3 + jmp 0,@spref # get back + +# save byte, ptr in ac2, byte in right half of ac0 +sbyte: sta 3,@spref + + lda 3,[377] # mask + and 3,0 # Ensure ac0 high byte is clear + + movr 2,2,szc # skip next if left half + movs 0,0,skp # right half; swap input byte + movs 3,3 # left half; swap mask + + lda 1,,2 # get word + and 3,1 # mask out saved half + add 0,1 # merge in other half + sta 1,2 # write back + + lda 3,fp + jmp @spref + +# shift ac0 left ac1 times +shl: sta 3,@spref + neg 1,1,snr # negate count. + jmp out # done if no shift + + movzl 0,0 # shift left + inc 1,1,szr # done? + jmp .-2 +out: + lda 3,fp + jmp @spref + +# struct assignment +# on entry: src in ac2, dst in ac0, negative cnt in ac1 +__stcpy: + sta 3,@spref + lda 3,fp + sta 2,20 # dest + sta 0,21 # src + dsz 20 + dsz 21 + +again: + lda 0,@20 # inc first, then load + sta 0,@21 # inc first, then store + inc 1,1,szr + jmp again + jmp @spref diff -Nru pcc-1.2.0~DEVEL+20200630/arch/nova/table.c pcc-1.2.0~DEVEL+20220331/arch/nova/table.c --- pcc-1.2.0~DEVEL+20200630/arch/nova/table.c 2016-06-27 11:47:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/nova/table.c 2022-01-11 08:22:37.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: table.c,v 1.4 2016/06/27 11:47:06 ragge Exp $ */ +/* $Id: table.c,v 1.10 2022/01/11 08:22:37 ragge Exp $ */ /* * Copyright (c) 2006 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -33,10 +33,14 @@ # define ANYUSIGNED TUNSIGNED|TULONG|TUSHORT|TUCHAR # define ANYFIXED ANYSIGNED|ANYUSIGNED # define ANYREG (INAREG|INBREG|INCREG) -# define TUWORD TUNSIGNED|TULONG -# define TSWORD TINT|TLONG +# define TUWORD TUNSIGNED +# define TSWORD TINT # define TWORD TUWORD|TSWORD +#define XSL(c) NEEDS(NREG(c, 1), NSL(c)) +#define XNEEDA NEEDS(NREG(A, 1)) +#define XNEEDB NEEDS(NREG(B, 1)) + struct optab table[] = { /* First entry must be an empty entry */ { -1, FOREFF, SANY, TANY, SANY, TANY, 0, 0, "", }, @@ -51,161 +55,382 @@ 0, RLEFT, "", }, +{ SCONV, INAREG, + SAREG, TINT|TUNSIGNED|TPOINT, + SAREG, TINT|TUNSIGNED, + 0, RLEFT, + "", }, + +{ SCONV, INAREG, + SAREG, TINT|TUNSIGNED, + SAREG, TCHAR, + NEEDS(NLEFT(AC0)), RLEFT, + " jsr __pcc_itoc\n", }, + +{ SCONV, INAREG, + SAREG, TINT|TUNSIGNED, + SAREG, TUCHAR, + NEEDS(NREG(A,1)), RLEFT, + " lda A1,c377\n and A1,AL\n", }, + +{ SCONV, INAREG, + SOREG, TLONG|TULONG, + SAREG, TINT|TUNSIGNED, + NEEDS(NREG(A, 1)), RESC1, + " lda A1,UL\n", }, + +/* int/unsigned to long/ulong */ +/* XXX kolla */ +{ SCONV, INBREG, + SOREG|SNAME, TWORD, + SBREG, TLONG|TULONG, + NEEDS(NREG(B, 1), NSL(B)), RESC1, + " lda U1,AL\n subo A1,A1\n", }, + +/* (reg) (u)long to unsigned */ +{ SCONV, INAREG, + SBREG, TLONG|TULONG, + SAREG, TINT|TUNSIGNED, + NEEDS(NREG(A,1), NSL(A), NRES(AC1)), RESC1, + "", }, + + +{ PCONV, INAREG, + SAREG, TSHORT|TUSHORT|TINT|TUNSIGNED, + SAREG, TPOINT, + XSL(A), RESC1, + " mov AL,A1\n", }, + +/* word ptr to char ptr */ +{ PCONV, INAREG, + SAREG, TPTRTO|TSHORT|TUSHORT|TINT|TUNSIGNED|TSTRUCT, + SAREG, TPTRTO|TCHAR|TUCHAR, + 0, RLEFT, + " movl AL,AL\n", }, + + /* * All ASSIGN entries. */ /* reg->reg */ -{ ASSIGN, FOREFF|INAREG|INBREG, - SAREG|SBREG, TWORD|TPOINT, - SAREG|SBREG, TWORD|TPOINT, +{ ASSIGN, FOREFF|INAREG, + SAREG, TWORD|TPOINT, + SAREG, TWORD|TPOINT, 0, RDEST, " mov AR,AL\n", }, + /* reg->mem */ -{ ASSIGN, FOREFF|INAREG|INBREG, +{ ASSIGN, FOREFF|INAREG, + SNAME|SOREG, TCHAR|TUCHAR, + SAREG, TCHAR|TUCHAR, + NEEDS(NOLEFT(AC0), NOLEFT(AC1), NRIGHT(AC0)), RDEST, + " jsr __pcc_le_sbyt # AR,AL\n", }, + +/* reg->mem */ +{ ASSIGN, FOREFF|INAREG, SNAME|SOREG, TWORD|TPOINT, - SAREG|SBREG, TWORD|TPOINT, - 0, RDEST, + SAREG, TWORD|TPOINT, + NEEDS(NOLEFT(AC0), NOLEFT(AC1)), RDEST, " sta AR,AL\n", }, + /* mem->reg */ -{ ASSIGN, FOREFF|INAREG|INBREG, - SAREG|SBREG, TWORD|TPOINT, +{ ASSIGN, FOREFF|INAREG, + SAREG, TWORD|TPOINT, SNAME|SOREG, TWORD|TPOINT, - 0, RDEST, + NEEDS(NORIGHT(AC0), NORIGHT(AC1)), RDEST, " lda AL,AR\n", }, +/* reg->mem */ +{ ASSIGN, FOREFF|INBREG, + SNAME|SOREG, TLONG|TULONG, + SBREG, TLONG|TULONG, + 0, RDEST, + " sta AR,AL\n" + " sta UR,UL\n", }, + +/* mem->reg */ +{ ASSIGN, FOREFF|INBREG, + SBREG, TLONG|TULONG, + SNAME|SOREG, TLONG|TULONG, + 0, RDEST, + " lda AL,AR\n" + " lda UL,UR\n", }, + +/* reg->reg */ +/* this should be end up as a NOP since there is only one BREG */ +{ ASSIGN, FOREFF|INBREG, + SBREG, TLONG|TULONG, + SBREG, TLONG|TULONG, + 0, RDEST, + " XXX - cannot happen\n", }, + +{ STASG, INAREG|FOREFF, + SOREG|SNAME, TANY, + SAREG, TPTRTO|TANY, + NEEDS(NRIGHT(AC2), NEVER(AC0), NEVER(AC1)), RDEST, + "ZQ", }, + /* * LEAF type movements. */ -/* 0 -> reg */ -{ OPLTYPE, INAREG|INBREG, +/* 0 -> Areg */ +{ OPLTYPE, INAREG, SANY, TANY, SZERO, TWORD, - NAREG, RESC1, + XNEEDA, RESC1, " subo A1,A1\n", }, -/* 1 -> reg */ -{ OPLTYPE, INAREG|INBREG, +/* 0 -> Breg */ +{ OPLTYPE, INBREG, + SANY, TANY, + SZERO, TWORD, + XNEEDB, RESC1, + " subo A1,A1\n subo U1,U1\n", }, + +/* 1 -> Areg */ +{ OPLTYPE, INAREG, SANY, TANY, SONE, TWORD, - NAREG|NBREG, RESC1, + XNEEDA, RESC1, " subzl A1,A1\n", }, -/* constant -> reg */ -{ OPLTYPE, INAREG|INBREG, +/* 1 -> Breg */ +{ OPLTYPE, INBREG, + SANY, TANY, + SONE, TLONG|TULONG, + XNEEDB, RESC1, + " subo A1,A1\n subzl U1,U1\n", }, + +/* constant -> Areg */ +{ OPLTYPE, INAREG, SANY, TANY, - SCON, TWORD|TPOINT, - NAREG|NBREG, RESC1, + SCON, TCHAR|TUCHAR|TWORD|TPOINT, + XNEEDA, RESC1, " lda A1,AR\n", }, +/* constant -> Breg */ +{ OPLTYPE, INBREG, + SANY, TANY, + SCON, TLONG|TULONG, + XNEEDB, RESC1, + " lda A1,AR\n lda U1,UR\n", }, + /* mem -> reg */ { OPLTYPE, INAREG, SANY, TANY, - SNAME|SOREG, TWORD, - NAREG, RESC1, + SNAME|SOREG, TWORD|TPOINT, + XNEEDA, RESC1, " lda A1,AR\n", }, /* reg -> A-reg */ { OPLTYPE, INAREG, - SANY, TANY, - SAREG|SBREG, TWORD, - NAREG, RESC1, + SANY, TANY, + SAREG, TWORD, + XSL(A), RESC1, " mov AR,A1\n", }, -/* reg -> B-reg */ -{ OPLTYPE, INBREG, - SANY, TANY, - SAREG|SBREG, TWORD|TPOINT, - NBREG, RESC1, +/* temp -> reg */ +{ OPLTYPE, INAREG, + SANY, TANY, + SAREG, TWORD|TPOINT, + XNEEDA, RESC1, " mov AR,A1\n", }, +/* temp -> Breg */ { OPLTYPE, INBREG, - SANY, TANY, - SNAME|SOREG, TPOINT, - NBREG, RESC1, - " lda A1,AR\n", }, + SANY, TANY, + SBREG, TLONG|TULONG, + XNEEDB, RESC1, + " mov AR,A1\n mov UR,U1\n", }, { OPLTYPE, INBREG, - SANY, TANY, - SLDFPSP, TANY, - NBREG, RESC1, - " lda A1,AR\n", }, + SANY, TLONG|TULONG, + SNAME|SOREG, TLONG|TULONG, + XNEEDB, RESC1, + " lda A1,AR\n" + " lda U1,UR\n", }, /* * Simple ops. */ -{ PLUS, INBREG|INAREG, - SAREG|SBREG, TWORD|TPOINT, - SONE, TANY, +{ PLUS, INAREG, + SAREG, TWORD|TPOINT, + SONE, TANY, 0, RLEFT, " inc AL,AL\n", }, -{ OPSIMP, INBREG|INAREG|FOREFF, - SAREG|SBREG, TWORD|TPOINT, - SAREG|SBREG, TWORD|TPOINT, +/* + * Memory OPS. note that the extra mov is just to avoid a skip + * if passing 0. + */ +{ PLUS, FOREFF, + SNAME|SOREG, TWORD, + SONE, TANY, + 0, RLEFT, + " isz AL\n mov 0,0\n", }, + +{ PLUS, FOREFF, + SNAME|SOREG, TPOINT, + SONE, TANY, + 0, RLEFT, + " isz AL\n", }, + +{ MINUS, FOREFF, + SNAME|SOREG, TWORD, + SONE, TANY, + 0, RLEFT, + " dsz AL\n mov 0,0\n", }, + +{ MINUS, FOREFF, + SNAME|SOREG, TPOINT, + SONE, TANY, + 0, RLEFT, + " dsz AL\n", }, + +/* long add, 5 word */ +{ PLUS, INBREG, + SBREG, TLONG|TULONG, + SOREG|SCON, TLONG|TULONG, + XNEEDA, RLEFT, + " lda 2,UR\n" + " addz 2,1,szc\n" + " inc 0,0\n" + " lda 2,AR\n" + " add 2,0\n", }, + +/* basic entry of multiply */ +{ MUL, INAREG, + SAREG, TSWORD, + SAREG, TSWORD, + 0, RLEFT, + " jsr @__pcc_smul\n", }, + +{ LS, INAREG, + SAREG, TWORD|TPOINT, + SAREG, TINT, + NEEDS(NLEFT(AC0), NRIGHT(AC2)), RLEFT, + " jsr @__pcc_ls\n", }, + +{ RS, INAREG, + SAREG, TUNSIGNED, + SAREG, TINT, + NEEDS(NLEFT(AC0), NRIGHT(AC2)), RLEFT, + " jsr @__pcc_urs\n", }, + +{ RS, INAREG, + SAREG, TINT, + SAREG, TINT, + NEEDS(NLEFT(AC0), NRIGHT(AC2)), RLEFT, + " jsr @__pcc_rs\n", }, + +/* long left shft. left in ac0-1 and right in ac2 */ +{ LS, INBREG, + SBREG, TLONG|TULONG, + SAREG, TANY, + 0, RLEFT, + " jsr @__pcc_lsh32\n", }, + +/* indirection */ +{ UMUL, INBREG, + SANY, TANY, + SOREG, TLONG|TULONG, + XNEEDB, RESC1, + " lda A1,AL\n lda U1,UL\n", }, + +{ OR, INAREG|FOREFF, + SAREG, TWORD|TPOINT, + SAREG, TWORD|TPOINT, + NEEDS(NTR), RLEFT, + " com AR,AR\n and AR,AL\n adc AR,AL\n", }, + +{ OPSIMP, INAREG|FOREFF, + SAREG, TWORD|TPOINT, + SAREG, TWORD|TPOINT, 0, RLEFT, " O AR,AL\n", }, /* * Indirections */ -#ifdef nova4 -{ UMUL, INAREG, - SANY, TPTRTO|TCHAR|TUCHAR, - SOREG|SAREG|SBREG|SNAME, TCHAR|TUCHAR, - NAREG|NASL, RESC1, - " ldb A1,AL\n", }, -#endif { UMUL, INAREG, SANY, TPTRTO|TUCHAR, SOREG, TUCHAR, - NSPECIAL|NAREG, RESC1, - " jsr @lbyt\n", }, + NEEDS(NREG(A, 1), NOLEFT(AC0), NOLEFT(AC1)), RESC1, + " jsr @__pcc_le_lbyt\n", }, { UMUL, INAREG, SANY, TPTRTO|TCHAR, SOREG, TCHAR, - NSPECIAL|NAREG, RESC1, - " jsr @lsbyt\n", }, + NEEDS(NREG(A, 1), NSL(A), NLEFT(AC2)), RESC1, + " jsr @__pcc_le_lsbyt\n", }, { UMUL, INAREG, SANY, TPOINT|TWORD, SOREG, TPOINT|TWORD, - NAREG|NASL, RESC1, - " lda A1,AL\n", }, - -{ UMUL, INBREG, - SANY, TPOINT|TWORD, - SOREG, TPOINT|TWORD, - NBREG|NBSL, RESC1, + NEEDS(NOLEFT(AC0), NOLEFT(AC1), NREG(A,1)), RESC1, " lda A1,AL\n", }, /* * logops */ { EQ, FOREFF, - SAREG|SBREG, TANY, - SZERO, TANY, + SAREG, TINT|TUNSIGNED|TPOINT, + SZERO, TINT|TUNSIGNED|TPOINT, 0, RNOP, " mov# AL,AL,snr\n jmp LC\n", }, { EQ, FOREFF, - SAREG|SBREG, TANY, - SAREG|SBREG, TANY, + SAREG, TINT|TUNSIGNED|TPOINT, + SAREG, TINT|TUNSIGNED|TPOINT, 0, RNOP, " sub# AL,AR,snr\n jmp LC\n", }, { NE, FOREFF, - SAREG|SBREG, TANY, - SZERO, TANY, + SAREG, TINT|TUNSIGNED|TPOINT, + SZERO, TINT|TUNSIGNED|TPOINT, 0, RNOP, " mov# AL,AL,szr\n jmp LC\n", }, { NE, FOREFF, - SAREG|SBREG, TANY, - SAREG|SBREG, TANY, + SAREG, TINT|TUNSIGNED|TPOINT, + SAREG, TINT|TUNSIGNED|TPOINT, 0, RNOP, " sub# AL,AR,szr\n jmp LC\n", }, +{ UGE, FOREFF, + SAREG, TUNSIGNED|TPOINT, + SAREG, TUNSIGNED|TPOINT, + 0, RNOP, + " adcz# AL,AR,snc\n jmp LC\n", }, + +{ UGT, FOREFF, + SAREG, TUNSIGNED|TPOINT, + SAREG, TUNSIGNED|TPOINT, + 0, RNOP, + " subz# AL,AR,snc\n jmp LC\n", }, + +/* test >= by subtracting and then looking at the sign bit */ +/* XXX double/check */ +{ GE, FOREFF, + SAREG, TINT, + SAREG, TINT, + 0, RNOP, + " subl# AL,AR,snc\n jmp LC\n", }, + +/* Compare long against 0 */ +{ OPLOG, FORCC, + SBREG, TLONG, + SZERO, TANY, + 0, RNOP, + "ZZ", }, + +/* Compare long against right side in memory */ +{ OPLOG, FORCC, + SBREG, TLONG, + SOREG|SCON, TLONG, + NEEDS(NREG(A, 1)), RNOP, + "ZN", }, + /* * Subroutine calls. */ @@ -214,39 +439,106 @@ SCON, TANY, SANY, TANY, 0, 0, - " jsr @CL\n", }, + " jsr @[.word CL]\n", }, { UCALL, FOREFF, SCON, TANY, SANY, TANY, 0, 0, - " jsr @CL\n", }, + " jsr @[.word CL]\n", }, + +{ CALL, FOREFF, + SAREG, TANY, + SANY, TANY, + 0, 0, + " jsr 0,AL\n", }, + +{ UCALL, FOREFF, + SAREG, TANY, + SANY, TANY, + 0, 0, + " jsr 0,AL\n", }, + +{ CALL, INAREG, + SCON, TANY, + SANY, TANY, + XSL(A), RESC1, + " jsr @[.word CL]\n", }, + +{ UCALL, INAREG, + SCON, TANY, + SANY, TANY, + XSL(A), RESC1, + " jsr @[.word CL]\n", }, + +{ CALL, INAREG, + SAREG, TANY, + SANY, TANY, + XSL(A), RESC1, + " jsr 0,AL\n", }, + +{ UCALL, INAREG, + SAREG, TANY, + SANY, TANY, + XSL(A), RESC1, + " jsr 0,AL\n", }, -{ CALL, INAREG|FOREFF, +{ CALL, INAREG, SCON, TANY, SANY, TANY, - NAREG|NASL, RESC1, - " jsr @CL\n", }, + XSL(A), RESC1, + " jsr @[.word CL]\n", }, -{ UCALL, INAREG|FOREFF, +{ UCALL, INAREG, SCON, TANY, SANY, TANY, - NAREG|NASL, RESC1, - " jsr @CL\n", }, + XSL(A), RESC1, + " jsr @[.word CL]\n", }, + +{ CALL, INBREG, + SCON, TANY, + SANY, TANY, + XSL(B), RESC1, + " jsr @[.word CL]\n", }, + +{ UCALL, INBREG, + SCON, TANY, + SANY, TANY, + XSL(B), RESC1, + " jsr @[.word CL]\n", }, + +{ CALL, INBREG, + SAREG, TANY, + SANY, TANY, + XSL(B), RESC1, + " jsr 0,AL\n", }, + +{ UCALL, INBREG, + SAREG, TANY, + SANY, TANY, + XSL(B), RESC1, + " jsr 0,AL\n", }, { GOTO, FOREFF, SCON, TANY, SANY, TANY, 0, RNOP, - " jmp @LL\n", }, + " jmp LL\n", }, { FUNARG, FOREFF, - SAREG|SBREG, TCHAR|TUCHAR|TWORD|TPOINT, + SAREG, TCHAR|TUCHAR|TWORD|TPOINT, SANY, TCHAR|TUCHAR|TWORD|TPOINT, - NBREG, RNULL, - " lda A1,csp\n sta AL,ZB\n", }, + 0, RNULL, + " sta AL,@sp\n", }, + +{ FUNARG, FOREFF, + SBREG, TLONG|TULONG, + SANY, TLONG|TULONG, + 0, RNULL, + " sta AL,@sp\n" + " sta UL,@sp\n" }, -# define DF(x) FORREW,SANY,TANY,SANY,TANY,REWRITE,x,"" +# define DF(x) FORREW,SANY,TANY,SANY,TANY,NEEDS(NREWRITE),x,"" { UMUL, DF( UMUL ), }, @@ -262,7 +554,7 @@ { OPANY, DF(BITYPE), }, -{ FREE, FREE, FREE, FREE, FREE, FREE, FREE, FREE, "help; I'm in trouble\n" }, +{ FREE, FREE, FREE, FREE, FREE, FREE, 0, FREE, "help; I'm in trouble\n" }, }; int tablesize = sizeof(table)/sizeof(table[0]); diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp10/code.c pcc-1.2.0~DEVEL+20220331/arch/pdp10/code.c --- pcc-1.2.0~DEVEL+20200630/arch/pdp10/code.c 2017-02-18 15:43:48.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp10/code.c 2022-03-30 14:11:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: code.c,v 1.43 2017/02/18 15:43:48 ragge Exp $ */ +/* $Id: code.c,v 1.44 2022/03/30 14:11:59 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -37,6 +37,28 @@ #define talloc p1alloc #endif +/* + * Print out assembler segment name. + */ +void +setseg(int seg, char *name) +{ + switch (seg) { + case PROG: name = ".text"; break; + case DATA: + case LDATA: name = ".data"; break; + case UDATA: break; + case STRNG: + case RDATA: name = ".section .rodata"; break; + case NMSEG: + printf(PRTPREF "\t.section %s,\"a%c\",@progbits\n", name, + cftnsp ? 'x' : 'w'); + return; + default: + cerror("bad seg %d", seg); + } + printf(PRTPREF "\t%s\n", name); +} /* * Define everything needed to print out some data (or text). @@ -45,25 +67,7 @@ void defloc(struct symtab *sp) { - char *nextsect = NULL; /* notyet */ - static char *loctbl[] = { "text", "data", "section .rodata" }; - static int lastloc = -1; - TWORD t; - int s; - if (sp == NULL) { - lastloc = -1; - return; - } - t = sp->stype; - s = ISFTN(t) ? PROG : ISCON(cqual(t, sp->squal)) ? RDATA : DATA; - if (nextsect) { - printf(" .section %s\n", nextsect); - nextsect = NULL; - s = -1; - } else if (s != lastloc) - printf(" .%s\n", loctbl[s]); - lastloc = s; if (sp->sclass == EXTDEF) printf(" .globl %s\n", getexname(sp)); if (sp->slevel == 0) @@ -211,3 +215,28 @@ { return 0; } + +/* + * Return "canonical frame address". + */ +NODE * +builtin_cfa(const struct bitable *bt, NODE *a) +{ + uerror(__func__); + return bcon(0); +} + +NODE * +builtin_return_address(const struct bitable *bt, NODE *a) +{ + uerror(__func__); + return bcon(0); +} + +NODE * +builtin_frame_address(const struct bitable *bt, NODE *a) +{ + uerror(__func__); + return bcon(0); +} + diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp10/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/pdp10/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/pdp10/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp10/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,8 +1,8 @@ /README/1.1/Mon Nov 12 19:00:04 2007// -/code.c/1.43/Sat Feb 18 15:43:48 2017// -/local.c/1.79/Sat Feb 18 15:43:48 2017// +/code.c/1.44/Wed Mar 30 14:11:59 2022// +/local.c/1.80/Wed Mar 30 14:11:59 2022// /local2.c/1.108/Sat Feb 18 15:43:48 2017// -/macdefs.h/1.36/Sat Mar 5 15:53:04 2016// -/order.c/1.64/Sat Feb 18 15:43:48 2017// +/macdefs.h/1.38/Wed Mar 30 14:11:59 2022// +/order.c/1.65/Wed Mar 30 14:11:59 2022// /table.c/1.98/Sat Feb 18 15:43:48 2017// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp10/local.c pcc-1.2.0~DEVEL+20220331/arch/pdp10/local.c --- pcc-1.2.0~DEVEL+20200630/arch/pdp10/local.c 2017-02-18 15:43:48.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp10/local.c 2022-03-30 14:11:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.79 2017/02/18 15:43:48 ragge Exp $ */ +/* $Id: local.c,v 1.80 2022/03/30 14:11:59 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -245,22 +245,8 @@ return l; } o = l->n_op; - if (ml == FLOAT || ml == DOUBLE) { - if (o != FCON) - break; - ml = ISUNSIGNED(m) ? UNSIGNED : INT; /* LONG? */ - r = xbcon(ml == INT ? (int)p->n_left->n_dcon : - (unsigned)p->n_left->n_dcon, - NULL, ml); - nfree(p->n_left); - p->n_left = r; - o = ICON; - if (m == ml) { - r = p->n_left; - nfree(p); - return r; - } - } + if (ml == FLOAT || ml == DOUBLE) + cerror("SCONV FCON"); if (o == ICON) { CONSZ val = glval(l); @@ -295,11 +281,6 @@ break; case VOID: break; - case DOUBLE: - case FLOAT: - l->n_op = FCON; - l->n_dcon = 0; - break; default: cerror("unknown type %d", m); } @@ -801,27 +782,6 @@ } /* - * set fsz bits in sequence to zero. - */ -void -zbits(OFFSZ off, int fsz) -{ - cerror("zbits"); -} - -/* - * Initialize a bitfield. - */ -void -infld(CONSZ off, int fsz, CONSZ val) -{ -// if (idebug) -// printf("infld off %lld, fsz %d, val %lld inbits %d\n", -// off, fsz, val, inbits); - cerror("infld"); -} - -/* * print out a constant node, may be associated with a label. * Do not free the node after use. * off is bit offset from the beginning of the aggregate diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp10/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/pdp10/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/pdp10/macdefs.h 2016-03-05 15:53:04.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp10/macdefs.h 2022-03-30 14:11:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.36 2016/03/05 15:53:04 ragge Exp $ */ +/* $Id: macdefs.h,v 1.38 2022/03/30 14:11:59 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -107,8 +107,7 @@ #define LABFMT ".L%d" /* format for printing labels */ #define STABLBL ".LL%d" /* format for stab (debugging) labels */ -#undef BACKAUTO /* stack grows negatively for automatics */ -#undef BACKTEMP /* stack grows negatively for temporaries */ +#undef STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_BE @@ -241,3 +240,9 @@ #define ENCRA(x,y) ((x) << (6+y*6)) /* encode regs in int */ #define GCLASS(x) (x < 16 ? CLASSA : CLASSB) int COLORMAP(int c, int *r); + +/* floating point definitions */ +/* XXX needs fixing for pdp10 */ +#define FDFLOAT +#define DEFAULT_FPI_DEFS { &fpi_ffloat, &fpi_dfloat, &fpi_dfloat } + diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp10/order.c pcc-1.2.0~DEVEL+20220331/arch/pdp10/order.c --- pcc-1.2.0~DEVEL+20200630/arch/pdp10/order.c 2017-02-18 15:43:48.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp10/order.c 2022-03-30 14:11:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: order.c,v 1.64 2017/02/18 15:43:48 ragge Exp $ */ +/* $Id: order.c,v 1.65 2022/03/30 14:11:59 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -174,7 +174,8 @@ int * livecall(NODE *p) { - static int r[8], *s = r; + static int r[8]; + int *s = r; *s = -1; if (p->n_op == UCALL || p->n_op == UFORTCALL || p->n_op == USTCALL || diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp11/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/pdp11/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/pdp11/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp11/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.17/Thu Apr 25 17:39:23 2019// /local.c/1.25/Tue Apr 23 16:14:39 2019// /local2.c/1.20/Sat Apr 27 20:35:52 2019// -/macdefs.h/1.17/Mon Apr 22 09:21:55 2019// +/macdefs.h/1.18/Fri Oct 8 15:59:07 2021// /order.c/1.13/Thu Apr 25 17:40:33 2019// /table.c/1.17/Sat Apr 27 20:35:52 2019// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp11/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/pdp11/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/pdp11/macdefs.h 2019-04-22 09:21:55.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp11/macdefs.h 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.17 2019/04/22 09:21:55 ragge Exp $ */ +/* $Id: macdefs.h,v 1.18 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -110,8 +110,7 @@ #define ARGOFFSET 8 #endif -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE /* XXX TARGET_PDP */ diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp7/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/pdp7/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/pdp7/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp7/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.7/Thu Feb 16 18:55:31 2017// /local.c/1.8/Thu Feb 16 18:55:31 2017// /local2.c/1.9/Thu Feb 16 18:55:31 2017// -/macdefs.h/1.8/Thu Feb 16 18:55:31 2017// +/macdefs.h/1.9/Fri Oct 8 15:59:07 2021// /order.c/1.6/Thu Feb 16 18:55:31 2017// /table.c/1.12/Thu Feb 16 18:55:31 2017// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/pdp7/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/pdp7/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/pdp7/macdefs.h 2017-02-16 18:55:31.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/pdp7/macdefs.h 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.8 2017/02/16 18:55:31 ragge Exp $ */ +/* $Id: macdefs.h,v 1.9 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -101,8 +101,7 @@ #define CONFMT "%llo" /* format for printing constants */ #define LABFMT "L%d" /* format for printing labels */ -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #undef FIELDOPS /* no bit-field instructions */ #define TARGET_ENDIAN TARGET_LE diff -Nru pcc-1.2.0~DEVEL+20200630/arch/powerpc/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/powerpc/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/powerpc/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/powerpc/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,8 +1,8 @@ /README/1.2/Thu Nov 22 16:47:02 2007// /code.c/1.32/Sun Jul 10 09:49:52 2016// -/local.c/1.36/Sun Dec 2 11:11:39 2018// +/local.c/1.37/Fri Oct 30 16:47:53 2020// /local2.c/1.30/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.20/Sun Dec 2 11:11:39 2018// +/macdefs.h/1.22/Fri Oct 8 15:59:07 2021// /order.c/1.9/Sun Jul 10 09:49:52 2016// /table.c/1.18/Fri Nov 26 17:06:31 2010// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/powerpc/local.c pcc-1.2.0~DEVEL+20220331/arch/powerpc/local.c --- pcc-1.2.0~DEVEL+20200630/arch/powerpc/local.c 2018-12-02 11:11:39.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/powerpc/local.c 2020-10-30 16:47:53.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.36 2018/12/02 11:11:39 ragge Exp $ */ +/* $Id: local.c,v 1.37 2020/10/30 16:47:53 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -216,6 +216,7 @@ return q; } +#if 0 static NODE * convert_ulltof(NODE *p) { @@ -261,6 +262,7 @@ return clocal(buildtree(QUEST, l, r)); } +#endif /* clocal() is called to do local transformations on @@ -486,6 +488,7 @@ return l; } +#if 0 /* * if converting ULONGLONG to FLOAT/(L)DOUBLE, * replace ___floatunsdidf() with ___floatdidf() @@ -494,6 +497,7 @@ p->n_type <= LDOUBLE) { return convert_ulltof(p); } +#endif o = l->n_op; m = p->n_type; diff -Nru pcc-1.2.0~DEVEL+20200630/arch/powerpc/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/powerpc/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/powerpc/macdefs.h 2018-12-02 11:11:39.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/powerpc/macdefs.h 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.20 2018/12/02 11:11:39 ragge Exp $ */ +/* $Id: macdefs.h,v 1.22 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -343,8 +343,7 @@ #ifdef FPREG #define ARGINIT (24*8) /* # bits above fp where arguments start */ #define AUTOINIT (8*8) /* # bits above fp where automatics start */ -#define BACKAUTO /* stack grows negatively for automatics */ -#define BACKTEMP /* stack grows negatively for temporaries */ +#define STACK_DOWN /* stack grows negatively for automatics */ #else #define ARGINIT (24*8) /* # bits above fp where arguments start */ #define AUTOINIT (56*8) /* # bits above fp where automatics start */ @@ -417,4 +416,4 @@ #define USE_IEEEFP_64 #define DBL_PREFIX IEEEFP_64 #define LDBL_PREFIX IEEEFP_64 - +#define DEFAULT_FPI_DEFS { &fpi_binary32, &fpi_binary64, &fpi_binary64 } diff -Nru pcc-1.2.0~DEVEL+20200630/arch/sparc64/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/sparc64/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/sparc64/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/sparc64/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.23/Fri Jul 24 07:57:01 2015// /local.c/1.34/Thu Jun 23 13:41:25 2011// /local2.c/1.28/Mon Sep 26 16:45:42 2016// -/macdefs.h/1.18/Sat Mar 5 15:53:04 2016// +/macdefs.h/1.19/Fri Oct 8 15:59:07 2021// /order.c/1.7/Sun Jun 5 08:54:42 2011// /table.c/1.29/Sun Jun 5 08:54:42 2011// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/sparc64/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/sparc64/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/sparc64/macdefs.h 2016-03-05 15:53:04.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/sparc64/macdefs.h 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.18 2016/03/05 15:53:04 ragge Exp $ */ +/* $Id: macdefs.h,v 1.19 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright (c) 2008 David Crawshaw @@ -98,8 +98,7 @@ #define LABFMT "L%d" #define STABLBL "LL%d" -#define BACKAUTO /* Stack grows negatively for automatics. */ -#define BACKTEMP /* Stack grows negatively for temporaries. */ +#define STACK_DOWN /* Stack grows negatively for automatics. */ #undef FIELDOPS #define TARGET_ENDIAN TARGET_BE diff -Nru pcc-1.2.0~DEVEL+20200630/arch/vax/CVS/Entries pcc-1.2.0~DEVEL+20220331/arch/vax/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/arch/vax/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/vax/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,7 +1,7 @@ /code.c/1.28/Tue Apr 3 14:49:46 2018// /local.c/1.34/Wed Apr 4 17:34:07 2018// /local2.c/1.44/Tue Apr 3 14:49:46 2018// -/macdefs.h/1.23/Sat Mar 5 15:53:04 2016// +/macdefs.h/1.24/Fri Oct 8 15:59:07 2021// /order.c/1.11/Wed Apr 11 07:27:35 2018// /table.c/1.28/Sun Oct 12 10:05:28 2014// D diff -Nru pcc-1.2.0~DEVEL+20200630/arch/vax/macdefs.h pcc-1.2.0~DEVEL+20220331/arch/vax/macdefs.h --- pcc-1.2.0~DEVEL+20200630/arch/vax/macdefs.h 2016-03-05 15:53:04.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/arch/vax/macdefs.h 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: macdefs.h,v 1.23 2016/03/05 15:53:04 ragge Exp $ */ +/* $Id: macdefs.h,v 1.24 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -103,8 +103,7 @@ /* show stack grows negatively */ -#define BACKAUTO -#define BACKTEMP +#define STACK_DOWN /* show field hardware support on VAX */ /* XXX notyet */ diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cc/cc.c pcc-1.2.0~DEVEL+20220331/cc/cc/cc.c --- pcc-1.2.0~DEVEL+20200630/cc/cc/cc.c 2020-04-11 16:10:22.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cc/cc.c 2021-10-15 15:33:09.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: cc.c,v 1.325 2020/04/11 16:10:22 plunky Exp $ */ +/* $Id: cc.c,v 1.328 2021/10/15 15:33:09 ragge Exp $ */ /*- * Copyright (c) 2011 Joerg Sonnenberger . @@ -148,6 +148,23 @@ #ifndef LINKER #define LINKER "ld" #endif + +#ifndef CC0 +#define CC0 "cc0" +#endif +#ifndef CC1 +#define CC1 "cc1" +#endif +#ifndef CC2 +#define CC2 "cc2" +#endif +#ifndef CXX0 +#define CXX0 "cxx0" +#endif +#ifndef CXX1 +#define CXX1 "cxx1" +#endif + char *passp = PREPROCESSOR; char *pass0 = COMPILER; char *passxx0 = CXXCOMPILER; @@ -227,7 +244,7 @@ #define DEFCXXLIBS { "-lp++", "-lpcc", "-lc", "-lpcc", 0 } #endif #ifndef STARTLABEL -#define STARTLABEL "__start" +#define STARTLABEL "__start" #endif #ifndef DYNLINKARG #define DYNLINKARG "-dynamic-linker" @@ -1256,6 +1273,16 @@ return xstrdup(file); } +#ifdef HAVE_CC2 +#ifdef NEED_CC2 +#define C2check 1 +#else +#define C2check Oflag +#endif +#else +#define C2check 0 +#endif + #ifdef TWOPASS static int compile_input(char *input, char *output) @@ -1271,7 +1298,7 @@ strlist_append(&args, input); strlist_append(&args, tfile); strlist_prepend(&args, - find_file(cxxflag ? "cxx0" : "cc0", &progdirs, X_OK)); + find_file(cxxflag ? CXX0 : CC0, &progdirs, X_OK)); retval = strlist_exec(&args); strlist_free(&args); if (retval) @@ -1282,7 +1309,7 @@ strlist_append(&args, tfile); strlist_append(&args, output); strlist_prepend(&args, - find_file(cxxflag ? "cxx1" : "cc1", &progdirs, X_OK)); + find_file(cxxflag ? CXX1: CC1, &progdirs, X_OK)); retval = strlist_exec(&args); strlist_free(&args); return retval; @@ -1292,16 +1319,31 @@ compile_input(char *input, char *output) { struct strlist args; + char *tfile; int retval; + tfile = output; + if (C2check) + strlist_append(&temp_outputs, tfile = gettmp()); + strlist_init(&args); strlist_append_list(&args, &compiler_flags); strlist_append(&args, input); - strlist_append(&args, output); + strlist_append(&args, tfile); strlist_prepend(&args, find_file(cxxflag ? passxx0 : pass0, &progdirs, X_OK)); retval = strlist_exec(&args); strlist_free(&args); + if (retval) + return retval; + if (C2check) { + strlist_init(&args); + strlist_append(&args, tfile); + strlist_append(&args, output); + strlist_prepend(&args, find_file(CC2, &progdirs, X_OK)); + retval = strlist_exec(&args); + strlist_free(&args); + } return retval; } #endif @@ -1928,7 +1970,7 @@ #if !defined(os_sunos) && !defined(mach_i386) { &vflag, 1, "-v" }, #endif -#ifdef os_darwin +#if defined(os_darwin) { &Bstatic, 0, "-k" }, #elif defined(os_sunos) && defined(mach_i386) { &kflag, 1, "-K" }, @@ -2061,8 +2103,10 @@ strlist_append(&early_linker_flags, dynlinkarg); strlist_append(&early_linker_flags, dynlinklib); } +#ifndef os_darwin strlist_append(&early_linker_flags, "-e"); strlist_append(&early_linker_flags, STARTLABEL); +#endif } if (shared == 0 && rflag) strlist_append(&early_linker_flags, "-r"); @@ -2131,7 +2175,9 @@ b = RCRT0; else b = CRT0; +#ifndef os_darwin strap(&middle_linker_flags, &crtdirs, b, 'p'); +#endif } #endif } diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cc/CVS/Entries pcc-1.2.0~DEVEL+20220331/cc/cc/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/cc/cc/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cc/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,4 +1,4 @@ -/Makefile.in/1.38/Tue Sep 11 11:24:08 2018// +/Makefile.in/1.39/Sat Sep 4 10:38:37 2021// /cc.1/1.45/Mon Oct 10 11:27:49 2016// -/cc.c/1.325/Sat Apr 11 16:10:22 2020// +/cc.c/1.328/Fri Oct 15 15:33:09 2021// D diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cc/Makefile.in pcc-1.2.0~DEVEL+20220331/cc/cc/Makefile.in --- pcc-1.2.0~DEVEL+20200630/cc/cc/Makefile.in 2018-09-11 11:24:08.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cc/Makefile.in 2021-09-04 10:38:37.000000000 +0000 @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.38 2018/09/11 11:24:08 ragge Exp $ +# $Id: Makefile.in,v 1.39 2021/09/04 10:38:37 gmcgarry Exp $ # # Makefile.in for the cc part of pcc. # @@ -32,6 +32,7 @@ -Dos_$(TARGOS) -Dmach_$(TARGMACH) -DTARGOSVER=$(TARGOSVER) \ -DCXXPROGNAME=\"$(BINPREFIX)p++$(EXEEXT)\" \ -DCPPROGNAME=\"$(BINPREFIX)pcpp$(EXEEXT)\" \ + -DCC0=\"$(BINPREFIX)cc0$(EXEEXT)\" -DCC1=\"$(BINPREFIX)cc1$(EXEEXT)\" \ -I$(top_srcdir)/cc/driver -I$(top_builddir) \ -I$(top_srcdir)/os/$(TARGOS) -I$(MIPDIR) -I$(MDIR) -I$(COMMONDIR) LIBS = @LIBS@ diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/builtins.c pcc-1.2.0~DEVEL+20220331/cc/ccom/builtins.c --- pcc-1.2.0~DEVEL+20200630/cc/ccom/builtins.c 2020-06-13 14:55:53.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/builtins.c 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: builtins.c,v 1.77 2020/06/13 14:55:53 ragge Exp $ */ +/* $Id: builtins.c,v 1.79 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -170,20 +170,20 @@ { P1ND *f, *t1, *t2, *t3, *t4, *t5, *t6, *t7, *t8; -#define X(x) xbcon(x, NULL, ctype(ULONGLONG)) - t1 = buildtree(LS, buildtree(AND, ccopy(a), X(255)), bcon(56)); - t2 = buildtree(LS, buildtree(AND, ccopy(a), X(255 << 8)), bcon(40)); - t3 = buildtree(LS, buildtree(AND, ccopy(a), X(255 << 16)), bcon(24)); - t4 = buildtree(LS, buildtree(AND, ccopy(a), X(255 << 24)), bcon(8)); - t5 = buildtree(AND, buildtree(RS, ccopy(a), bcon(8)), X(255 << 24)); - t6 = buildtree(AND, buildtree(RS, ccopy(a), bcon(24)), X(255 << 16)); - t7 = buildtree(AND, buildtree(RS, ccopy(a), bcon(40)), X(255 << 8)); - t8 = buildtree(AND, buildtree(RS, a, bcon(56)), X(255)); +#define XBCON(x) xbcon(x, NULL, ctype(ULONGLONG)) + t1 = buildtree(LS, buildtree(AND, ccopy(a), XBCON(255)), bcon(56)); + t2 = buildtree(LS, buildtree(AND, ccopy(a), XBCON(255 << 8)), bcon(40)); + t3 = buildtree(LS, buildtree(AND, ccopy(a), XBCON(255 << 16)), bcon(24)); + t4 = buildtree(LS, buildtree(AND, ccopy(a), XBCON(255 << 24)), bcon(8)); + t5 = buildtree(AND, buildtree(RS, ccopy(a), bcon(8)), XBCON(255 << 24)); + t6 = buildtree(AND, buildtree(RS, ccopy(a), bcon(24)), XBCON(255 << 16)); + t7 = buildtree(AND, buildtree(RS, ccopy(a), bcon(40)), XBCON(255 << 8)); + t8 = buildtree(AND, buildtree(RS, a, bcon(56)), XBCON(255)); f = buildtree(OR, buildtree(OR, buildtree(OR, t1, t2), buildtree(OR, t3, t4)), buildtree(OR, buildtree(OR, t5, t6), buildtree(OR, t7, t8))); return f; -#undef X +#undef XBCON } #endif @@ -453,7 +453,7 @@ /* do the real job */ p = buildtree(ADDROF, p, NULL); /* address of last arg */ -#ifdef BACKAUTO +#ifdef STACK_DOWN p = optim(buildtree(PLUS, p, bcon(sz))); /* add one to it (next arg) */ #else p = optim(buildtree(MINUS, p, bcon(sz))); /* add one to it (next arg) */ @@ -487,7 +487,7 @@ #endif sz /= SZCHAR; /* add one to ap */ -#ifdef BACKAUTO +#ifdef STACK_DOWN rv = buildtree(COMOP, rv , buildtree(PLUSEQ, a->n_left, bcon(sz))); #else ecomp(buildtree(MINUSEQ, a->n_left, bcon(sz))); diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/CVS/Entries pcc-1.2.0~DEVEL+20220331/cc/ccom/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/cc/ccom/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,19 +1,19 @@ -/Makefile.in/1.51/Sun Mar 3 11:19:35 2019// -/builtins.c/1.77/Sat Jun 13 14:55:53 2020// +/Makefile.in/1.55/Sun Mar 27 17:02:29 2022// +/builtins.c/1.79/Fri Oct 8 15:59:07 2021// /ccom.1/1.33/Sat Dec 15 09:12:14 2018// /cgram.y/1.422/Sun Sep 8 09:30:51 2019// /dwarf.c/1.2/Tue Mar 8 18:17:45 2016// /dwarf.h/1.1/Sun Feb 21 11:11:55 2016// /gcc_compat.c/1.122/Thu Mar 8 12:23:00 2018// -/init.c/1.109/Sun Aug 18 09:45:09 2019// +/init.c/1.110/Sun Sep 12 10:49:49 2021// /inline.c/1.66/Mon Sep 26 16:45:43 2016// -/main.c/1.136/Fri Nov 23 14:43:06 2018// +/main.c/1.137/Sun Aug 29 09:21:56 2021// /optim.c/1.66/Mon Apr 22 06:41:18 2019// -/pass1.h/1.319/Sun Sep 8 09:57:48 2019// -/pftn.c/1.433/Tue Sep 24 19:57:31 2019// +/pass1.h/1.320/Wed Oct 13 17:07:03 2021// +/pftn.c/1.439/Sun Mar 27 20:11:30 2022// /scan.l/1.162/Sun Feb 2 09:52:31 2020// /softfloat.c/1.4/Wed Jul 29 12:32:34 2009// /stabs.c/1.35/Tue Sep 15 20:01:10 2015// /symtabs.c/1.40/Mon Apr 8 13:30:17 2019// -/trees.c/1.391/Tue Sep 24 19:57:31 2019// +/trees.c/1.393/Wed Oct 13 17:07:04 2021// D diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/init.c pcc-1.2.0~DEVEL+20220331/cc/ccom/init.c --- pcc-1.2.0~DEVEL+20200630/cc/ccom/init.c 2019-08-18 09:45:09.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/init.c 2021-09-12 10:49:49.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.109 2019/08/18 09:45:09 ragge Exp $ */ +/* $Id: init.c,v 1.110 2021/09/12 10:49:49 gmcgarry Exp $ */ /* * Copyright (c) 2004, 2007 Anders Magnusson (ragge@ludd.ltu.se). @@ -311,7 +311,7 @@ int shsz = SZCHAR-inbits; xinval = (xinval << shsz) | (val >> (fsz - shsz)); printf(PRTPREF "%s " CONFMT "\n", - astypnames[CHAR], xinval & SZMASK(SZCHAR)); + astypnames[CHAR], (CONSZ)(xinval & SZMASK(SZCHAR))); fsz -= shsz; val &= SZMASK(fsz); xinval = inbits = 0; @@ -362,7 +362,7 @@ fsz -= m; xinval <<= m; printf(PRTPREF "%s " CONFMT "\n", - astypnames[CHAR], xinval & SZMASK(SZCHAR)); + astypnames[CHAR], (CONSZ)(xinval & SZMASK(SZCHAR))); xinval = inbits = 0; } } diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/main.c pcc-1.2.0~DEVEL+20220331/cc/ccom/main.c --- pcc-1.2.0~DEVEL+20200630/cc/ccom/main.c 2018-11-23 14:43:06.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/main.c 2021-08-29 09:21:56.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.136 2018/11/23 14:43:06 ragge Exp $ */ +/* $Id: main.c,v 1.137 2021/08/29 09:21:56 gmcgarry Exp $ */ /* * Copyright (c) 2002 Anders Magnusson. All rights reserved. @@ -105,6 +105,7 @@ static void fflags(char *str) { +#ifndef PASS2 int flagval = 1; if (strncmp("no-", str, 3) == 0) { @@ -112,7 +113,6 @@ flagval = 0; } -#ifndef PASS2 if (strcmp(str, "stack-protector") == 0) sspflag = flagval; else if (strcmp(str, "stack-protector-all") == 0) @@ -132,7 +132,10 @@ int main(int argc, char *argv[]) { - int ch, sdflag; + int ch; +#ifndef PASS2 + int sdflag; +#endif //kflag = 1; #ifdef TIMING @@ -224,11 +227,11 @@ case 'k': /* PIC code */ ++kflag; break; - +#ifndef PASS1 case 'm': /* Target-specific */ mflags(optarg); break; - +#endif case 'p': /* Profiling */ ++pflag; break; diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/Makefile.in pcc-1.2.0~DEVEL+20220331/cc/ccom/Makefile.in --- pcc-1.2.0~DEVEL+20200630/cc/ccom/Makefile.in 2019-03-03 11:19:35.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/Makefile.in 2022-03-27 17:02:29.000000000 +0000 @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.51 2019/03/03 11:19:35 ragge Exp $ +# $Id: Makefile.in,v 1.55 2022/03/27 17:02:29 ragge Exp $ # # Makefile.in for ccom # @@ -37,6 +37,8 @@ CCOM=$(BINPREFIX)ccom$(EXEEXT) CC0=$(BINPREFIX)cc0$(EXEEXT) CC1=$(BINPREFIX)cc1$(EXEEXT) +CC2=$(BINPREFIX)cc2$(EXEEXT) +CC2MSRC=$(top_srcdir)/cc2/cc2.$(TARGMACH).c CF0=@CF0@ CF1=@CF1@ @@ -48,7 +50,7 @@ MANPAGE=$(BINPREFIX)ccom MKEXT=mkext$(EXEEXT) -all: $(DEST) +all: $(DEST) $(CC2) OBJS= builtins.o cgram.o code.o common.o compat.o dwarf.o external.o \ gcc_compat.o init.o inline.o local.o local2.o main.o \ @@ -57,7 +59,7 @@ OBJS0= builtins.o cgram.o code.o common.o compat.o dwarf.o external.o \ gcc_compat.o init.o inline.o local.o main.o \ - optim.o pftn.o softfloat.o strtodg.o \ + optim.o pftn.o softfloat.o \ scan.o stabs.o symtabs.o trees.o unicode.o OBJS1= common2.o compat.o external.o \ @@ -208,14 +210,27 @@ $(CC1): $(OBJS1) $(CC) $(LDFLAGS) $(OBJS1) -o $@ $(LIBS) +$(CC2): $(CC2MSRC) + @if [ -s $(CC2MSRC) ]; then \ + echo $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(CC2MSRC) -o $@ ; \ + $(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(CC2MSRC) -o $@ ; \ + else \ + touch $@ ; \ + fi + +$(CC2MSRC): + touch $@ + + install: $(DEST) test -z "$(DESTDIR)$(libexecdir)" || mkdir -p "$(DESTDIR)$(libexecdir)" $(INSTALL_PROGRAM) $(DEST) $(DESTDIR)$(libexecdir) + $(INSTALL_PROGRAM) $(CC2) $(DESTDIR)$(libexecdir) test -z "$(DESTDIR)$(mandir)/man1" || mkdir -p "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) $(srcdir)/ccom.1 $(DESTDIR)$(mandir)/man1/$(MANPAGE).1 clean: - rm -f $(DEST) $(OBJS0) $(OBJS1) $(MKEXT) $(LOBJS) \ + rm -f $(DEST) $(OBJS0) $(OBJS1) $(MKEXT) $(LOBJS) $(CC2) \ $(LEX_OUTPUT_ROOT).c scan.c y.tab.[ch] cgram.[ch] external.[ch] distclean: clean diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/pass1.h pcc-1.2.0~DEVEL+20220331/cc/ccom/pass1.h --- pcc-1.2.0~DEVEL+20200630/cc/ccom/pass1.h 2019-09-08 09:57:48.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/pass1.h 2021-10-13 17:07:03.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: pass1.h,v 1.319 2019/09/08 09:57:48 ragge Exp $ */ +/* $Id: pass1.h,v 1.320 2021/10/13 17:07:03 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -434,6 +434,7 @@ void blkfree(void); char *getexname(struct symtab *sp); void putjops(P1ND *p, void *arg); +int tnodenr(struct symtab *); void p1walkf(P1ND *, void (*f)(P1ND *, void *), void *); void p1fwalk(P1ND *t, void (*f)(P1ND *, int, int *, int *), int down); diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/pftn.c pcc-1.2.0~DEVEL+20220331/cc/ccom/pftn.c --- pcc-1.2.0~DEVEL+20200630/cc/ccom/pftn.c 2019-09-24 19:57:31.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/pftn.c 2022-03-27 20:11:30.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: pftn.c,v 1.433 2019/09/24 19:57:31 ragge Exp $ */ +/* $Id: pftn.c,v 1.439 2022/03/27 20:11:30 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -172,7 +172,7 @@ struct symtab *p; TWORD type, qual; TWORD stp, stq; - int scl; + int scl, i; union dimfun *dsym, *ddef; int slev, temp, changed; @@ -442,13 +442,12 @@ case REGISTER: p->sclass = class = AUTO; +#ifndef PASS1 if (astr != NULL) { #ifdef GCC_COMPAT if (blevel == 0) werror("no register assignment (yet)"); else if (astr != NULL) { - int i; - for (i = 0; i < MAXREGS; i++) { extern char *rnames[]; /* XXX */ if (strcmp(rnames[i], astr) == 0) { @@ -463,11 +462,15 @@ } #endif } +#endif /* FALLTHROUGH */ case AUTO: if (isdyn(p)) { p->sflags |= SDYNARRAY; dynalloc(p, &autooff); + } else if ((i = tnodenr(p)) != 0) { + p->soffset = i; + p->sflags |= STNODE; } else oalloc(p, &autooff); break; @@ -541,6 +544,7 @@ extern struct savbc *savbc; extern struct swdef *swpole; extern int tvaloff; + int stack_usage; char *c; if (retlab != NOLAB && nerrors == 0) { /* inside a real function */ @@ -549,8 +553,12 @@ ecomp(buildtree(FORCE, p1tcopy(cftnod), NIL)); efcode(); /* struct return handled here */ c = getexname(cftnsp); - SETOFF(maxautooff, ALCHAR); - send_passt(IP_EPILOG, maxautooff/SZCHAR, c, +#ifndef STACK_TYPE +#define STACK_TYPE CHAR +#endif + SETOFF(maxautooff, talign(STACK_TYPE, NULL)); + stack_usage = maxautooff / (int)tsize(STACK_TYPE, NULL, NULL); + send_passt(IP_EPILOG, stack_usage, c, cftnsp->stype, cftnsp->sclass == EXTDEF, retlab, tvaloff, mkclabs()); } @@ -1308,7 +1316,11 @@ } /* - * allocate p with offset *poff, and update *poff + * allocate p with offset *poff, and update *poff. + * This routine is used to create stack reference for arguments and automatics. + * poff is always increasing even if the stack goes downwards, hence + * the off must must be calculated before/after the increase/decrease + * of the stack pointer. */ int oalloc(struct symtab *p, int *poff ) @@ -1316,50 +1328,41 @@ int al, off, tsz; int noff; - /* - * Only generate tempnodes if we are optimizing, - * and only for integers, floats or pointers, - * and not if the type on this level is volatile. - */ - if (xtemps && ((p->sclass == AUTO) || (p->sclass == REGISTER)) && - (p->stype < STRTY || ISPTR(p->stype)) && - !(cqual(p->stype, p->squal) & VOL) && cisreg(p->stype)) { - NODE *tn = tempnode(0, p->stype, p->sdf, p->sap); - p->soffset = regno(tn); - p->sflags |= STNODE; - nfree(tn); - return 0; - } - al = talign(p->stype, p->sap); - noff = off = *poff; + noff = *poff; + off = 0; tsz = (int)tsize(p->stype, p->sdf, p->sap); -#ifdef BACKAUTO + +#ifdef STACK_DOWN if (p->sclass == AUTO) { - noff = off + tsz; - if (noff < 0) - cerror("stack overflow"); + /* negative part of stack */ + noff += tsz; SETOFF(noff, al); off = -noff; + } else if (p->sclass == PARAM) { + /* positive part of stack */ + if (p->stype < INT || p->stype == BOOL) + tsz = SZINT, al = ALINT; + off = upoff(tsz, al, &noff); } else -#endif - if (p->sclass == PARAM && (p->stype == CHAR || p->stype == UCHAR || - p->stype == SHORT || p->stype == USHORT || p->stype == BOOL)) { - off = upoff(SZINT, ALINT, &noff); -#if TARGET_ENDIAN == TARGET_BE - off = noff - tsz; -#endif - } else { + cerror("bad oalloc class %d", p->sclass); +#else + if (p->sclass == AUTO) { + /* positive part of stack */ off = upoff(tsz, al, &noff); - } + } else if (p->sclass == PARAM) { + /* negative part of stack */ + noff += tsz; + SETOFF(noff, al); + off = -noff; + } else + cerror("bad oalloc class %d", p->sclass); +#endif - if (p->sclass != REGISTER) { - /* in case we are allocating stack space for register arguments */ - if (p->soffset == NOOFFSET) - p->soffset = off; - else if(off != p->soffset) - return(1); - } + if (p->soffset == NOOFFSET) + p->soffset = off; + else if(off != p->soffset) + cerror("oalloc: reallocated"); *poff = noff; return(0); @@ -2248,6 +2251,8 @@ fwalk(a, eprint, 0); } #endif + if (ISARY(f->n_type)) + goto build; /* something bad happened */ /* First let MD code do something */ calldec(f, a); diff -Nru pcc-1.2.0~DEVEL+20200630/cc/ccom/trees.c pcc-1.2.0~DEVEL+20220331/cc/ccom/trees.c --- pcc-1.2.0~DEVEL+20200630/cc/ccom/trees.c 2019-09-24 19:57:31.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/ccom/trees.c 2021-10-13 17:07:04.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: trees.c,v 1.391 2019/09/24 19:57:31 ragge Exp $ */ +/* $Id: trees.c,v 1.393 2021/10/13 17:07:04 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -1900,6 +1900,18 @@ int tvaloff = MAXREGS+NPERMREG > 100 ? MAXREGS+NPERMREG + 100 : 100; +static int +getn(TWORD t) +{ + int n; + + if (tvaloff == -NOOFFSET) + tvaloff++; /* Skip this for array indexing */ + n = tvaloff; + tvaloff += szty(t); + return n; +} + /* * Returns a TEMP node with temp number nr. * If nr == 0, return a node with a new number. @@ -1909,15 +1921,25 @@ { P1ND *r; - if (tvaloff == -NOOFFSET) - tvaloff++; /* Skip this for array indexing */ r = block(TEMP, NULL, NULL, type, df, ap); - regno(r) = nr ? nr : tvaloff; - tvaloff += szty(type); + regno(r) = nr ? nr : getn(type); return r; } /* + * Return a tempnode number for a symtab entry (if OK), else 0. + */ +int +tnodenr(struct symtab *sp) +{ + if (xtemps && (sp->stype < STRTY || ISPTR(sp->stype)) && + !(cqual(sp->stype, sp->squal) & VOL) && cisreg(sp->stype)) { + return getn(sp->stype); + } + return 0; +} + +/* * Do sizeof on p. */ P1ND * @@ -2223,15 +2245,21 @@ cstknode(TWORD t, union dimfun *df, struct attr *ap) { struct symtab *sp; + int i; /* create a symtab entry suitable for this type */ sp = getsymtab("0hej", SSTMT); sp->stype = t; + sp->squal = 0; sp->sdf = df; sp->sap = ap; sp->sclass = AUTO; sp->soffset = NOOFFSET; - oalloc(sp, &autooff); + if ((i = tnodenr(sp)) != 0) { + sp->soffset = i; + sp->sflags |= STNODE; + } else + oalloc(sp, &autooff); return nametree(sp); } @@ -2713,7 +2741,7 @@ if (ty != BITYPE) { if (p->n_op != NAME && p->n_op != ICON) printf("%d ", p->n_rval); - } + } /* handle special cases */ if (p->n_op == NAME || p->n_op == ICON || @@ -2778,7 +2806,16 @@ printf("^ %d\n", ip->ip_lbl); break; case IP_ASM: - printf("$ %s\n", ip->ip_asm); + { + const char *s = ip->ip_asm; + printf("$ "); + while (*s != '\0') { + putchar(*s); + if (*s++ == '\n') + printf("$ "); + } + printf("\n"); + } break; case IP_EPILOG: ipp = (struct interpass_prolog *)ip; diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cpp/cpp.c pcc-1.2.0~DEVEL+20220331/cc/cpp/cpp.c --- pcc-1.2.0~DEVEL+20200630/cc/cpp/cpp.c 2020-02-26 17:58:19.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cpp/cpp.c 2021-08-09 03:08:39.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: cpp.c,v 1.324 2020/02/26 17:58:19 ragge Exp $ */ +/* $Id: cpp.c,v 1.327 2021/08/09 03:08:39 gmcgarry Exp $ */ /* * Copyright (c) 2004,2010 Anders Magnusson (ragge@ludd.luth.se). @@ -182,7 +182,7 @@ static void macsav(int ch); static void fstrstr(struct iobuf *ib, struct iobuf *ob); static usch *chkfile(const usch *n1, const usch *n2); -static usch *addname(usch *str); +static usch *addname(const usch *str); static void *addblock(int sz); int @@ -723,7 +723,7 @@ line(void) { register struct iobuf *ob; - register int x, n, ln, oidx; + register int x, n, ln = 0, oidx; oidx = ifiles->idx; @@ -802,8 +802,7 @@ free(nm); nm = addname(ob->buf); bufree(ob); - if (pushfile(nm, fn, SYSINC, NULL) == 0) - return 1; + pushfile(nm, fn, SYSINC, NULL); return 0; } @@ -846,7 +845,6 @@ if (fsrch_macos_framework(fn, dir) == 1) return 1; } - free(dir); if (fsrch_macos_framework(fn, (const usch *)"/Library/Frameworks/") == 1) @@ -2703,12 +2701,13 @@ * */ static usch * -addname(register usch *str) +addname(const usch *str) { static usch *nbase; static int nsz; - register usch *w = str; - register int len; + const usch *w = str; + usch *p; + int len; while (*w++) ; @@ -2718,10 +2717,10 @@ nsz = MINBUF; } nsz -= len; - w = nbase; + p = nbase; while ((*nbase++ = *str++)) ; - return w; + return p; } /* diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cpp/CVS/Entries pcc-1.2.0~DEVEL+20220331/cc/cpp/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/cc/cpp/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cpp/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,9 +1,9 @@ /Makefile.in/1.56/Mon Jun 29 13:37:18 2020// /cpc.c/1.8/Mon Aug 8 16:38:29 2016// /cpp.1/1.17/Tue Feb 26 19:27:38 2013// -/cpp.c/1.324/Wed Feb 26 17:58:19 2020// +/cpp.c/1.327/Mon Aug 9 03:08:39 2021// /cpp.h/1.121/Sun Feb 16 11:19:36 2020// /cpy.y/1.21/Wed May 28 08:52:42 2014// -/token.c/1.213/Mon Jun 29 07:41:07 2020// +/token.c/1.214/Sun Sep 12 12:06:30 2021// D/tests//// D diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cpp/token.c pcc-1.2.0~DEVEL+20220331/cc/cpp/token.c --- pcc-1.2.0~DEVEL+20200630/cc/cpp/token.c 2020-06-29 07:41:07.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cpp/token.c 2021-09-12 12:06:30.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: token.c,v 1.213 2020/06/29 07:41:07 ragge Exp $ */ +/* $Id: token.c,v 1.214 2021/09/12 12:06:30 gmcgarry Exp $ */ /* * Copyright (c) 2004,2009 Anders Magnusson. All rights reserved. @@ -663,8 +663,7 @@ if (p == MAXIDSZ) warning("identifier exceeds C99 5.2.4.1, truncating"); if (p < MAXIDSZ) - idbuf[p] = ch; - p++; + idbuf[p++] = ch; } while (ISID(ch = qcchar())); idbuf[p] = 0; unch(ch); diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cxxcom/builtins.c pcc-1.2.0~DEVEL+20220331/cc/cxxcom/builtins.c --- pcc-1.2.0~DEVEL+20200630/cc/cxxcom/builtins.c 2020-06-13 14:55:53.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cxxcom/builtins.c 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: builtins.c,v 1.8 2020/06/13 14:55:53 ragge Exp $ */ +/* $Id: builtins.c,v 1.9 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -328,7 +328,7 @@ /* do the real job */ p = buildtree(ADDROF, p, NIL); /* address of last arg */ -#ifdef BACKAUTO +#ifdef STACK_DOWN p = optim(buildtree(PLUS, p, bcon(sz))); /* add one to it (next arg) */ #else p = optim(buildtree(MINUS, p, bcon(sz))); /* add one to it (next arg) */ @@ -358,7 +358,7 @@ r = a->n_right; sz = (int)tsize(r->n_type, r->n_df, r->n_ap)/SZCHAR; /* add one to ap */ -#ifdef BACKAUTO +#ifdef STACK_DOWN rv = buildtree(COMOP, rv , buildtree(PLUSEQ, a->n_left, bcon(sz))); #else ecomp(buildtree(MINUSEQ, a->n_left, bcon(sz))); diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cxxcom/CVS/Entries pcc-1.2.0~DEVEL+20220331/cc/cxxcom/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/cc/cxxcom/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cxxcom/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,5 +1,5 @@ /Makefile.in/1.8/Tue Sep 11 11:24:08 2018// -/builtins.c/1.8/Sat Jun 13 14:55:53 2020// +/builtins.c/1.9/Fri Oct 8 15:59:07 2021// /cgram.y/1.11/Tue Oct 11 13:48:24 2016// /cxxcode.c/1.7/Tue Oct 11 13:48:24 2016// /cxxdefs.h/1.2/Wed Jan 4 19:04:08 2012// @@ -9,7 +9,7 @@ /main.c/1.7/Thu Mar 16 16:32:51 2017// /optim.c/1.5/Tue Nov 24 17:30:20 2015// /pass1.h/1.20/Sat Mar 5 15:31:25 2016// -/pftn.c/1.17/Tue Oct 11 13:48:24 2016// +/pftn.c/1.18/Fri Oct 8 15:59:07 2021// /scan.l/1.11/Sun Feb 2 09:52:32 2020// /softfloat.c/1.1/Sun Jan 1 16:20:55 2012// /stabs.c/1.3/Sun Apr 22 21:07:41 2012// diff -Nru pcc-1.2.0~DEVEL+20200630/cc/cxxcom/pftn.c pcc-1.2.0~DEVEL+20220331/cc/cxxcom/pftn.c --- pcc-1.2.0~DEVEL+20200630/cc/cxxcom/pftn.c 2016-10-11 13:48:24.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc/cxxcom/pftn.c 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: pftn.c,v 1.17 2016/10/11 13:48:24 ragge Exp $ */ +/* $Id: pftn.c,v 1.18 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -1391,7 +1391,7 @@ al = talign(p->stype, p->sap); noff = off = *poff; tsz = (int)tsize(p->stype, p->sdf, p->sap); -#ifdef BACKAUTO +#ifdef STACK_DOWN if (p->sclass == AUTO) { noff = off + tsz; if (noff < 0) diff -Nru pcc-1.2.0~DEVEL+20200630/cc2/cc2.nova.c pcc-1.2.0~DEVEL+20220331/cc2/cc2.nova.c --- pcc-1.2.0~DEVEL+20200630/cc2/cc2.nova.c 1970-01-01 00:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc2/cc2.nova.c 2021-12-18 13:26:32.000000000 +0000 @@ -0,0 +1,542 @@ +/* $Id: cc2.nova.c,v 1.2 2021/12/18 13:26:32 ragge Exp $ */ + +/* + * Copyright (c) 2021 Anders Magnusson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include "manifest.h" + +/* + * Peephole optimizer for Nova. + * It is mandatory for this program to be run on the assembler file + * after compilation, to cleanup short-distance jumps/loads/stores. + * + */ +#define BEGFTN "#BEGFTN" +#define ENDFTN "#ENDFTN" +#define BUFLEN 256 + +/* constant lines */ +struct symtab { + DLIST_ENTRY(symtab) link; + struct symtab *next; + char *name; /* e.g. "L345" */ + int off; /* position in memory */ +}; + +/* Definistion for exactly one word, as linked list in function */ +struct mblk { + DLIST_ENTRY(mblk) link; + char *name; /* input string */ + int off; /* insn offset in memory */ + int base; /* long address position in memory (if needed) */ + struct symtab *sp; /* symbol this jmp wants */ + int flags; +#define INSERTD 001 /* Is an inserted symbol */ +#define FIRST 002 /* First block in function (before moves) */ +#define LAST 004 /* Last block in function (before moves) */ +}; + +struct mblk mpole; +struct symtab spole; + +int lnum, vflag; +int curaddr, offb, offe; + +#define VPRINT(...) if (vflag) fprintf(stderr, __VA_ARGS__) + +static void readftn(void); +static void movecon(void); +static void renum(void); +static void jmpdist(void); +static void printftn(void); + +int +main(int argc, char *argv[]) +{ + char buf[BUFLEN], *b, *pname; + int ch; + + pname = argv[0]; + while ((ch = getopt(argc, argv, "v")) != -1) { + switch (ch) { + case 'v': + vflag++; + break; + default: + fprintf(stderr, + "usage: %s [-v] [infile [outfile]]\n", pname); + } + } + argc -= optind; + argv += optind; + + if (argc > 0) + if (freopen(argv[0], "r", stdin) == NULL) + err(1, "reopen stdin"); + if (argc > 1) + if (freopen(argv[1], "w", stdout) == NULL) + err(1, "reopen stdout"); + + for (;;) { + while ((b = fgets(buf, BUFLEN, stdin)) != NULL) { + if (strncmp(b, BEGFTN, sizeof(BEGFTN) - 1) == 0) + break; + printf("%s", buf); + } + if (b == NULL) + break; + + DLIST_INIT(&mpole,link); + DLIST_INIT(&spole,link); + curaddr = 0; + + readftn(); /* fetch all function lines until end */ + movecon(); /* move constants to before/after functions */ + renum(); /* recalculate all offsets in mblk list */ + jmpdist(); /* insert indirect jmp length words */ + + printftn(); + } + return 0; +} + +#define IMCODE(a,b) ((a << 8) | b) +#define IJMP 1 +#define IJSR 2 +#define IMREF 3 +#define IALC 4 +static struct im { + int code; + int type; +} imatch[] = { + { IMCODE('j','m'), IJMP }, { IMCODE('j','s'), IMREF }, + { IMCODE('l','d'), IMREF }, { IMCODE('s','t'), IMREF }, + { IMCODE('i','s'), IMREF }, { IMCODE('d','s'), IMREF }, + { IMCODE('m','o'), IALC }, + { IMCODE('a','d'), IALC }, + { IMCODE('s','u'), IALC }, + { IMCODE('c','o'), IALC }, + { IMCODE('n','e'), IALC }, + { IMCODE('i','n'), IALC }, + { IMCODE('a','n'), IALC }, + { 0, 0 } +}; + +static int +itype(char *s) +{ + struct im *im = imatch; + int c = (s[0] << 8) | s[1]; + + for (; im->code; im++) + if (im->code == c) + return im->type; + return 0; +} + +static struct mblk * +mkmblk(char *s, int o) +{ + struct mblk *mb = malloc(sizeof(struct mblk)); + mb->name = s; + mb->off = o; + mb->base = mb->flags = 0; + mb->sp = NULL; + return mb; +} + +static struct symtab * +mksp(char *s) +{ + struct symtab *sp = malloc(sizeof(struct symtab)); + sp->name = s; + sp->off = 0; + sp->next = 0; + return sp; +} + +/* + * Readin function and store in linked list. + * Check directives and do not save .globl. + * This function expects the output syntax that pcc has, do not + * try to parse anything else. + */ +static void +readftn(void) +{ + static struct symtab *savedsp; + struct symtab *sp; + struct mblk *mb; + char buf[BUFLEN]; + char *b, *e; + + for (;;) { + if ((b = fgets(buf, BUFLEN, stdin)) == NULL) + err(1, "fgets"); + if (strncmp(b, ENDFTN, sizeof(ENDFTN)-1) == 0) + break; + while (*b == ' ' || *b == '\t') + b++; + for (e = b; *e; e++) + ; + if (*--e != '\n') + errx(1, "no lf line '%s'", buf); + *e = 0; /* remove trailing lf */ + if (*b == '.') { + if (strncmp(b, ".globl", 6) == 0) { + printf("%s\n", buf); + continue; + } else if (strncmp(b, ".word", 5) != 0) + errx(1, "bad dot dir %s", buf); + } + if (e[-1] == ':') { + *--e = 0; /* remove : */ + sp = mksp(strdup(b)); + sp->next = savedsp; + savedsp = sp; + DLIST_INSERT_BEFORE(&spole, sp, link); + } else { + mb = mkmblk(strdup(b), curaddr); + mb->sp = savedsp; + if (curaddr == 0) + mb->flags |= FIRST; + curaddr++; + savedsp = NULL; + DLIST_INSERT_BEFORE(&mpole, mb, link); + } + } + DLIST_PREV(&mpole, link)->flags |= LAST; +} + +static struct symtab * +findsym(char *s) +{ + struct symtab *sp; + + DLIST_FOREACH(sp, &spole, link) + if (strcmp(sp->name, s) == 0) + return sp; + return NULL; +} + +static struct mblk * +findw(char *s, struct mblk *pole) +{ + struct mblk *mb; + + DLIST_FOREACH(mb, pole, link) { + if (strcmp(s, mb->name) == 0) + return mb; + } + return NULL; +} + +static int +isskip(char *s) +{ + while (*s && *s != ' ' && *s != '\t') + s++; + while (*s == ' ' || *s == '\t') + s++; + if (s[3] == ',') + return 1; + return 0; +} + +/* + * Move constants to a reasonable place. + * The first 128 slots are put on mfirst list, the last 127 on mlast. + * If any place inbetween is needed it is inserted on the correct place + * in the mpole list. + */ +static void +movecon(void) +{ + struct mblk mfirst, mlast; + struct mblk *mb, *mb2, *mblow, *mbhigh, mtemp, *mbpout; + struct symtab *sp; + char buf[BUFLEN]; + char *b, *s; + int curcnt; + + DLIST_INIT(&mfirst,link); + if (curaddr > 128) { + DLIST_FOREACH(mb, &mpole, link) + if (mb->off == 128) + break; + } else + mb = DLIST_PREV(&mpole, link); + mblow = mb; +//printf("movecon1: mblow %p curaddr %d\n", mblow, curaddr); + /* + * First handle constants at the beginning of the function. + * iterate backwards to get constants in the correct order. + */ + for (; mb != &mpole; mb = DLIST_PREV(mb, link)) { + if ((b = strchr(mb->name, '['))) { + s = strdup(b+1); + s[strlen(s)-1] = 0; /* remove trailing ] */ + if ((mb2 = findw(s, &mfirst)) == 0) { + mb2 = mkmblk(s, 0); + mb2->flags = INSERTD; + DLIST_INSERT_AFTER(&mfirst, mb2, link); + } + if (mb2->sp == 0) { + sprintf(buf, "LP%d", lnum++); + sp = mksp(strdup(buf)); + mb2->sp = sp; + DLIST_INSERT_BEFORE(&spole, sp, link); + } + strcpy(b, mb2->sp->name); + } + } + /* move to main list */ + while (!DLIST_ISEMPTY(&mfirst, link)) { + mb = DLIST_PREV(&mfirst, link); + DLIST_REMOVE(mb, link); + DLIST_INSERT_AFTER(&mpole, mb, link); + } + if (curaddr <= 128) + return; /* <= 128 entries */ +//printf("movecon2: mblow %p curaddr %d\n", mblow, curaddr); + /* + * Second; move constants at the end of the function. + */ + DLIST_INIT(&mlast,link); + if (curaddr <= 255) { + mb = DLIST_NEXT(mblow, link); + } else { + DLIST_FOREACH_REVERSE(mb, &mpole, link) + if (mb->off == curaddr-127) + break; + } + mbhigh = mb; +//printf("movecon3: mbhigh %p curaddr %d\n", mbhigh, curaddr); + for (; mb != &mpole; mb = DLIST_NEXT(mb, link)) { + if ((b = strchr(mb->name, '['))) { + s = strdup(b+1); + s[strlen(s)-1] = 0; /* remove trailing ] */ + if ((mb2 = findw(s, &mlast)) == 0) { + mb2 = mkmblk(s, 0); + mb2->flags = INSERTD; + DLIST_INSERT_BEFORE(&mlast, mb2, link); + } + if (mb2->sp == 0) { + sprintf(buf, "LP%d", lnum++); + sp = mksp(strdup(buf)); + mb2->sp = sp; + DLIST_INSERT_BEFORE(&spole, sp, link); + } + strcpy(b, mb2->sp->name); + } + } + /* move to main list */ + while (!DLIST_ISEMPTY(&mlast, link)) { + mb = DLIST_NEXT(&mlast, link); + DLIST_REMOVE(mb, link); + DLIST_INSERT_BEFORE(&mpole, mb, link); + } +//printf("movecon5: mb %p curaddr %d\n", mb, curaddr); + if (curaddr <= 255) + return; +//printf("movecon6: mb %p curaddr %d\n", mb, curaddr); + /* + * Here begins the tricky part. + * - Start at mblow. At the first memref insn start counting. + * - If a valid jmp is found, write out the collected data. + * - if passed 127 insns (or reached mbhigh) and no valid jmp, + * go back (at least) one instruction, insert a jmp, + * and write out the collected data. if passed mbhigh return. + * - go back and try again. + */ + DLIST_INIT(&mtemp, link); + curcnt = 0; + mbpout = NULL; + +//printf("movecon7: mb %p curaddr %d\n", mb, curaddr); + for (mb = DLIST_NEXT(mblow, link); mb != mbhigh; + mb = DLIST_NEXT(mb, link)) { + int ityp = itype(mb->name); + +//printf("movecon4: mb %p mbnum %d lnum %d line %s\n", mb, mb->off, curcnt, mb->name); + if (curcnt) + curcnt++; + if (ityp == IMREF && (b = strchr(mb->name, '['))) { + s = strdup(b+1); + s[strlen(s)-1] = 0; /* remove trailing ] */ + if ((mb2 = findw(s, &mtemp)) == 0) { + mb2 = mkmblk(s, 0); + mb2->flags = INSERTD; + DLIST_INSERT_AFTER(&mtemp, mb2, link); + } + if (mb2->sp == 0) { + sprintf(buf, "LP%d", lnum++); + sp = mksp(strdup(buf)); + mb2->sp = sp; + DLIST_INSERT_BEFORE(&spole, sp, link); + } + strcpy(b, mb2->sp->name); + if (curcnt == 0) + curcnt++; + } + if (curcnt && ityp == IJMP) { + mb2 = DLIST_PREV(mb, link); + if (itype(mb2->name) != IALC || !isskip(mb2->name)) { + mbpout = DLIST_NEXT(mb, link); + /* safe to print out words after jmp */ + while (!DLIST_ISEMPTY(&mtemp, link)) { + mb2 = DLIST_NEXT(&mtemp, link); + DLIST_REMOVE(mb2, link); + DLIST_INSERT_AFTER(mb, mb2, link); + } + curcnt = 0; + } + } + if (curcnt == 127) + errx(1, "curcnt == 127"); + } + if (curcnt) { + if (mb->off - mbpout->off < 128) { + /* can put constants at last position */ + while (!DLIST_ISEMPTY(&mtemp, link)) { + mb2 = DLIST_PREV(&mtemp, link); + DLIST_REMOVE(mb2, link); + DLIST_INSERT_BEFORE(mbpout, mb2, link); + } + } else + errx(1, "FIXME long distance"); + } +//printf("movecon8: mb %p mbnum %d\n", mb, mb->off); +} + +/* + * Update offset numbering in both words and symbols. + */ +static void +renum() +{ + struct symtab *sp; + struct mblk *mb; + int n = 0; + + DLIST_FOREACH(mb, &mpole, link) { + if (mb->flags & FIRST) + offb = n; + if (mb->flags & LAST) + offe = n; + for (sp = mb->sp; sp; sp = sp->next) + sp->off = n; + mb->off = n++; + } +} + +/* + * Check for all local jumps that the distance is inside offsets. + * If it is not, insert an indirect word at a reasonable place. + */ +static void +jmpdist() +{ + struct symtab *sp; + struct mblk *mb, *mb2, *mb3; + char buf[80]; + int ityp; + + DLIST_FOREACH(mb, &mpole, link) { + ityp = itype(mb->name); + if (ityp != IJMP) + continue; + if (mb->name[4] != 'L') + continue; /* not local jmp */ + if ((sp = findsym(&mb->name[4])) == NULL) + errx(1, "sym '%s' undefined", &mb->name[4]); + if (sp->off < mb->off && mb->off-sp->off < 128) + continue; + if (sp->off > mb->off && sp->off-mb->off < 127) + continue; + VPRINT("symbol %s too far away from %s: s=%d m=%d\n", + sp->name, mb->name, sp->off, mb->off); + + /* find where to insert the indirect word */ + if (DLIST_NEXT(mb, link)->flags & INSERTD) { + /* hereafter */ + mb2 = mb; + VPRINT("insert directly after\n"); + } else { + /* search backwards for some place to insert word */ + for (mb2 = DLIST_PREV(mb, link); mb2 != &mpole; + mb2 = DLIST_PREV(mb2, link)) + if (mb2->flags & INSERTD) + break; + if (mb2 == &mpole || mb->off-mb2->off > 128) { + for (mb2 = DLIST_NEXT(mb, link); mb2 != &mpole; + mb2 = DLIST_NEXT(mb2, link)) + if (mb2->flags & INSERTD) + break; + if (mb2 == &mpole || mb2->off-mb->off > 127) { + errx(1,"FIXME: too long distance %d %d", + mb->off, mb2->off); + continue; + } + } + } + sprintf(buf, ".word %s", &mb->name[4]); + mb3 = mkmblk(strdup(buf), 0); + mb3->flags = INSERTD; + DLIST_INSERT_AFTER(mb2, mb3, link); + sprintf(buf, "LP%d", lnum); + mb3->sp = mksp(strdup(buf)); + sprintf(buf, "jmp @LP%d", lnum++); + mb->name = strdup(buf); + if (vflag) + fprintf(stderr, "inserted %s at %d\n", + mb3->sp->name, mb2->off); + } + +} + +/* + * When everything is modified; print out the new function. + */ +static void +printftn(void) +{ + struct symtab *sp; + struct mblk *mb; + + DLIST_FOREACH(mb, &mpole, link) { + while ((sp = mb->sp) != NULL) { + printf("%s:\n", sp->name); + mb->sp = sp->next; + } + printf(" %s\n", mb->name); + } +} diff -Nru pcc-1.2.0~DEVEL+20200630/cc2/CVS/Entries pcc-1.2.0~DEVEL+20220331/cc2/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/cc2/CVS/Entries 1970-01-01 00:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc2/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -0,0 +1,2 @@ +/cc2.nova.c/1.2/Sat Dec 18 13:26:32 2021// +D diff -Nru pcc-1.2.0~DEVEL+20200630/cc2/CVS/Repository pcc-1.2.0~DEVEL+20220331/cc2/CVS/Repository --- pcc-1.2.0~DEVEL+20200630/cc2/CVS/Repository 1970-01-01 00:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc2/CVS/Repository 2022-03-31 01:00:00.000000000 +0000 @@ -0,0 +1 @@ +pcc/cc2 diff -Nru pcc-1.2.0~DEVEL+20200630/cc2/CVS/Root pcc-1.2.0~DEVEL+20220331/cc2/CVS/Root --- pcc-1.2.0~DEVEL+20200630/cc2/CVS/Root 1970-01-01 00:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/cc2/CVS/Root 2022-03-31 01:00:00.000000000 +0000 @@ -0,0 +1 @@ +/cvsroot diff -Nru pcc-1.2.0~DEVEL+20200630/common/CVS/Entries pcc-1.2.0~DEVEL+20220331/common/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/common/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/common/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,6 +1,6 @@ /compat.c/1.13/Fri Jul 24 08:26:05 2015// /compat.h/1.6/Fri Jul 24 08:26:05 2015// -/softfloat.c/1.57/Sun Sep 22 07:59:29 2019// +/softfloat.c/1.59/Mon Aug 9 00:19:41 2021// /softfloat.h/1.23/Sun Aug 25 14:33:30 2019// /strtodg.c/1.2/Mon Aug 6 20:19:33 2018// /unicode.c/1.10/Tue Oct 11 13:48:24 2016// diff -Nru pcc-1.2.0~DEVEL+20200630/common/softfloat.c pcc-1.2.0~DEVEL+20220331/common/softfloat.c --- pcc-1.2.0~DEVEL+20200630/common/softfloat.c 2019-09-22 07:59:29.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/common/softfloat.c 2021-08-09 00:19:41.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: softfloat.c,v 1.57 2019/09/22 07:59:29 ragge Exp $ */ +/* $Id: softfloat.c,v 1.59 2021/08/09 00:19:41 gmcgarry Exp $ */ /* * Copyright (c) 2008 Anders Magnusson. All rights reserved. @@ -788,6 +788,15 @@ *sfp = rv; } +/* All minvals are positive */ +static CONSZ minval[] = { + MIN_CHAR, 0, MIN_SHORT, 0, MIN_INT, 0, + MIN_LONG, 0, MIN_LONGLONG, 0 }; +static U_CONSZ maxval[] = { + MAX_CHAR, MAX_UCHAR, MAX_SHORT, MAX_USHORT, MAX_INT, MAX_UNSIGNED, + MAX_LONG, MAX_ULONG, MAX_LONGLONG, MAX_ULONGLONG +}; + /* * Convert a fp number to a CONSZ. Always chop toward zero. */ @@ -795,8 +804,9 @@ soft_fp2int(SFP sfp, TWORD t) { U_CONSZ rv; + CONSZ rv2; MINT m; - int c, s, e; + int c, s, e, ovf; MINTDECL(m); @@ -813,15 +823,37 @@ rv |= ((CONSZ)m.val[3] << 48); e = e - LDBLPTR->nbits + LDBLPTR->expadj; - while (e > 0) + ovf = 0; + while (e > 0) { + if (rv & (1ULL << 63)) + ovf = 1; rv <<= 1, e--; + } while (e < 0) rv >>= 1, e++; - if (s) - rv = -rv; + /* + * Check for overflow. + * + * For unsigned types; + * - if negative, set 0 + * - if larger than type, set MAX_Utype + * else + * - if smaller than MIN_type, set MIN_type + * - if largern than MAX_type, set MAX_type + */ + if (s == 0) { + if (rv > maxval[t-CHAR] || ovf) + rv = maxval[t-CHAR]; + } else { + rv2 = (CONSZ)rv; + if (rv2 < 0 || -rv2 < minval[t-CHAR] || ovf) + rv = minval[t-CHAR]; + else + rv = -rv2; + } -#ifdef DEBUGFP - { uint64_t u = (uint64_t)sfp->debugfp; +#ifdef notdef /* cannot runtime check conversion */ + if (!ovf) { uint64_t u = (uint64_t)sfp->debugfp; int64_t ss = (int64_t)sfp->debugfp; if (ISUNSIGNED(t)) { if (u != (U_CONSZ)rv) @@ -832,6 +864,7 @@ } } #endif + return rv; } @@ -1480,7 +1513,8 @@ * Convert internally stored floating point to fp type in TWORD. * Save as a static array of uint32_t. */ -uint32_t * soft_toush(SFP sfp, TWORD t, int *nbits) +uint32_t * +soft_toush(SFP sfp, TWORD t, int *nbits) { static SF sf; MINT mant; @@ -1491,7 +1525,9 @@ #ifdef DEBUGFP SD(("soft_toush: sfp %Lf %La t %d\n", sfp->debugfp, sfp->debugfp, t)); #endif +#if (SZLDOUBLE > 64) SD(("soft_toushLD: %x %x %x\n", sfp->fp[2], sfp->fp[1], sfp->fp[0])); +#endif #ifdef DEBUGFP if (sfdebug) { double d = sfp->debugfp; diff -Nru pcc-1.2.0~DEVEL+20200630/config.guess pcc-1.2.0~DEVEL+20220331/config.guess --- pcc-1.2.0~DEVEL+20200630/config.guess 2016-03-13 11:07:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/config.guess 2021-08-08 23:50:11.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2014-11-04' +timestamp='2021-01-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,19 +27,19 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,8 +84,6 @@ exit 1 fi -trap 'exit 1' 1 2 15 - # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,66 +94,89 @@ # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown +UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown +UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown +UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -167,22 +188,32 @@ # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)) + case "$UNAME_MACHINE_ARCH" in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') + endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -197,117 +228,137 @@ os=netbsd ;; esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -319,7 +370,7 @@ echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -329,7 +380,7 @@ exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then + if test "$( (/bin/universe) 2>/dev/null)" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd @@ -342,69 +393,69 @@ echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in + case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + set_cc_for_build + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case "$(/usr/bin/arch -k)" in Series*|S4*) - UNAME_RELEASE=`uname -v` + UNAME_RELEASE=$(uname -v) ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in + UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "$(/bin/arch)" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -415,44 +466,44 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -461,23 +512,23 @@ #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && + SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -502,18 +553,18 @@ exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + UNAME_PROCESSOR=$(/usr/bin/uname -p) + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -530,26 +581,26 @@ echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if test -x /usr/bin/oslevel ; then + IBM_REV=$(/usr/bin/oslevel) else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -560,7 +611,7 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then echo "$SYSTEM_NAME" else @@ -573,28 +624,28 @@ fi exit ;; *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + if test -x /usr/bin/lslpp ; then + IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -609,28 +660,28 @@ echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + if test -x /usr/bin/getconf; then + sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) + sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -663,13 +714,13 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -680,23 +731,23 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -721,11 +772,11 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -734,17 +785,17 @@ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -769,130 +820,123 @@ echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=$(uname -p) + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + fi exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + UNAME_PROCESSOR=$(/usr/bin/uname -p) + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix${UNAME_RELEASE} + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -902,129 +946,182 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI="$LIBC"x32 + fi + fi + echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1038,51 +1135,51 @@ # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in + case $(/bin/uname -X | grep "^Machine") in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1090,9 +1187,9 @@ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1100,7 +1197,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1112,9 +1209,9 @@ exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1132,41 +1229,41 @@ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1176,8 +1273,8 @@ exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + UNAME_MACHINE=$( (uname -p) 2>/dev/null) + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1197,23 +1294,23 @@ exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1232,77 +1329,97 @@ echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + UNAME_PROCESSOR=$(uname -p) + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=$(uname -p) + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1311,18 +1428,19 @@ echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + # shellcheck disable=SC2154 + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1343,14 +1461,14 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + UNAME_MACHINE=$( (uname -p) 2>/dev/null) + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1359,62 +1477,223 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + *:AROS:*:*) + echo "$UNAME_MACHINE"-unknown-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" exit ;; esac +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +year=$(echo $timestamp | sed 's,-.*,,') +# shellcheck disable=SC2003 +if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then + cat >&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +uname -m = $( (uname -m) 2>/dev/null || echo unknown) +uname -r = $( (uname -r) 2>/dev/null || echo unknown) +uname -s = $( (uname -s) 2>/dev/null || echo unknown) +uname -v = $( (uname -v) 2>/dev/null || echo unknown) + +/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) +/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) + +hostinfo = $( (hostinfo) 2>/dev/null) +/bin/universe = $( (/bin/universe) 2>/dev/null) +/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) +/bin/arch = $( (/bin/arch) 2>/dev/null) +/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) +/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff -Nru pcc-1.2.0~DEVEL+20200630/config.h.in pcc-1.2.0~DEVEL+20220331/config.h.in --- pcc-1.2.0~DEVEL+20200630/config.h.in 2020-04-11 16:21:12.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/config.h.in 2021-10-15 15:33:08.000000000 +0000 @@ -18,6 +18,9 @@ /* Define path to alternate compiler */ #undef COMPILER +/* Define path to alternate cc2 */ +#undef CC2 + /* Using ECOFF ABI */ #undef ECOFFABI diff -Nru pcc-1.2.0~DEVEL+20200630/configure pcc-1.2.0~DEVEL+20220331/configure --- pcc-1.2.0~DEVEL+20200630/configure 2020-06-13 14:55:53.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/configure 2021-10-15 15:33:09.000000000 +0000 @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Portable C Compiler 1.2.0.DEVEL. +# Generated by GNU Autoconf 2.71 for Portable C Compiler 1.2.0.DEVEL. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,42 +169,53 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -230,14 +223,21 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -255,18 +255,19 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: pcc@lists.ludd.ltu.se about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a @@ -294,6 +295,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -311,6 +313,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -325,7 +335,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -334,7 +344,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -373,12 +383,13 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -390,18 +401,27 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -413,9 +433,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -442,7 +462,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -486,7 +506,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -500,6 +520,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -513,6 +537,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -587,40 +618,36 @@ # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS CF1 @@ -643,9 +670,6 @@ INSTALL_SCRIPT INSTALL_PROGRAM SET_MAKE -EGREP -GREP -CPP CC_FOR_BUILD OBJEXT EXEEXT @@ -686,6 +710,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -731,7 +756,6 @@ LDFLAGS LIBS CPPFLAGS -CPP YACC YFLAGS' @@ -772,6 +796,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -801,8 +826,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -843,9 +866,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -869,9 +892,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1024,6 +1047,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1073,9 +1105,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1089,9 +1121,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1135,9 +1167,9 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1153,7 +1185,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1161,7 +1193,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1217,7 +1249,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1314,6 +1346,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1377,7 +1410,6 @@ LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. @@ -1405,9 +1437,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1435,7 +1467,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1443,7 +1476,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1453,9 +1486,9 @@ if $ac_init_version; then cat <<\_ACEOF Portable C Compiler configure 1.2.0.DEVEL -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1472,14 +1505,14 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1487,14 +1520,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1506,8 +1540,8 @@ # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1517,25 +1551,26 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status @@ -1546,43 +1581,6 @@ } # ac_fn_c_try_run -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1590,26 +1588,28 @@ ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1628,7 +1628,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -1638,14 +1638,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -1655,9 +1656,10 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid; break -else +else $as_nop as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -1665,14 +1667,14 @@ fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -1682,14 +1684,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -1699,9 +1702,10 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=$ac_mid; break -else +else $as_nop as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -1709,14 +1713,14 @@ fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -1724,7 +1728,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -1734,12 +1738,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid -else +else $as_nop as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -1749,12 +1754,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include #include int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -1782,9 +1787,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : echo >>conftest.val; read $3 &5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1818,17 +1824,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1843,108 +1850,18 @@ } # ac_fn_c_try_link -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------ ## -## Report this to pcc@lists.ludd.ltu.se ## -## ------------------------------------ ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1952,16 +1869,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1979,24 +1889,25 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2008,17 +1919,18 @@ ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2026,12 +1938,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2039,29 +1952,50 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Portable C Compiler $as_me 1.2.0.DEVEL, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2094,8 +2028,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2130,7 +2068,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2165,11 +2103,13 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2180,8 +2120,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2205,7 +2145,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2213,14 +2153,14 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2228,15 +2168,15 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2244,8 +2184,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2259,63 +2199,48 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2325,139 +2250,530 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; -ac_config_headers="$ac_config_headers config.h" +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi + # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers config.h" + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2476,21 +2792,22 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2509,21 +2826,22 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf "%s\n" "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; @@ -2820,6 +3138,7 @@ *) targos="$target_os" case "$target_cpu" in + arm) targmach=arm targos=none abi=$target_os ;; m16c) targmach=m16c ;; nova) targmach=nova ;; i86) targmach=i86 ;; @@ -2900,102 +3219,110 @@ if test "X$endian" = "Xbig" ; then -$as_echo "#define TARGET_BIG_ENDIAN 1" >>confdefs.h +printf "%s\n" "#define TARGET_BIG_ENDIAN 1" >>confdefs.h else -$as_echo "#define TARGET_LITTLE_ENDIAN 1" >>confdefs.h +printf "%s\n" "#define TARGET_LITTLE_ENDIAN 1" >>confdefs.h fi case "$abi" in elf*) -$as_echo "#define ELFABI 1" >>confdefs.h +printf "%s\n" "#define ELFABI 1" >>confdefs.h ;; aout) -$as_echo "#define AOUTABI 1" >>confdefs.h +printf "%s\n" "#define AOUTABI 1" >>confdefs.h ;; macho) -$as_echo "#define MACHOABI 1" >>confdefs.h +printf "%s\n" "#define MACHOABI 1" >>confdefs.h ;; coff) -$as_echo "#define COFFABI 1" >>confdefs.h +printf "%s\n" "#define COFFABI 1" >>confdefs.h ;; ecoff) -$as_echo "#define ECOFFABI 1" >>confdefs.h +printf "%s\n" "#define ECOFFABI 1" >>confdefs.h ;; pecoff) -$as_echo "#define PECOFFABI 1" >>confdefs.h +printf "%s\n" "#define PECOFFABI 1" >>confdefs.h ;; classic68k) -$as_echo "#define CLASSIC68K 1" >>confdefs.h +printf "%s\n" "#define CLASSIC68K 1" >>confdefs.h ;; esac if test "$stabs" = "yes"; then -$as_echo "#define STABS 1" >>confdefs.h +printf "%s\n" "#define STABS 1" >>confdefs.h fi if test "$dwarf" = "yes"; then -$as_echo "#define DWARF 1" >>confdefs.h +printf "%s\n" "#define DWARF 1" >>confdefs.h fi # Specify alternate assembler, linker, include and lib paths # Check whether --enable-multiarch was given. -if test "${enable_multiarch+set}" = set; then : +if test ${enable_multiarch+y} +then : enableval=$enable_multiarch; multiarch=$enableval -else +else $as_nop multiarch=auto fi # Check whether --with-incdir was given. -if test "${with_incdir+set}" = set; then : +if test ${with_incdir+y} +then : withval=$with_incdir; altincdir=$withval fi # Check whether --with-libdir was given. -if test "${with_libdir+set}" = set; then : +if test ${with_libdir+y} +then : withval=$with_libdir; altlibdir=$withval fi # Check whether --with-assembler was given. -if test "${with_assembler+set}" = set; then : +if test ${with_assembler+y} +then : withval=$with_assembler; assembler=$withval fi # Check whether --with-linker was given. -if test "${with_linker+set}" = set; then : +if test ${with_linker+y} +then : withval=$with_linker; linker=$withval fi # Check whether --with-libvmf was given. -if test "${with_libvmf+set}" = set; then : +if test ${with_libvmf+y} +then : withval=$with_libvmf; libvmf=$withval -else +else $as_nop libvmf=no fi # Check whether --enable-tls was given. -if test "${enable_tls+set}" = set; then : +if test ${enable_tls+y} +then : enableval=$enable_tls; tls=$enableval fi if test "$tls" = "yes"; then -$as_echo "#define TLS 1" >>confdefs.h +printf "%s\n" "#define TLS 1" >>confdefs.h fi # Check whether --enable-Werror was given. -if test "${enable_Werror+set}" = set; then : +if test ${enable_Werror+y} +then : enableval=$enable_Werror; werror=$enableval fi @@ -3003,7 +3330,8 @@ ADD_CFLAGS="$ADD_CFLAGS -Werror" fi # Check whether --enable-gcc-compat was given. -if test "${enable_gcc_compat+set}" = set; then : +if test ${enable_gcc_compat+y} +then : enableval=$enable_gcc_compat; gcccompat=$enableval fi @@ -3011,7 +3339,8 @@ ADD_CPPFLAGS="$ADD_CPPFLAGS -DGCC_COMPAT"; fi # Check whether --enable-pcc-debug was given. -if test "${enable_pcc_debug+set}" = set; then : +if test ${enable_pcc_debug+y} +then : enableval=$enable_pcc_debug; pccdebug=$enableval fi @@ -3019,7 +3348,8 @@ ADD_CPPFLAGS="$ADD_CPPFLAGS -DPCC_DEBUG"; fi # Check whether --enable-twopass was given. -if test "${enable_twopass+set}" = set; then : +if test ${enable_twopass+y} +then : enableval=$enable_twopass; twopass=$enableval fi @@ -3033,7 +3363,8 @@ fi # Check whether --enable-stripping was given. -if test "${enable_stripping+set}" = set; then : +if test ${enable_stripping+y} +then : enableval=$enable_stripping; stripping=$enableval fi @@ -3041,14 +3372,15 @@ if test -z "$INSTALL_PROGRAM"; then INSTALL_PROGRAM='${INSTALL} -s' else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Installed binaries may be unstripped" >&5 -$as_echo "$as_me: WARNING: Installed binaries may be unstripped" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Installed binaries may be unstripped" >&5 +printf "%s\n" "$as_me: WARNING: Installed binaries may be unstripped" >&2;} fi fi # Check whether --with-yasm was given. -if test "${with_yasm+set}" = set; then : +if test ${with_yasm+y} +then : withval=$with_yasm; useyasm=$withval fi @@ -3057,7 +3389,8 @@ ADD_CPPFLAGS="$ADD_CPPFLAGS -DUSE_YASM" fi # Check whether --enable-native was given. -if test "${enable_native+set}" = set; then : +if test ${enable_native+y} +then : enableval=$enable_native; native=$enableval fi @@ -3082,8 +3415,8 @@ x*-*-*) ;; x) ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring unrecognised Multi-Arch path '$multiarch_path'!" >&5 -$as_echo "$as_me: WARNING: Ignoring unrecognised Multi-Arch path '$multiarch_path'!" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring unrecognised Multi-Arch path '$multiarch_path'!" >&5 +printf "%s\n" "$as_me: WARNING: Ignoring unrecognised Multi-Arch path '$multiarch_path'!" >&2;} multiarch_path= ;; esac @@ -3097,9 +3430,7 @@ esac if test -n "$multiarch_path"; then -cat >>confdefs.h <<_ACEOF -#define MULTIARCH_PATH "$multiarch_path" -_ACEOF +printf "%s\n" "#define MULTIARCH_PATH \"$multiarch_path\"" >>confdefs.h multiarch="\"$multiarch_path\"" else @@ -3126,52 +3457,46 @@ fi preprocessor="${BINPREFIX}cpp" compiler="${BINPREFIX}ccom" + cc2="${BINPREFIX}cc2" -$as_echo "#define CROSS_COMPILING 1" >>confdefs.h +printf "%s\n" "#define CROSS_COMPILING 1" >>confdefs.h fi if test -n "$altincdir"; then -cat >>confdefs.h <<_ACEOF -#define STDINC "$altincdir" -_ACEOF +printf "%s\n" "#define STDINC \"$altincdir\"" >>confdefs.h fi if test -n "$altlibdir"; then -cat >>confdefs.h <<_ACEOF -#define LIBDIR "${altlibdir}/" -_ACEOF +printf "%s\n" "#define LIBDIR \"${altlibdir}/\"" >>confdefs.h fi if test -n "$assembler"; then -cat >>confdefs.h <<_ACEOF -#define ASSEMBLER "$assembler" -_ACEOF +printf "%s\n" "#define ASSEMBLER \"$assembler\"" >>confdefs.h fi if test -n "$linker"; then -cat >>confdefs.h <<_ACEOF -#define LINKER "$linker" -_ACEOF +printf "%s\n" "#define LINKER \"$linker\"" >>confdefs.h fi if test -n "$preprocessor"; then -cat >>confdefs.h <<_ACEOF -#define PREPROCESSOR "$preprocessor" -_ACEOF +printf "%s\n" "#define PREPROCESSOR \"$preprocessor\"" >>confdefs.h fi if test -n "$compiler"; then -cat >>confdefs.h <<_ACEOF -#define COMPILER "$compiler" -_ACEOF +printf "%s\n" "#define COMPILER \"$compiler\"" >>confdefs.h + +fi +if test -n "$cc2"; then + +printf "%s\n" "#define CC2 \"$cc2\"" >>confdefs.h fi @@ -3182,17 +3507,22 @@ esac -cat >>confdefs.h <<_ACEOF -#define WCHAR_TYPE $wchar_type -_ACEOF +printf "%s\n" "#define WCHAR_TYPE $wchar_type" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define WCHAR_SIZE $wchar_size -_ACEOF +printf "%s\n" "#define WCHAR_SIZE $wchar_size" >>confdefs.h # check for additional compiler flags + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3201,11 +3531,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3213,11 +3544,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3228,11 +3563,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3241,11 +3576,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3253,11 +3589,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3268,11 +3608,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3280,8 +3620,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3294,11 +3634,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3306,11 +3647,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3321,11 +3666,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3334,11 +3679,12 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3347,15 +3693,19 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3371,18 +3721,18 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3393,11 +3743,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3405,11 +3756,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3420,11 +3775,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3437,11 +3792,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3449,11 +3805,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3464,11 +3824,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3480,34 +3840,138 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3517,7 +3981,7 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3525,7 +3989,7 @@ /* end confdefs.h. */ int -main () +main (void) { ; @@ -3537,9 +4001,9 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3560,11 +4024,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3581,7 +4046,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3597,44 +4062,46 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3648,15 +4115,15 @@ * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3665,7 +4132,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3677,8 +4144,8 @@ ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3686,10 +4153,10 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3697,39 +4164,40 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3743,11 +4211,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3756,31 +4225,32 @@ break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3790,29 +4260,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3821,57 +4295,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3886,94 +4363,144 @@ CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -3985,8 +4512,8 @@ DESIRED_FLAGS="-Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wsign-compare -Wtruncate" for flag in $DESIRED_FLAGS do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts $flag" >&5 -$as_echo_n "checking whether $CC accepts $flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts $flag" >&5 +printf %s "checking whether $CC accepts $flag... " >&6; } cflags="$CFLAGS" CFLAGS="$CFLAGS $flag -Werror" @@ -3995,7 +4522,7 @@ int -main () +main (void) { ; @@ -4003,40 +4530,42 @@ } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : use_flag=yes -else +else $as_nop use_flag=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$cflags" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_flag" >&5 -$as_echo "$use_flag" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_flag" >&5 +printf "%s\n" "$use_flag" >&6; } if test $use_flag = yes; then ADD_CFLAGS="$ADD_CFLAGS $flag" fi done # setup for cross-compiling mkext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a C compiler for mkext" >&5 -$as_echo_n "checking for a C compiler for mkext... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a C compiler for mkext" >&5 +printf %s "checking for a C compiler for mkext... " >&6; } if test $cross_compiling = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross compiling" >&5 -$as_echo "cross compiling" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross compiling" >&5 +printf "%s\n" "cross compiling" >&6; } for ac_prog in pcc gcc cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC_FOR_BUILD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC_FOR_BUILD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC_FOR_BUILD"; then ac_cv_prog_CC_FOR_BUILD="$CC_FOR_BUILD" # Let the user override the test. else @@ -4044,451 +4573,89 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC_FOR_BUILD="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi -done - done -IFS=$as_save_IFS - -fi -fi -CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD -if test -n "$CC_FOR_BUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 -$as_echo "$CC_FOR_BUILD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC_FOR_BUILD" && break -done - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not cross compiling" >&5 -$as_echo "not cross compiling" >&6; } - CC_FOR_BUILD=${CC-cc} - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - +CC_FOR_BUILD=$ac_cv_prog_CC_FOR_BUILD +if test -n "$CC_FOR_BUILD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5 +printf "%s\n" "$CC_FOR_BUILD" >&6; } else - ac_cv_header_stdc=no -fi -rm -f conftest* - + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + test -n "$CC_FOR_BUILD" && break +done else - ac_cv_header_stdc=no -fi -rm -f conftest* + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not cross compiling" >&5 +printf "%s\n" "not cross compiling" >&6; } + CC_FOR_BUILD=${CC-cc} fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C99 printf size specifiers" >&5 -$as_echo_n "checking for C99 printf size specifiers... " >&6; } -if ${ac_cv_have_c99_format+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C99 printf size specifiers" >&5 +printf %s "checking for C99 printf size specifiers... " >&6; } +if test ${ac_cv_have_c99_format+y} +then : + printf %s "(cached) " >&6 +else $as_nop - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : ac_cv_have_c99_format=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { char buf[64]; @@ -4501,9 +4668,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_have_c99_format=yes -else +else $as_nop ac_cv_have_c99_format=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -4512,11 +4680,11 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_c99_format" >&5 -$as_echo "$ac_cv_have_c99_format" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_c99_format" >&5 +printf "%s\n" "$ac_cv_have_c99_format" >&6; } if test $ac_cv_have_c99_format = yes; then -$as_echo "#define HAVE_C99_FORMAT 1" >>confdefs.h +printf "%s\n" "#define HAVE_C99_FORMAT 1" >>confdefs.h fi @@ -4524,17 +4692,19 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 -$as_echo_n "checking size of int *... " >&6; } -if ${ac_cv_sizeof_int_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 +printf %s "checking size of int *... " >&6; } +if test ${ac_cv_sizeof_int_p+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_int_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int *) See \`config.log' for more details" "$LINENO" 5; } else @@ -4543,23 +4713,22 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int_p" >&5 -$as_echo "$ac_cv_sizeof_int_p" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int_p" >&5 +printf "%s\n" "$ac_cv_sizeof_int_p" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT_P $ac_cv_sizeof_int_p -_ACEOF +printf "%s\n" "#define SIZEOF_INT_P $ac_cv_sizeof_int_p" >>confdefs.h # Byteorder of host - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4570,7 +4739,8 @@ typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -4594,7 +4764,7 @@ fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4603,7 +4773,7 @@ #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -4615,7 +4785,8 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4623,7 +4794,7 @@ #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -4633,14 +4804,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -4649,7 +4821,7 @@ #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -4659,14 +4831,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -4676,31 +4849,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -4708,14 +4883,15 @@ extern int foo; int -main () +main (void) { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -4728,13 +4904,13 @@ fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -4750,9 +4926,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_bigendian=no -else +else $as_nop ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -4761,20 +4938,20 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) -$as_echo "#define HOST_BIG_ENDIAN 1" >>confdefs.h +printf "%s\n" "#define HOST_BIG_ENDIAN 1" >>confdefs.h ;; #( no) -$as_echo "#define HOST_LITTLE_ENDIAN 1" >>confdefs.h +printf "%s\n" "#define HOST_LITTLE_ENDIAN 1" >>confdefs.h ;; #( universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -4784,13 +4961,14 @@ # Checks for programs. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -4806,16 +4984,17 @@ rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -4829,20 +5008,25 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -4852,13 +5036,13 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -4866,12 +5050,12 @@ echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -4887,7 +5071,7 @@ rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -4897,8 +5081,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -4912,11 +5096,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_YACC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_YACC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else @@ -4924,11 +5109,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4939,11 +5128,11 @@ fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -$as_echo "$YACC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +printf "%s\n" "$YACC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4955,11 +5144,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LEX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else @@ -4967,11 +5157,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4982,11 +5176,11 @@ fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 -$as_echo "$LEX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +printf "%s\n" "$LEX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4994,15 +5188,26 @@ done test -n "$LEX" || LEX=":" -if test "x$LEX" != "x:"; then - cat >conftest.l <<_ACEOF + if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%{ +#ifdef __cplusplus +extern "C" +#endif +int yywrap(void); +%} %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ - yyless ((input () != 0)); } +#ifdef __cplusplus + yyless ((yyinput () != 0)); +#else + yyless ((input () != 0)); +#endif + } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% @@ -5010,101 +5215,205 @@ extern char *yytext; #endif int +yywrap (void) +{ + return 1; +} +int main (void) { - return ! yylex () + ! yywrap (); + return ! yylex (); } _ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 +printf %s "checking for lex output file root... " >&6; } +if test ${ac_cv_prog_lex_root+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +ac_cv_prog_lex_root=unknown { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 -$as_echo_n "checking lex output file root... " >&6; } -if ${ac_cv_prog_lex_root+:} false; then : - $as_echo_n "(cached) " >&6 -else - + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy -else - as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 -$as_echo "$ac_cv_prog_lex_root" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +printf "%s\n" "$ac_cv_prog_lex_root" >&6; } +if test "$ac_cv_prog_lex_root" = unknown +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} + LEX=: LEXLIB= +fi LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -if test -z "${LEXLIB+set}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 -$as_echo_n "checking lex library... " >&6; } -if ${ac_cv_lib_lex+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${LEXLIB+y} +then : + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 +printf %s "checking for lex library... " >&6; } +if test ${ac_cv_lib_lex+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + ac_found=false + for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do + case $ac_cv_lib_lex in #( + 'none needed') : + ;; #( + 'not found') : + break ;; #( + *) : + LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( + *) : + ;; +esac - ac_save_LIBS=$LIBS - ac_cv_lib_lex='none needed' - for ac_lib in '' -lfl -ll; do - LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lex=$ac_lib +if ac_fn_c_try_link "$LINENO" +then : + ac_found=: fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - test "$ac_cv_lib_lex" != 'none needed' && break + if $ac_found; then + break + fi done - LIBS=$ac_save_LIBS + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +printf "%s\n" "$ac_cv_lib_lex" >&6; } + if test "$ac_cv_lib_lex" = 'not found' +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} + LEX=: LEXLIB= +elif test "$ac_cv_lib_lex" = 'none needed' +then : + LEXLIB='' +else $as_nop + LEXLIB=$ac_cv_lib_lex +fi + ac_save_LIBS="$LIBS" + LIBS= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing yywrap" >&5 +printf %s "checking for library containing yywrap... " >&6; } +if test ${ac_cv_search_yywrap+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main (void) +{ +return yywrap (); + ; + return 0; +} +_ACEOF +for ac_lib in '' fl l +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_yywrap=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_yywrap+y} +then : + break +fi +done +if test ${ac_cv_search_yywrap+y} +then : +else $as_nop + ac_cv_search_yywrap=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 -$as_echo "$ac_cv_lib_lex" >&6; } - test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yywrap" >&5 +printf "%s\n" "$ac_cv_search_yywrap" >&6; } +ac_res=$ac_cv_search_yywrap +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + LEXLIB="$LIBS" +fi + + LIBS="$ac_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 -$as_echo_n "checking whether yytext is a pointer... " >&6; } -if ${ac_cv_prog_lex_yytext_pointer+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "$LEX" != : +then : + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +printf %s "checking whether yytext is a pointer... " >&6; } +if test ${ac_cv_prog_lex_yytext_pointer+y} +then : + printf %s "(cached) " >&6 +else $as_nop # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no -ac_save_LIBS=$LIBS -LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_lex_yytext_pointer=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 -$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then -$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h +printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h + +fi fi rm -f conftest.l $LEX_OUTPUT_ROOT.c @@ -5115,7 +5424,7 @@ if test $libvmf != no ; then LIBS=-lvmf -$as_echo "#define LIBVMF 1" >>confdefs.h +printf "%s\n" "#define LIBVMF 1" >>confdefs.h if test $libvmf != yes ; then LDFLAGS=-L$libvmf @@ -5124,23 +5433,19 @@ # Checks for header files. # AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) -for ac_header in string.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" -if test "x$ac_cv_header_string_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRING_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 -$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if ${ac_cv_header_sys_wait_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -5153,7 +5458,7 @@ #endif int -main () +main (void) { int s; wait (&s); @@ -5162,18 +5467,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_sys_wait_h=yes -else +else $as_nop ac_cv_header_sys_wait_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then -$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi @@ -5182,41 +5488,84 @@ ## AC_FUNC_STRTOD # AC_FUNC_VPRINTF # AC_CHECK_FUNCS([memset strchr strdup strrchr strtol]) -for ac_func in strtold vsnprintf snprintf mkstemp strlcat strlcpy getopt ffs vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "strtold" "ac_cv_func_strtold" +if test "x$ac_cv_func_strtold" = xyes +then : + printf "%s\n" "#define HAVE_STRTOLD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes +then : + printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" +if test "x$ac_cv_func_mkstemp" = xyes +then : + printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" +if test "x$ac_cv_func_strlcat" = xyes +then : + printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" +if test "x$ac_cv_func_strlcpy" = xyes +then : + printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt" +if test "x$ac_cv_func_getopt" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ffs" "ac_cv_func_ffs" +if test "x$ac_cv_func_ffs" = xyes +then : + printf "%s\n" "#define HAVE_FFS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" +if test "x$ac_cv_func_vfork" = xyes +then : + printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h fi -done ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; @@ -5224,52 +5573,52 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_working_alloca_h=yes -else +else $as_nop ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER # include # define alloca _alloca # else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif +# ifdef __cplusplus +extern "C" # endif +void *alloca (size_t); # endif #endif int -main () +main (void) { char *p = (char *) alloca (1); if (p) return 0; @@ -5277,20 +5626,22 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_alloca_works=yes -else +else $as_nop ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -5300,58 +5651,19 @@ ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -$as_echo "#define C_ALLOCA 1" >>confdefs.h - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_c_stack_direction=0 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -5372,9 +5684,10 @@ return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_stack_direction=1 -else +else $as_nop ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -5382,11 +5695,9 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h fi @@ -5420,29 +5731,19 @@ targstr="\"$target$MPVERSION\"" -cat >>confdefs.h <<_ACEOF -#define PCC_MAJOR $pcc_major -_ACEOF +printf "%s\n" "#define PCC_MAJOR $pcc_major" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PCC_MINOR $pcc_minor -_ACEOF +printf "%s\n" "#define PCC_MINOR $pcc_minor" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PCC_MINORMINOR $pcc_minorminor -_ACEOF +printf "%s\n" "#define PCC_MINORMINOR $pcc_minorminor" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSSTR $versstr -_ACEOF +printf "%s\n" "#define VERSSTR $versstr" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define TARGSTR $targstr -_ACEOF +printf "%s\n" "#define TARGSTR $targstr" >>confdefs.h ac_config_files="$ac_config_files Makefile cc/Makefile cc/cc/Makefile cc/cpp/Makefile cc/ccom/Makefile cc/cxxcom/Makefile cc/driver/Makefile f77/Makefile f77/f77/Makefile f77/fcom/Makefile" @@ -5474,8 +5775,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -5505,15 +5806,15 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -5527,8 +5828,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -5545,7 +5846,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -5562,8 +5863,8 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -5586,14 +5887,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -5603,46 +5906,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -5651,13 +5954,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -5666,8 +5962,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -5679,30 +5979,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -5715,13 +5995,14 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -5748,18 +6029,20 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -5771,12 +6054,13 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -5807,7 +6091,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -5829,6 +6113,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -5842,6 +6130,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -5883,7 +6177,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -5892,7 +6186,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -5955,7 +6249,7 @@ # values after options handling. ac_log=" This file was extended by Portable C Compiler $as_me 1.2.0.DEVEL, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6014,14 +6308,16 @@ Portable C Compiler home page: ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ Portable C Compiler config.status 1.2.0.DEVEL -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -6059,15 +6355,15 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -6075,7 +6371,7 @@ --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -6084,7 +6380,7 @@ as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -6112,7 +6408,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -6126,7 +6422,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -6161,8 +6457,8 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -6498,7 +6794,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -6506,17 +6802,17 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -6533,7 +6829,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -6557,9 +6853,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -6616,8 +6912,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -6660,9 +6956,9 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -6678,20 +6974,20 @@ # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -6732,8 +7028,8 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -6761,3 +7057,4 @@ echo echo "Configure finished. Do 'make && make install' to compile and install. " + diff -Nru pcc-1.2.0~DEVEL+20200630/configure.ac pcc-1.2.0~DEVEL+20220331/configure.ac --- pcc-1.2.0~DEVEL+20200630/configure.ac 2020-06-13 14:55:53.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/configure.ac 2021-10-15 15:33:09.000000000 +0000 @@ -278,6 +278,7 @@ *) targos="$target_os" case "$target_cpu" in + arm) targmach=arm targos=none abi=$target_os ;; m16c) targmach=m16c ;; nova) targmach=nova ;; i86) targmach=i86 ;; @@ -538,6 +539,7 @@ fi preprocessor="${BINPREFIX}cpp" compiler="${BINPREFIX}ccom" + cc2="${BINPREFIX}cc2" AC_DEFINE(CROSS_COMPILING, 1, [Cross-compiling.]) fi AC_SUBST(BINPREFIX) @@ -566,6 +568,10 @@ AC_DEFINE_UNQUOTED(COMPILER, "$compiler", [Define path to alternate compiler]) fi +if test -n "$cc2"; then + AC_DEFINE_UNQUOTED(CC2, "$cc2", + [Define path to alternate cc2]) +fi case $wchar_type in USHORT) wchar_size=2 ;; diff -Nru pcc-1.2.0~DEVEL+20200630/CVS/Entries pcc-1.2.0~DEVEL+20220331/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/CVS/Entries 2020-06-30 01:00:01.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/CVS/Entries 2022-03-31 01:00:02.000000000 +0000 @@ -1,17 +1,18 @@ /Makefile.in/1.9/Tue Jun 7 13:56:05 2011// -/config.guess/1.5/Sun Mar 13 11:07:00 2016// -/config.h.in/1.37/Sat Apr 11 16:21:12 2020// +/config.guess/1.6/Sun Aug 8 23:50:11 2021// +/config.h.in/1.38/Fri Oct 15 15:33:08 2021// /config.sub/1.13/Tue Jan 17 20:53:52 2017// -/configure/1.140/Sat Jun 13 14:55:53 2020// -/configure.ac/1.160/Sat Jun 13 14:55:53 2020// +/configure/1.142/Fri Oct 15 15:33:09 2021// +/configure.ac/1.162/Fri Oct 15 15:33:09 2021// /install-sh/1.1/Sat Oct 16 07:57:40 2004// D/arch//// D/cc//// +D/cc2//// D/common//// D/doc//// D/f77//// D/lib//// D/mip//// D/os//// -/DATESTAMP/1.698/Tue Jun 30 01:00:01 2020// +/DATESTAMP/1.719/Thu Mar 31 01:00:02 2022// D diff -Nru pcc-1.2.0~DEVEL+20200630/DATESTAMP pcc-1.2.0~DEVEL+20220331/DATESTAMP --- pcc-1.2.0~DEVEL+20200630/DATESTAMP 2020-06-30 01:00:01.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/DATESTAMP 2022-03-31 01:00:02.000000000 +0000 @@ -1 +1 @@ -20200630 +20220331 diff -Nru pcc-1.2.0~DEVEL+20200630/debian/alternatives pcc-1.2.0~DEVEL+20220331/debian/alternatives --- pcc-1.2.0~DEVEL+20200630/debian/alternatives 1970-01-01 00:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/alternatives 2022-09-03 15:52:56.000000000 +0000 @@ -0,0 +1,14 @@ +Name: cc +Link: /usr/bin/cc +Alternative: /usr/bin/pcc +Priority: -100 + +Name: c99 +Link: /usr/bin/c99 +Alternative: /usr/bin/pcc +Priority: -100 + +Name: c++ +Link: /usr/bin/c++ +Alternative: /usr/bin/p++ +Priority: -100 diff -Nru pcc-1.2.0~DEVEL+20200630/debian/changelog pcc-1.2.0~DEVEL+20220331/debian/changelog --- pcc-1.2.0~DEVEL+20200630/debian/changelog 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/changelog 2022-09-03 15:52:56.000000000 +0000 @@ -1,3 +1,11 @@ +pcc (1.2.0~DEVEL+20220331-1) unstable; urgency=medium + + * New upstream release + * Provide cc alternative (Closes: #1014707) + * Bump Standards-Version to 4.6.1 + + -- Yangfl Sat, 03 Sep 2022 23:52:56 +0800 + pcc (1.2.0~DEVEL+20200630-2) unstable; urgency=medium * Fix multiarch path diff -Nru pcc-1.2.0~DEVEL+20200630/debian/control pcc-1.2.0~DEVEL+20220331/debian/control --- pcc-1.2.0~DEVEL+20200630/debian/control 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/control 2022-09-03 15:52:56.000000000 +0000 @@ -7,7 +7,7 @@ bison, flex, Rules-Requires-Root: no -Standards-Version: 4.5.0 +Standards-Version: 4.6.1 Homepage: http://pcc.ludd.ltu.se/ Vcs-Git: https://salsa.debian.org/yangfl-guest/pcc.git Vcs-Browser: https://salsa.debian.org/yangfl-guest/pcc diff -Nru pcc-1.2.0~DEVEL+20200630/debian/copyright pcc-1.2.0~DEVEL+20220331/debian/copyright --- pcc-1.2.0~DEVEL+20200630/debian/copyright 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/copyright 2022-09-03 15:52:56.000000000 +0000 @@ -3,7 +3,7 @@ Source: http://pcc.ludd.ltu.se/ Files: * -Copyright: 2002-2020 Anders Magnusson +Copyright: 2002-2022 Anders Magnusson License: BSD-2-Clause Files: config.guess @@ -149,7 +149,7 @@ License: BSD-3-Clause Files: debian/* -Copyright: 2018-2019 Yangfl +Copyright: 2018-2022 Yangfl License: BSD-2-Clause License: BSD-2-Clause diff -Nru pcc-1.2.0~DEVEL+20200630/debian/lintian-overrides pcc-1.2.0~DEVEL+20220331/debian/lintian-overrides --- pcc-1.2.0~DEVEL+20200630/debian/lintian-overrides 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/lintian-overrides 2022-09-03 15:52:56.000000000 +0000 @@ -1,2 +1,2 @@ # multiarch -pcc: no-manual-page usr/bin/* +pcc: no-manual-page * diff -Nru pcc-1.2.0~DEVEL+20200630/debian/patches/0001-Avoid-gcc-cpp-name-conflict.patch pcc-1.2.0~DEVEL+20220331/debian/patches/0001-Avoid-gcc-cpp-name-conflict.patch --- pcc-1.2.0~DEVEL+20200630/debian/patches/0001-Avoid-gcc-cpp-name-conflict.patch 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/patches/0001-Avoid-gcc-cpp-name-conflict.patch 2022-09-03 15:52:56.000000000 +0000 @@ -1,4 +1,4 @@ -From 8ea62b9ae6767451a5ea30768e545edf140df7ba Mon Sep 17 00:00:00 2001 +From 95577e0c64d50a5e5b9dd35215cf0b8a5e8ce7a5 Mon Sep 17 00:00:00 2001 From: yangfl Date: Fri, 9 Nov 2018 13:24:53 +0800 Subject: [PATCH 1/5] Avoid gcc cpp name conflict @@ -8,18 +8,18 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index b86259b0..51d42726 100644 +index 8c303965..f2a585be 100644 --- a/configure.ac +++ b/configure.ac -@@ -536,7 +536,7 @@ else +@@ -537,7 +537,7 @@ else if test -z "$linker"; then linker=${BINPREFIX}ld fi - preprocessor="${BINPREFIX}cpp" + preprocessor="${BINPREFIX}pcc-cpp" compiler="${BINPREFIX}ccom" + cc2="${BINPREFIX}cc2" AC_DEFINE(CROSS_COMPILING, 1, [Cross-compiling.]) - fi -- -2.27.0 +2.35.1 diff -Nru pcc-1.2.0~DEVEL+20200630/debian/patches/0002-Fix-progname-detection.patch pcc-1.2.0~DEVEL+20220331/debian/patches/0002-Fix-progname-detection.patch --- pcc-1.2.0~DEVEL+20200630/debian/patches/0002-Fix-progname-detection.patch 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/patches/0002-Fix-progname-detection.patch 2022-09-03 15:52:56.000000000 +0000 @@ -1,28 +1,29 @@ -From 7b4d29a15ca974765a395f6cec86d0b01a4abc27 Mon Sep 17 00:00:00 2001 +From 280a143a422581bf150579473dd0fbe88e841155 Mon Sep 17 00:00:00 2001 From: yangfl Date: Fri, 9 Nov 2018 13:25:53 +0800 Subject: [PATCH 2/5] Fix progname detection --- - cc/cc/Makefile.in | 2 -- + cc/cc/Makefile.in | 3 --- cc/cc/cc.c | 15 +++++++-------- - 2 files changed, 7 insertions(+), 10 deletions(-) + 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cc/cc/Makefile.in b/cc/cc/Makefile.in -index 5b35ee6c..0664aeda 100644 +index 602a3cbc..c11c6883 100644 --- a/cc/cc/Makefile.in +++ b/cc/cc/Makefile.in -@@ -30,8 +30,6 @@ CPPFLAGS = @CPPFLAGS@ -DLIBEXECDIR=\"$(libexecdir)/\" \ +@@ -30,9 +30,6 @@ CPPFLAGS = @CPPFLAGS@ -DLIBEXECDIR=\"$(libexecdir)/\" \ @ADD_CPPFLAGS@ -DINCLUDEDIR=\"$(includedir)/\" \ -DPCCINCDIR=\"$(PCCINCDIR)/\" -DPCCLIBDIR=\"$(PCCLIBDIR)/\" \ -Dos_$(TARGOS) -Dmach_$(TARGMACH) -DTARGOSVER=$(TARGOSVER) \ - -DCXXPROGNAME=\"$(BINPREFIX)p++$(EXEEXT)\" \ - -DCPPROGNAME=\"$(BINPREFIX)pcpp$(EXEEXT)\" \ +- -DCC0=\"$(BINPREFIX)cc0$(EXEEXT)\" -DCC1=\"$(BINPREFIX)cc1$(EXEEXT)\" \ -I$(top_srcdir)/cc/driver -I$(top_builddir) \ -I$(top_srcdir)/os/$(TARGOS) -I$(MIPDIR) -I$(MDIR) -I$(COMMONDIR) LIBS = @LIBS@ diff --git a/cc/cc/cc.c b/cc/cc/cc.c -index 6a082b0e..5033d161 100644 +index 130aa6dd..a596e350 100644 --- a/cc/cc/cc.c +++ b/cc/cc/cc.c @@ -128,7 +128,7 @@ @@ -34,7 +35,7 @@ #endif #ifndef CPPROGNAME #define CPPROGNAME "cpp" /* name as CPP front end */ -@@ -329,6 +329,10 @@ int amd64_i386; +@@ -346,6 +346,10 @@ int amd64_i386; #endif #define match(a,b) (strcmp(a,b) == 0) @@ -45,7 +46,7 @@ /* handle gcc warning emulations */ struct Wflags { -@@ -456,14 +460,9 @@ main(int argc, char *argv[]) +@@ -473,14 +477,9 @@ main(int argc, char *argv[]) strlist_init(&temp_outputs); strlist_init(&compiler_flags); @@ -63,5 +64,5 @@ } -- -2.27.0 +2.35.1 diff -Nru pcc-1.2.0~DEVEL+20200630/debian/patches/0003-Workaround-broken-C-support.patch pcc-1.2.0~DEVEL+20220331/debian/patches/0003-Workaround-broken-C-support.patch --- pcc-1.2.0~DEVEL+20200630/debian/patches/0003-Workaround-broken-C-support.patch 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/patches/0003-Workaround-broken-C-support.patch 2022-09-03 15:52:56.000000000 +0000 @@ -1,4 +1,4 @@ -From fbf73e798d2a7d9e6bf57b473c4079e3c1c9b6e6 Mon Sep 17 00:00:00 2001 +From 2c2d96a1e36931bd36d6d8cd8091b19029991c7e Mon Sep 17 00:00:00 2001 From: yangfl Date: Fri, 9 Nov 2018 13:26:09 +0800 Subject: [PATCH 3/5] Workaround broken C++ support @@ -8,10 +8,10 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/cc/cc.c b/cc/cc/cc.c -index 5033d161..0443069b 100644 +index a596e350..8a5eda8e 100644 --- a/cc/cc/cc.c +++ b/cc/cc/cc.c -@@ -224,7 +224,7 @@ char *cppmdadd[] = CPPMDADD; +@@ -241,7 +241,7 @@ char *cppmdadd[] = CPPMDADD; #define DEFPROFLIBS { "-lpcc", "-lc_p", "-lpcc", 0 } #endif #ifndef DEFCXXLIBS /* default c++ libraries */ @@ -19,7 +19,7 @@ +#define DEFCXXLIBS { "-lpcc", "-lc", "-lpcc", 0 } #endif #ifndef STARTLABEL - #define STARTLABEL "__start" + #define STARTLABEL "__start" -- -2.27.0 +2.35.1 diff -Nru pcc-1.2.0~DEVEL+20200630/debian/patches/0004-Add-more-architectures-for-linux.patch pcc-1.2.0~DEVEL+20220331/debian/patches/0004-Add-more-architectures-for-linux.patch --- pcc-1.2.0~DEVEL+20200630/debian/patches/0004-Add-more-architectures-for-linux.patch 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/patches/0004-Add-more-architectures-for-linux.patch 2022-09-03 15:52:56.000000000 +0000 @@ -1,4 +1,4 @@ -From a04ac1b036306bdce7613fca5d0d1466b8254f49 Mon Sep 17 00:00:00 2001 +From 279bbf8250b1cd9cf98f268e2ca6dc2059ae2dd7 Mon Sep 17 00:00:00 2001 From: yangfl Date: Fri, 9 Nov 2018 15:51:30 +0800 Subject: [PATCH 4/5] Add more architectures for linux @@ -9,7 +9,7 @@ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 51d42726..990ad57f 100644 +index f2a585be..8c5ab90e 100644 --- a/configure.ac +++ b/configure.ac @@ -115,11 +115,18 @@ case "$target_os" in @@ -31,7 +31,7 @@ case "$target_os" in *-musl*) ADD_CPPFLAGS="$ADD_CPPFLAGS -DUSE_MUSL" ;; esac -@@ -314,6 +321,9 @@ case "$host_os" in +@@ -315,6 +322,9 @@ case "$host_os" in linux*) ADD_CPPFLAGS="$ADD_CPPFLAGS -D_BSD_SOURCE" hostos=linux @@ -41,7 +41,7 @@ ;; litebsd*) hostos=litebsd -@@ -521,7 +531,6 @@ fi +@@ -522,7 +532,6 @@ fi if test "X$native" = "Xyes" -o "X$target_alias" = "X$host_alias" -o "X$target_alias" = "X"; then BINPREFIX="" else @@ -50,10 +50,10 @@ test "X$exec_prefix" = XNONE && exec_prefix="${prefix}" if test -z "$altincdir"; then diff --git a/os/linux/ccconfig.h b/os/linux/ccconfig.h -index 5999b23d..969db024 100644 +index 206a2af4..6c7b0d60 100644 --- a/os/linux/ccconfig.h +++ b/os/linux/ccconfig.h -@@ -41,9 +41,14 @@ +@@ -44,9 +44,14 @@ #define CPPMDADD { "-D__i386__", NULL, } #define DYNLINKLIB "/lib/ld-linux.so.2" #define MUSL_DYLIB "/lib/ld-musl-i386.so.1" @@ -69,7 +69,7 @@ #define MUSL_DYLIB "/lib/ld-musl-powerpc.so.1" #elif defined(mach_amd64) #include "../inc/amd64.h" -@@ -63,6 +68,26 @@ +@@ -66,6 +71,26 @@ #elif defined(mach_aarch64) #define CPPMDADD { "-D__aarch64__", NULL, } #define MUSL_DYLIB "/lib/ld-musl-aarch64.so.1" @@ -97,5 +97,5 @@ #error defines for arch missing #endif -- -2.27.0 +2.35.1 diff -Nru pcc-1.2.0~DEVEL+20200630/debian/patches/0005-Disable-fp-debug.patch pcc-1.2.0~DEVEL+20220331/debian/patches/0005-Disable-fp-debug.patch --- pcc-1.2.0~DEVEL+20200630/debian/patches/0005-Disable-fp-debug.patch 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/patches/0005-Disable-fp-debug.patch 2022-09-03 15:52:56.000000000 +0000 @@ -1,4 +1,4 @@ -From 677303645df21e8f6c79f0b4ea1d1a2130e89e7b Mon Sep 17 00:00:00 2001 +From 0fca0aa6b7ca70d2f090ea09e9f75199c4c8fcb2 Mon Sep 17 00:00:00 2001 From: yangfl Date: Sat, 25 Jul 2020 02:18:18 +0800 Subject: [PATCH 5/5] Disable fp debug @@ -8,7 +8,7 @@ 1 file changed, 2 insertions(+) diff --git a/common/softfloat.c b/common/softfloat.c -index 826aabd5..cce99809 100644 +index 4c997e05..e7d22a0c 100644 --- a/common/softfloat.c +++ b/common/softfloat.c @@ -39,7 +39,9 @@ @@ -22,5 +22,5 @@ int sfdebug=0; #define SD(x) if (sfdebug) printf x -- -2.27.0 +2.35.1 diff -Nru pcc-1.2.0~DEVEL+20200630/debian/rules pcc-1.2.0~DEVEL+20220331/debian/rules --- pcc-1.2.0~DEVEL+20200630/debian/rules 2020-07-31 06:12:51.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/debian/rules 2022-09-03 15:52:56.000000000 +0000 @@ -23,22 +23,18 @@ target_alias=${DEB_TARGET_MULTIARCH} \ BINPREFIX=${DEB_TARGET_GNU_TYPE}- -override_dh_install: - dh_install +execute_after_dh_install: rm -r debian/pcc/usr/lib + rm debian/pcc/usr/bin/${DEB_TARGET_GNU_TYPE}-cc2 mv debian/pcc/usr/bin/${DEB_TARGET_GNU_TYPE}-cpp debian/pcc/usr/bin/${DEB_TARGET_GNU_TYPE}-pcc-cpp mv debian/pcc/usr/share/man/man1/${DEB_TARGET_GNU_TYPE}-ccom.1 debian/pcc/usr/share/man/man1/ccom.1 mv debian/pcc/usr/share/man/man1/${DEB_TARGET_GNU_TYPE}-cpp.1 debian/pcc/usr/share/man/man1/pcc-cpp.1 - -override_dh_installman: - dh_installman - ln -s ccom.1.gz debian/pcc/usr/share/man/man1/cxxcom.1.gz - -override_dh_link: - dh_link for name in ccom cxxcom pcc-cpp p++ pcc pcpp; do \ ln -s ${DEB_TARGET_GNU_TYPE}-$$name debian/pcc/usr/bin/$$name; \ done for name in p++ pcpp; do \ ln -sf ${DEB_TARGET_GNU_TYPE}-pcc debian/pcc/usr/bin/${DEB_TARGET_GNU_TYPE}-$$name; \ done + +execute_after_dh_installman: + ln -s ccom.1.gz debian/pcc/usr/share/man/man1/cxxcom.1.gz diff -Nru pcc-1.2.0~DEVEL+20200630/f77/fcom/CVS/Entries pcc-1.2.0~DEVEL+20220331/f77/fcom/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/f77/fcom/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/f77/fcom/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -18,7 +18,7 @@ /lex.c/1.12/Sun May 11 15:28:03 2008// /main.c/1.17/Thu Mar 22 18:51:40 2012// /misc.c/1.17/Wed Feb 11 15:58:55 2009// -/proc.c/1.14/Wed Dec 24 17:40:41 2008// +/proc.c/1.15/Fri Oct 8 15:59:07 2021// /put.c/1.17/Sun May 11 15:28:03 2008// /putscj.c/1.18/Fri Dec 19 08:08:48 2008// /scjdefs.h/1.9/Sun Mar 23 09:17:44 2008// diff -Nru pcc-1.2.0~DEVEL+20200630/f77/fcom/proc.c pcc-1.2.0~DEVEL+20220331/f77/fcom/proc.c --- pcc-1.2.0~DEVEL+20200630/f77/fcom/proc.c 2008-12-24 17:40:41.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/f77/fcom/proc.c 2021-10-08 15:59:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: proc.c,v 1.14 2008/12/24 17:40:41 sgk Exp $ */ +/* $Id: proc.c,v 1.15 2021/10/08 15:59:07 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * @@ -593,7 +593,7 @@ q->vleng = MKICON(leng); q->vstg = STGAUTO; q->b_addr.ntempelt = nelt; -#ifdef BACKAUTO +#ifdef STACK_DOWN /* stack grows downward */ autoleng += nelt*leng; q->b_addr.memoffset = MKICON( - autoleng ); diff -Nru pcc-1.2.0~DEVEL+20200630/mip/CVS/Entries pcc-1.2.0~DEVEL+20220331/mip/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/mip/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/mip/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -5,6 +5,6 @@ /node.h/1.43/Tue Nov 17 19:19:40 2015// /optim2.c/1.99/Sat Sep 15 15:21:45 2018// /pass2.h/1.144/Sat Mar 11 09:22:09 2017// -/reader.c/1.302/Sat Mar 11 09:22:09 2017// -/regs.c/1.253/Sun Apr 28 18:44:38 2019// +/reader.c/1.307/Sat Oct 9 12:46:09 2021// +/regs.c/1.254/Sat Oct 9 12:46:09 2021// D diff -Nru pcc-1.2.0~DEVEL+20200630/mip/reader.c pcc-1.2.0~DEVEL+20220331/mip/reader.c --- pcc-1.2.0~DEVEL+20200630/mip/reader.c 2017-03-11 09:22:09.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/mip/reader.c 2021-10-09 12:46:09.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: reader.c,v 1.302 2017/03/11 09:22:09 ragge Exp $ */ +/* $Id: reader.c,v 1.307 2021/10/09 12:46:09 ragge Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -507,7 +507,6 @@ &ipp->ipp_vis, &ip->ip_lbl, &ipp->ip_tmpnum, &ipp->ip_lblnum, nam); ipp->ipp_name = xstrdup(nam); - memset(ipp->ipp_regs, -1, sizeof(ipp->ipp_regs)); ipp->ipp_autos = -1; ipp->ip_labels = foo; #ifdef TARGET_IPP_MEMBERS @@ -531,7 +530,6 @@ ipp->ip_tmpnum = rdint(&p); ipp->ip_lblnum = rdint(&p); ipp->ipp_name = rdstr(&p); - memset(ipp->ipp_regs, 0, sizeof(ipp->ipp_regs)); SKIPWS(p); if (*p == '+') { int num, i; @@ -557,7 +555,17 @@ #endif pass2_compile((struct interpass *)ipp); break; - + case '$': /* assembler */ + if (*p) { + int sz = strlen(p); + ip = malloc(sizeof(struct interpass)); + ip->type = IP_ASM; + ip->ip_asm = tmpalloc(sz+1); + memcpy(ip->ip_asm, p, sz); + ip->ip_asm[sz] = 0; + pass2_compile(ip); + } + break; default: comperr("bad string %s", b); } @@ -588,6 +596,10 @@ if (ip->type != IP_EPILOG) return; + afree(); + p2e->epp = (struct interpass_prolog *)DLIST_PREV(&p2e->ipole, qelem); + p2maxautooff = p2autooff = p2e->epp->ipp_autos; + #ifdef PCC_DEBUG if (e2debug) { printf("Entering pass2\n"); @@ -595,10 +607,6 @@ } #endif - afree(); - p2e->epp = (struct interpass_prolog *)DLIST_PREV(&p2e->ipole, qelem); - p2maxautooff = p2autooff = p2e->epp->ipp_autos; - #ifdef PCC_DEBUG sanitychecks(p2e); #endif @@ -727,7 +735,7 @@ deflab(ip->ip_lbl); break; case IP_ASM: - printf("%s", ip->ip_asm); + printf("%s\n", ip->ip_asm); break; default: cerror("emit %d", ip->type); @@ -1600,10 +1608,15 @@ { int t, al, sz; +#ifdef WORD_ADDRESSED + sz = k; /* temps is in "words" */ + al = k; +#else al = (k > 1 ? ALDOUBLE/ALCHAR : ALINT/ALCHAR); sz = k * (SZINT/SZCHAR); +#endif -#ifndef BACKTEMP +#ifndef STACK_DOWN SETOFF(p2autooff, al); t = p2autooff; p2autooff += sz; diff -Nru pcc-1.2.0~DEVEL+20200630/mip/regs.c pcc-1.2.0~DEVEL+20220331/mip/regs.c --- pcc-1.2.0~DEVEL+20200630/mip/regs.c 2019-04-28 18:44:38.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/mip/regs.c 2021-10-09 12:46:09.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: regs.c,v 1.253 2019/04/28 18:44:38 ragge Exp $ */ +/* $Id: regs.c,v 1.254 2021/10/09 12:46:09 ragge Exp $ */ /* * Copyright (c) 2005 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -3226,6 +3226,7 @@ ip = ipnode(p); DLIST_INSERT_BEFORE(ipole->qelem.q_back, ip, qelem); } - stktemp = freetemp(ntsz); + if (ntsz) + stktemp = freetemp(ntsz); /* Done! */ } diff -Nru pcc-1.2.0~DEVEL+20200630/os/bsd/ccconfig.h pcc-1.2.0~DEVEL+20220331/os/bsd/ccconfig.h --- pcc-1.2.0~DEVEL+20200630/os/bsd/ccconfig.h 2019-03-28 21:15:58.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/bsd/ccconfig.h 2021-10-15 15:33:09.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: ccconfig.h,v 1.4 2019/03/28 21:15:58 ragge Exp $ */ +/* $Id: ccconfig.h,v 1.5 2021/10/15 15:33:09 ragge Exp $ */ /* * Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se). @@ -52,6 +52,7 @@ #error defines for arch missing #endif +#if defined(mach_pdp11) #define PCC_EARLY_AS_ARGS \ strlist_append(&args, "-V"); \ strlist_append(&args, "-u"); @@ -62,4 +63,9 @@ #define PCC_SETUP_LD_ARGS \ strlist_append(&early_linker_flags, "-X"); #define STARTLABEL "start" +#endif /* mach_pdp11 */ +#if defined(mach_nova) +#define HAVE_CC2 /* compile cc2 as well */ +#define NEED_CC2 /* always use cc2 */ +#endif /* if mach_nova */ diff -Nru pcc-1.2.0~DEVEL+20200630/os/bsd/CVS/Entries pcc-1.2.0~DEVEL+20220331/os/bsd/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/os/bsd/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/bsd/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,2 +1,2 @@ -/ccconfig.h/1.4/Thu Mar 28 21:15:58 2019// +/ccconfig.h/1.5/Fri Oct 15 15:33:09 2021// D diff -Nru pcc-1.2.0~DEVEL+20200630/os/darwin/ccconfig.h pcc-1.2.0~DEVEL+20220331/os/darwin/ccconfig.h --- pcc-1.2.0~DEVEL+20200630/os/darwin/ccconfig.h 2014-06-04 06:43:50.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/darwin/ccconfig.h 2021-08-09 07:47:11.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: ccconfig.h,v 1.20 2014/06/04 06:43:50 gmcgarry Exp $ */ +/* $Id: ccconfig.h,v 1.21 2021/08/09 07:47:11 gmcgarry Exp $ */ /* * Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se). @@ -25,12 +25,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define XCODE_PLATFORM "MacOSX" +#define XCODE_SELECT_LINK "/var/db/xcode_select_link/" +#define XCODE_PLATFORM_SDK XCODE_SELECT_LINK "Platforms/" XCODE_PLATFORM ".platform/Developer/SDKs/" XCODE_PLATFORM ".sdk" + /* * Various settings that controls how the C compiler works. */ /* common cpp predefines */ #define CPPADD { "-D__Darwin__", "-D__APPLE__", "-D__MACH__", "-D__APPLE_CPP__", NULL } +#define STDINC XCODE_PLATFORM_SDK "/usr/include" #define CRT0 "crt1.o" #define GCRT0 "gcrt1.o" #define CRTBEGIN_T 0 @@ -43,7 +48,8 @@ #define CRTN 0 #define DEFLIBS { "-lSystem", "-lpcc", NULL } #define DEFPROFLIBS { "-lSystem_profile", "-lpcc", NULL } -#define STARTLABEL "start" +#define DEFLIBDIRS { XCODE_PLATFORM_SDK "/usr/lib", NULL } +#define STARTLABEL "start" #ifdef LANG_F77 #define F77LIBLIST { "-L" PCCLIBDIR, "-lF77", "-lI77", "-lm", "-lc", NULL }; @@ -58,7 +64,9 @@ #elif defined(mach_powerpc) #define CPPMDADD { "-D__ppc__", "-D__BIG_ENDIAN__", NULL } #elif defined(mach_amd64) -#define CPPMDADD { "-D__x86_64__", "-D__LITTLE_ENDIAN__", NULL } +#define CPPMDADD \ + { "-D__x86_64__", "-D__x86_64", "-D__amd64__", "-D__amd64", \ + "-D__LP64__", "-D_LP64", "-D__LITTLE_ENDIAN__", NULL } #elif define(mach_m68k) #define CPPMDADD { "-D__m68k__", "-D__BIG_ENDIAN__", NULL } #else @@ -107,5 +115,3 @@ continue; \ } \ } - - diff -Nru pcc-1.2.0~DEVEL+20200630/os/darwin/CVS/Entries pcc-1.2.0~DEVEL+20220331/os/darwin/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/os/darwin/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/darwin/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,2 +1,2 @@ -/ccconfig.h/1.20/Wed Jun 4 06:43:50 2014// +/ccconfig.h/1.21/Mon Aug 9 07:47:11 2021// D diff -Nru pcc-1.2.0~DEVEL+20200630/os/linux/ccconfig.h pcc-1.2.0~DEVEL+20220331/os/linux/ccconfig.h --- pcc-1.2.0~DEVEL+20200630/os/linux/ccconfig.h 2020-06-13 14:55:53.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/linux/ccconfig.h 2021-08-08 23:50:10.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: ccconfig.h,v 1.29 2020/06/13 14:55:53 ragge Exp $ */ +/* $Id: ccconfig.h,v 1.30 2021/08/08 23:50:10 gmcgarry Exp $ */ /* * Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se). @@ -37,7 +37,10 @@ #define STARTLABEL "_start" -#if defined(mach_i386) +#if defined(mach_arm) +#define CPPMDADD { "-D__arm__", NULL, } +#define DYNLINKLIB "/lib/ld-linux.so.2" +#elif defined(mach_i386) #define CPPMDADD { "-D__i386__", NULL, } #define DYNLINKLIB "/lib/ld-linux.so.2" #define MUSL_DYLIB "/lib/ld-musl-i386.so.1" diff -Nru pcc-1.2.0~DEVEL+20200630/os/linux/CVS/Entries pcc-1.2.0~DEVEL+20220331/os/linux/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/os/linux/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/linux/CVS/Entries 2022-03-31 01:00:00.000000000 +0000 @@ -1,2 +1,2 @@ -/ccconfig.h/1.29/Sat Jun 13 14:55:53 2020// +/ccconfig.h/1.30/Sun Aug 8 23:50:10 2021// D diff -Nru pcc-1.2.0~DEVEL+20200630/os/none/ccconfig.h pcc-1.2.0~DEVEL+20220331/os/none/ccconfig.h --- pcc-1.2.0~DEVEL+20200630/os/none/ccconfig.h 2017-01-18 08:45:47.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/none/ccconfig.h 2021-08-08 23:50:10.000000000 +0000 @@ -1,4 +1,4 @@ -/* $Id: ccconfig.h,v 1.5 2017/01/18 08:45:47 ragge Exp $ */ +/* $Id: ccconfig.h,v 1.6 2021/08/08 23:50:10 gmcgarry Exp $ */ /* * Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se). @@ -41,12 +41,14 @@ #define STARTFILES { NULL } #define ENDFILES { NULL } -#if defined(mach_m16c) +#if defined(mach_arm) +#define CPPMDADD { "-D__arm__", NULL, } +#elif defined(mach_i86) +#define CPPMDADD { "-D__i86__", NULL, } +#elif defined(mach_m16c) #define CPPMDADD { "-D__m16c__", NULL, } #elif defined(mach_nova) #define CPPMDADD { "-D__nova__", NULL, } -#elif defined(mach_i86) -#define CPPMDADD { "-D__i86__", NULL, } #elif defined(mach_pdp7) #define CPPMDADD { "-D__pdp7__", "-Dpdp7", NULL, } #else diff -Nru pcc-1.2.0~DEVEL+20200630/os/none/CVS/Entries pcc-1.2.0~DEVEL+20220331/os/none/CVS/Entries --- pcc-1.2.0~DEVEL+20200630/os/none/CVS/Entries 2020-06-30 01:00:00.000000000 +0000 +++ pcc-1.2.0~DEVEL+20220331/os/none/CVS/Entries 2022-03-31 01:00:01.000000000 +0000 @@ -1,2 +1,2 @@ -/ccconfig.h/1.5/Wed Jan 18 08:45:47 2017// +/ccconfig.h/1.6/Sun Aug 8 23:50:10 2021// D