Skip to contentSkip to conversation

Check for flex and bison

PATCH In review Jean Delvare 2 participants 2 messages Oct 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Check for flex and bison

Hi all,

I sometimes help people on IRC who have trouble building lm-sensors from source, and the most frequent problem is that they don't have flex and bison installed. The error message they get is all but explicit. While I agree they should have read the documentation which _does_ explain that flex and bison are required, I think we could still be a little more helpful with a proper error message.

Is there any objection to the following patch? I hope "which" is portable enough.

Index: Makefile
=================================--- Makefile (révision 5865)
+++ Makefile (copie de travail)
@@ -267,6 +267,10 @@

# Flex and Bison
%c: %y
+ @if ! which $(BISON) 2> /dev/null ; then \
+ echo "Please install $(BISON), then run \"make clean\" and try again" ; \
+ false ; \
+ fi
$(BISON) -p sensors_yy -d $< -o $@

ifeq ($(DEBUG),1)
@@ -276,4 +280,8 @@
endif

%.c: %.l
+ @if ! which $(FLEX) 2> /dev/null ; then \
+ echo "Please install $(FLEX), then run \"make clean\" and try again" ; \
+ false ; \
+ fi
$(FLEX) $(FLEX_FLAGS) $< > $@

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw
Quoted 28 lines · Jean Delvare

Hi all,

I sometimes help people on IRC who have trouble building lm-sensors from source, and the most frequent problem is that they don't have flex and bison installed. The error message they get is all but explicit. While I agree they should have read the documentation which _does_ explain that flex and bison are required, I think we could still be a little more helpful with a proper error message.

Is there any objection to the following patch? I hope "which" is portable enough.

Index: Makefile
=================================> --- Makefile (révision 5865)
+++ Makefile (copie de travail)

(quoted diff) +4 -0
@@ -267,6 +267,10 @@
 
 # Flex and Bison
 %c: %y
+	@if ! which $(BISON) 2> /dev/null ; then \
+		echo "Please install $(BISON), then run \"make clean\" and try again" ; \
+		false ; \
+	fi
 	$(BISON) -p sensors_yy -d $< -o $@
 
 ifeq ($(DEBUG),1)

Review line 287

Quoted 8 lines
(quoted diff) +4 -0
@@ -276,4 +280,8 @@
 endif
 
 %.c: %.l
+	@if ! which $(FLEX) 2> /dev/null ; then \
+		echo "Please install $(FLEX), then run \"make clean\" and try again" ; \
+		false ; \
+	fi
 	$(FLEX) $(FLEX_FLAGS) $< > $@

Looks good (and makes sense) to me.

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors