December
28
Compiling squidGuard 1.4 on CentOS 5.1
SquidGuard is a URL redirector for the Squid HTTP Proxy server. Its main purpose is to restrict access to unsavoury websites.
I found that when compiling squidGuard 1.4 on the CentOS 5.1 distribution of Linux, the ‘make’ phase failed with the following error:
/bin/sh: -c: line 1: syntax error near unexpected token `then' /bin/sh: -c: line 1: ` @if [ ! -x bison -y ]; then \' make[1]: *** [y.tab.c] Error 2 make[1]: Leaving directory `/home/antgreen/downloads/squidGuard-1.4/src' make: *** [all] Error 1
My workaround was to edit the file: src/Makefile and replace the following:
y.tab.c y.tab.h: sg.y sg.h @if [ "$(YACC)" = "yacc" ]; then \ @if [ ! -x $(YACC) ]; then \ echo " " ; \ echo "No yacc/bison found. Copy prepared files for y.tab.h and y.tab.c over. " ; \ echo " " ; \ cp y.tab.h.bison y.tab.h ; \ cp y.tab.c.bison y.tab.c ; \ else \ $(YACC) -d sg.y ; \ fi ; \ else \ $(YACC) -d sg.y ; \ fi ;
with:
y.tab.c y.tab.h: sg.y sg.h $(YACC) -d sg.y ; \
Re-run ‘make’ and cross your fingers!