In cfg-racket there are two related bugs that in conjunction break version detection (when --enable-shared is used):
grep .. | cut ... pipeline will output three dots separated by newlines. This pipeline appears to be a carryover from 7.3.$ pwd
/var/tmp/racket-7.4/src
$ grep " MZSCHEME_VERSION " racket/src/schvers.h | cut -d '"' -f 2
.
.
.
x86_64-pc-linux-gnu-gcc.I used the following patch to move the GNU make detection logic outside of the GCC detection guard. It does not address the problems of GCC target triplets or the non-GNU Make fallback version detection.
diff --git a/cfg-racket b/cfg-racket
index 61487cc..d1a4795 100755
--- a/cfg-racket
+++ b/cfg-racket
@@ -4601,23 +4601,28 @@ if test "$ARFLAGS" = '' ; then
fi
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} AR_FLAGS="'"'"${ARFLAGS}"'"'
+is_gmake=`make -v no-such-target-we-hope 2>&1 | grep "GNU Make"`
+
# If using gcc, we want all warnings:
if test "$CC" = "gcc" ; then
COMPFLAGS="$COMPFLAGS -Wall"
# Use -MMD when we have gcc and gnumake:
- is_gmake=`make -v no-such-target-we-hope 2>&1 | grep "GNU Make"`
if test "$is_gmake" = "" ; then
WX_MMD_FLAG=""
else
WX_MMD_FLAG="-MMD"
- INCLUDEDEP="-include"
fi
# Compile mzdyn.o with -fPIC
DYN_CFLAGS="-fPIC"
fi
+# Use GNU Make feature if present
+if test "$is_gmake" != ""; then
+ INCLUDEDEP="-include"
+fi
+
if test "$REZ" = '' ; then
REZ=/Developer/Tools/Rez
fi
I hope this helps :) I could open a PR, but these decisions likely need a lot of testing, and somebody more familiar with Racket's configure scripts.
I neglected to put the steps to reproduce, apologies:
CC to something other than plain gcc and run ./configure --enable-sharedCC, have a non-GNU Make as make in your PATH and run ./configure --enable-sharedThen run make.
Terminal outputs of both ways to trigger bad makefile generation https://gist.github.com/winny-/da00a1d4d8260b1f78b297ee876bee8b
Thanks for this - I can reproduce.
And I faced this exact problem while working on #2882. Getting this fixed just went up in priority.
@winny- PR #2897 fixed the GCC detection part. Feel free to add a PR for your change. At first glance, it looks good. But once you add a PR, CI will test it and we should know if it breaks anything unexpectedly. Do note that to change the configure file, you need to change racket/racket/src/racket/configure.ac, then run racket/racket/src/ac/make-configure (make sure you have autoconf and a racket in PATH). The PR should contain the change to configure.ac and the all the modified generated files. Likely only cfg-racket. Thanks. Let me know if you have any problems.
Fixed through b6627956b63c603654d67bd349a8c6afac421131 and 3cb41850fa8b2159e9a48a9298d5d3f0e114cbf4.
@winny- thanks for the report and PR, closing.
Would it be useful to add a CI/CD configuration to test against a non-GNU Make as make?
It would be good to add that to one of the (many) existing configurations so that we don't add too much more build time.
@samth sure - i will sort that out.