[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] mintlib Makefile requires bash as shell



Thomas Huth wrote:
After some investigation, I've found out that the problem is due
to /bin/sh not being the bash on Ubuntu (and Debian), but an
alternative shell called "dash".
When I compile the mintlib with "make SHELL=/bin/bash", everything
works fine.

The problem seems to be the -I$(<../includepath): When I type "echo
$(<../includepath)" in the bash, I get the paths. When I type it in
dash, I get no output at all.

Since we didn't manage to find a simple and good solution as fast as the $(<file) syntax, I propose the following workaround.

Basically, nothing is changed. But after creating the file includepath, the Makefile checks if the shell supports the $(<file) syntax. If it is not the case, it asks the user to use "make SHELL=/bin/bash" instead.

So Ubuntu (and Debian, MacOS X...) people will get this explicit error, and they will know what to do to fix it. There will be no slowdown when compiling on MiNT.

Please commit this patch with the following changelog:

----------------------------------------------------------------------
Added an explicit error message when the shell does not support the $(<file) syntax. Contributed by Vincent Riviere.
----------------------------------------------------------------------

--
Vincent Rivière
diff -aurN mintlib-CVS-20091017.orig/buildrules mintlib-CVS-20091017/buildrules
--- mintlib-CVS-20091017.orig/buildrules	2009-10-17 10:38:36.718750000 +0200
+++ mintlib-CVS-20091017/buildrules	2009-10-27 23:39:51.203125000 +0100
@@ -177,6 +177,12 @@
 	installdir=`$(CC) --print-search-dirs | awk '{ print $$2; exit; }'`; \
 	case $$installdir in /usr/local*) local=/local;; esac; \
 	echo "$${installdir}include -I$${installdir}include-fixed -I/usr$$local/m68k-atari-mint/include" >$@
+	@if [ -z "$$(<$@)" ]; then \
+	  rm $@; \
+	  echo "error: The syntax \$$(<file) is unsupported by $(SHELL)." >&2; \
+	  echo "       Please use \"$(MAKE) SHELL=/bin/bash\" instead." >&2; \
+	  exit 1; \
+	fi
 	
 include $(top_srcdir)/bindist