head	1.3;
access;
symbols;
locks; strict;
comment	@# @;


1.3
date	2026.10.29.16.28.04;	author gutteridge;	state Exp;
branches;
next	1.2;
commitid	3oQoGmcP9hq8ko1H;

1.2
date	2026.10.19.23.51.13;	author gutteridge;	state Exp;
branches;
next	1.1;
commitid	exP3lkgZQR1j590H;

1.1
date	2026.10.19.23.09.37;	author gutteridge;	state Exp;
branches;
next	;
commitid	rAZuE1lOOKUZP80H;


desc
@@


1.3
log
@librep: account for loongarch64 and riscv stack direction
@
text
@$NetBSD: patch-configure,v 1.2 2026/10/19 23:51:13 gutteridge Exp $

Modernize C tests to fix builds with GCC >= 14.
https://github.com/SawfishWM/librep/commit/48f557ab34d47a7a1fd9e8425542f720be40946e

Account for loongarch64 and riscv stack direction.
https://github.com/SawfishWM/librep/commit/e668e25fd994a76275d788e16f290931372773b5
https://github.com/SawfishWM/librep/commit/52d64573cf4e3e6d92ef7ec2b72a73abdccd0389

--- configure.orig	2017-08-25 20:05:31.000000000 +0000
+++ configure
@@@@ -14798,7 +14798,8 @@@@ else
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-main () { exit (!(sizeof (int) >= sizeof (void *)));}
+#include <stdlib.h>
+int main () { exit (!(sizeof (int) >= sizeof (void *)));}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   with_value_type=int
@@@@ -14817,7 +14818,8 @@@@ else
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-main () { exit (!(sizeof (long int) >= sizeof (void *)));}
+#include <stdlib.h>
+int main () { exit (!(sizeof (long int) >= sizeof (void *)));}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   with_value_type="long int"
@@@@ -14836,7 +14838,8 @@@@ else
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-main () { exit (!(sizeof (long long int) >= sizeof (void *)));}
+#include <stdlib.h>
+int main () { exit (!(sizeof (long long int) >= sizeof (void *)));}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   with_value_type="long long int"
@@@@ -14877,7 +14880,8 @@@@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
-	      main () {
+#include <stdlib.h>
+int main () {
 		FILE *f = fopen ("conftestval", "w");
 		if (!f) exit (1);
 		fprintf (f, "%d\n", sizeof (${with_value_type}));
@@@@ -15101,7 +15105,7 @@@@ if test "${with_stack_direction}" = unknown; then
 
 if test "${with_stack_direction}" = unknown; then
   case ${host_cpu} in
-    sparc*|i?86*|powerpc*|x86_64*|arm*|aarch64*|s390*|mips*|alpha*|ia64*)
+    sparc*|i?86*|powerpc*|x86_64*|arm*|aarch64*|s390*|mips*|alpha*|ia64*|loongarch64*|riscv*)
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming downwards" >&5
 $as_echo "assuming downwards" >&6; }
       with_stack_direction="-1"
@@@@ -15122,6 +15126,7 @@@@ else
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+ #include <stdlib.h>
  int level = 1;
 	       void inner (char *foo) { char bar;
 		 if (level) { --level; inner (foo); }
@


1.2
log
@librep: note upstream version of some build fixes

(There actually is an upstream still, it just hasn't released anything
since 2017, and its main archive site is no longer functioning. Their
patching here is basically the same as what was already committed.)
@
text
@d1 1
a1 1
$NetBSD: patch-configure,v 1.1 2026/10/19 23:09:37 gutteridge Exp $
d6 4
d52 9
@


1.1
log
@librep: fix builds with GCC >= 14

Tested on NetBSD 11.99.9 with GCC 14.4.0 and Fedora Linux 44 with GCC
16.2.1. (Given the configure script was generated from a significantly
older version of autoconf, and the upstream appears to be gone,
patching is applied directly against it for the minimal diff, but an
equivalent change to configure.ac is included, should it be useful to
someone.)
@
text
@d1 1
a1 1
$NetBSD$
d4 1
@

