From: Peter Johnson Date: Tue, 18 Sep 2001 06:22:02 +0000 (-0000) Subject: Limit some tools to --enable-dev only. Only check for and use them if X-Git-Tag: v0.1.0~330 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef19b09dc2ff5a484b6d38f2885da290140fbab9;p=yasm Limit some tools to --enable-dev only. Only check for and use them if --enable-dev is passed to configure. svn path=/trunk/yasm/; revision=184 --- diff --git a/configure.ac b/configure.ac index cc9a472f..86969bd8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,7 @@ # $IdPath$ +PERL_VERSION=5.004 + AC_INIT(src/main.c) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) @@ -7,7 +9,7 @@ AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(yasm, 0.0.1) AC_ARG_ENABLE(dev, -[ --enable-dev Use standard development FLAGS settings], +[ --enable-dev Enable full development build capability], [case "${enableval}" in yes) dev=true ;; no) dev=false ;; @@ -22,8 +24,34 @@ AM_PROG_CC_STDC ALL_LINGUAS="" AM_GNU_GETTEXT -AM_PROG_LEX -AC_PROG_YACC +# Needed tools for building lexers and parsers from original source. +# Only needed for development: generated .c's are included with distributions. +if ${dev}; then + AM_PROG_LEX + AC_PROG_YACC + + # Check for Perl (gen_instr.pl and the like) + AC_PATH_PROGS(PERL, $PERL perl5 perl) + if test -z "$PERL" || test "$PERL" = ":"; then + AC_MSG_ERROR([perl not found in \$PATH]) + fi + + AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION]) + _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5` + _perl_res=$? + AC_MSG_RESULT([$_perl_version]) + + if test "$_perl_res" != 0; then + AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.]) + fi + + # Check for groff (for rendering manpages) + AC_PATH_PROGS(GROFF, $GROFF groff) + if test -z "$PERL" || test "$PERL" = ":"; then + AC_MSG_ERROR([groff not found in \$PATH]) + fi +fi + AC_PROG_INSTALL AC_PROG_RANLIB diff --git a/configure.in b/configure.in index cc9a472f..86969bd8 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,7 @@ # $IdPath$ +PERL_VERSION=5.004 + AC_INIT(src/main.c) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) @@ -7,7 +9,7 @@ AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(yasm, 0.0.1) AC_ARG_ENABLE(dev, -[ --enable-dev Use standard development FLAGS settings], +[ --enable-dev Enable full development build capability], [case "${enableval}" in yes) dev=true ;; no) dev=false ;; @@ -22,8 +24,34 @@ AM_PROG_CC_STDC ALL_LINGUAS="" AM_GNU_GETTEXT -AM_PROG_LEX -AC_PROG_YACC +# Needed tools for building lexers and parsers from original source. +# Only needed for development: generated .c's are included with distributions. +if ${dev}; then + AM_PROG_LEX + AC_PROG_YACC + + # Check for Perl (gen_instr.pl and the like) + AC_PATH_PROGS(PERL, $PERL perl5 perl) + if test -z "$PERL" || test "$PERL" = ":"; then + AC_MSG_ERROR([perl not found in \$PATH]) + fi + + AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION]) + _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5` + _perl_res=$? + AC_MSG_RESULT([$_perl_version]) + + if test "$_perl_res" != 0; then + AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.]) + fi + + # Check for groff (for rendering manpages) + AC_PATH_PROGS(GROFF, $GROFF groff) + if test -z "$PERL" || test "$PERL" = ":"; then + AC_MSG_ERROR([groff not found in \$PATH]) + fi +fi + AC_PROG_INSTALL AC_PROG_RANLIB diff --git a/doc/programmer/queue/Makefile.am b/doc/programmer/queue/Makefile.am index c719c241..c63a1812 100644 --- a/doc/programmer/queue/Makefile.am +++ b/doc/programmer/queue/Makefile.am @@ -7,7 +7,7 @@ noinst_DATA = queue.html queue.ps EXTRA_DIST = queue.3 queue.html: queue.3 - groff -mmandoc -Thtml queue.3 >queue.html + $(GROFF) -mmandoc -Thtml queue.3 >queue.html queue.ps: queue.3 - groff -mmandoc -Tps queue.3 >queue.ps + $(GROFF) -mmandoc -Tps queue.3 >queue.ps diff --git a/modules/parsers/nasm/Makefile.am b/modules/parsers/nasm/Makefile.am index d5d65cf0..71ef46d6 100644 --- a/modules/parsers/nasm/Makefile.am +++ b/modules/parsers/nasm/Makefile.am @@ -2,10 +2,25 @@ noinst_LIBRARIES = libparser.a +if DEV libparser_a_SOURCES = \ parser.c \ bison.y \ token.l +else +libparser_a_SOURCES = \ + parser.c \ + bison.c \ + token.c + +bison.c: bison.y + @echo "Run configure with --enable-dev before making changes here." + @exit 1 + +token.c: token.l + @echo "Run configure with --enable-dev before making changes here." + @exit 1 +endif noinst_SCRIPTS = gen_instr.pl @@ -21,7 +36,12 @@ CFLAGS = -ansi -pedantic -Wall -g endif token.l bison.y: $(top_srcdir)/src/instrs.dat token.l.in bison.y.in gen_instr.pl +if DEV $(PERL) gen_instr.pl -i $(top_srcdir)/src/instrs.dat -t token.l -g bison.y +else + @echo "Run configure with --enable-dev before making changes here." + @exit 1 +endif BUILT_SOURCES = token.l bison.y diff --git a/src/parsers/nasm/Makefile.am b/src/parsers/nasm/Makefile.am index d5d65cf0..71ef46d6 100644 --- a/src/parsers/nasm/Makefile.am +++ b/src/parsers/nasm/Makefile.am @@ -2,10 +2,25 @@ noinst_LIBRARIES = libparser.a +if DEV libparser_a_SOURCES = \ parser.c \ bison.y \ token.l +else +libparser_a_SOURCES = \ + parser.c \ + bison.c \ + token.c + +bison.c: bison.y + @echo "Run configure with --enable-dev before making changes here." + @exit 1 + +token.c: token.l + @echo "Run configure with --enable-dev before making changes here." + @exit 1 +endif noinst_SCRIPTS = gen_instr.pl @@ -21,7 +36,12 @@ CFLAGS = -ansi -pedantic -Wall -g endif token.l bison.y: $(top_srcdir)/src/instrs.dat token.l.in bison.y.in gen_instr.pl +if DEV $(PERL) gen_instr.pl -i $(top_srcdir)/src/instrs.dat -t token.l -g bison.y +else + @echo "Run configure with --enable-dev before making changes here." + @exit 1 +endif BUILT_SOURCES = token.l bison.y