]> granicus.if.org Git - yasm/commitdiff
Limit some tools to --enable-dev only. Only check for and use them if
authorPeter Johnson <peter@tortall.net>
Tue, 18 Sep 2001 06:22:02 +0000 (06:22 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 18 Sep 2001 06:22:02 +0000 (06:22 -0000)
--enable-dev is passed to configure.

svn path=/trunk/yasm/; revision=184

configure.ac
configure.in
doc/programmer/queue/Makefile.am
modules/parsers/nasm/Makefile.am
src/parsers/nasm/Makefile.am

index cc9a472fd9940294f85be6ae16b8b120b587ae88..86969bd8b290ffd33e309c33889e324502bd3d38 100644 (file)
@@ -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
 
index cc9a472fd9940294f85be6ae16b8b120b587ae88..86969bd8b290ffd33e309c33889e324502bd3d38 100644 (file)
@@ -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
 
index c719c241400e0e7b15b7208b14d4c132cc4043e9..c63a1812a3f5f97c6aca46a61b09184cf9420fe4 100644 (file)
@@ -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
index d5d65cf0b1e37b8013aeae1dd901815f9854fc83..71ef46d6c7b2cbcccceabb551e4af88d355362f6 100644 (file)
@@ -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
 
index d5d65cf0b1e37b8013aeae1dd901815f9854fc83..71ef46d6c7b2cbcccceabb551e4af88d355362f6 100644 (file)
@@ -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