File: replace-ac-check-file.patch

package info (click to toggle)
gnucobol4 4.0~early~20200606-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 19,880 kB
  • sloc: sh: 119,499; ansic: 98,781; yacc: 16,917; lex: 4,610; cobol: 1,281; perl: 553; makefile: 521; sed: 16
file content (25 lines) | stat: -rw-r--r-- 1,087 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: gnucobol3 fails to cross build from source, because it abuses
            AC_CHECK_FILE. The macro is meant to check for files on the host system,
            but it is used to check for files inside the build tree.
Author: Helmut Grohne <helmut@subdivi.de>
--- gnucobol4-4.0~early~20200606.orig/configure.ac
+++ gnucobol4-4.0~early~20200606/configure.ac
@@ -590,7 +590,7 @@
 	AC_MSG_NOTICE([Checks for local cJSON ...])
 	curr_libs="$LIBS"; curr_cppflags="$CPPFLAGS"
 	with_cjson_local=no
-	AC_CHECK_FILE([./libcob/cJSON.c],
+	AS_IF([test -e ./libcob/cJSON.c],
 	  [AC_MSG_CHECKING([if linking of ./libcob/cJSON.c works])
 	   CPPFLAGS="$curr_cppflags -I./libcob"
 	   AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cJSON.c"]],
@@ -601,7 +601,7 @@
 	   )]
 	)
 	if test "$with_cjson_local" = "no"; then
-	  AC_CHECK_FILE([$srcdir/libcob/cJSON.c],
+	  AS_IF([test -e "$srcdir/libcob/cJSON.c"],
 	    [AC_MSG_CHECKING([if linking of $srcdir/libcob/cJSON.c works])
 	     CPPFLAGS="$curr_cppflags -I$srcdir/libcob"
 	     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cJSON.c"]],