]> granicus.if.org Git - yasm/commitdiff
Replace --enable-dev functionality with --enable-maintainer-mode usage, other
authorPeter Johnson <peter@tortall.net>
Thu, 13 Mar 2003 04:03:59 +0000 (04:03 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 13 Mar 2003 04:03:59 +0000 (04:03 -0000)
fixes and whitespace cleanup.  Renamed ANSI_CFLAGS to MORE_CFLAGS.  Enable
"morewarn" along with --enable-maintainer-mode if GCC is present by default.

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

Makefile.am
autogen.sh
configure.ac

index 63fe1dd1900589555b9945b596cbcb435e45faba..709f006ea8d2cc6710f55cdc5a2cd72d1615726d 100644 (file)
@@ -3,7 +3,7 @@
 SUBDIRS = libltdl m4 po .
 
 AM_YFLAGS = -d
-AM_CFLAGS = @ANSI_CFLAGS@
+AM_CFLAGS = @MORE_CFLAGS@
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src \
        -I$(top_srcdir)/check \
index 47cf79ca8f5539caf4e3de347fa9dcef0d20dd42..9b7ebc1d523ddf5fd54aa409595165740141601b 100755 (executable)
@@ -63,9 +63,9 @@ if test "$DIE" -eq 1; then
 fi
 
 if test -z "$*"; then
-        echo "I am going to run ./configure with --enable-dev - if you wish "
-        echo "to pass any other args to it, please specify them on the $0"
-       echo "command line."
+        echo "I am going to run ./configure with --enable-maintainer-mode"
+        echo "If you wish to pass any other args to it, please specify them"
+       echo "on the $0 command line."
 fi
 
 echo "Generating configuration files for $package, please wait...."
@@ -85,6 +85,6 @@ echo "  automake -a"
 automake -a # || exit 1
 echo "  autoconf"
 autoconf || exit 1
-echo "  configure --enable-dev $@"
-$srcdir/configure --enable-dev "$@" || exit 1
+echo "  configure --enable-maintainer-mode $@"
+$srcdir/configure --enable-maintainer-mode "$@" || exit 1
 
index 7c1e5459cef9c01feee3b96c2d5aaafb92c55abd..615bd9a4ee7b6bc8d2b4a449af987d2b7c295106 100644 (file)
@@ -19,46 +19,38 @@ AM_MAINTAINER_MODE
 #
 # autoconf command-line options
 #
-AC_ARG_ENABLE(dev,
-AC_HELP_STRING([--enable-dev],[Enable full development build capability]),
+AC_ARG_ENABLE(debug,
+AC_HELP_STRING([--enable-debug],
+              [Turn on debugging and compile time warnings]),
 [case "${enableval}" in
-  yes) dev=true ;;
-  no)  dev=false ;;
-  *) AC_MSG_ERROR([bad value ${enableval} for --enable-dev]) ;;
-esac],[dev=false])
-AM_CONDITIONAL(DEV, test x$dev = xtrue)
-
-AC_ARG_ENABLE(morewarn,
-AC_HELP_STRING([--enable-morewarn],[Enable lots of extra GCC warnings]),
-[case "${enableval}" in
-  yes) morewarn=true ;;
-  no)  morewarn=false ;;
-  *) AC_MSG_ERROR([bad value ${enableval} for --enable-morewarn]) ;;
-esac],[morewarn=false])
+  yes) debugging="yes" ;;
+  no)  debugging="no" ;;
+  *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+esac])
 
 AC_ARG_ENABLE(warnerror,
 AC_HELP_STRING([--enable-warnerror],[Treat GCC warnings as errors]),
 [case "${enableval}" in
-  yes) warnerror=true ;;
-  no)  warnerror=false ;;
+  yes) warnerror="yes" ;;
+  no)  warnerror="no" ;;
   *) AC_MSG_ERROR([bad value ${enableval} for --enable-warnerror]) ;;
-esac],[warnerror=false])
+esac])
 
 AC_ARG_ENABLE(profiling,
 AC_HELP_STRING([--enable-profiling],[Enable profiling (requires GCC)]),
 [case "${enableval}" in
-  yes) profiling=true ;;
-  no)  profiling=false ;;
+  yes) profiling="yes" ;;
+  no)  profiling="no" ;;
   *) AC_MSG_ERROR([bad value ${enableval} for --enable-profiling]) ;;
-esac],[profiling=false])
+esac])
 
 AC_ARG_ENABLE(gcov,
 AC_HELP_STRING([--enable-gcov],[Enable gcov code coverage (requires GCC)]),
 [case "${enableval}" in
-  yes) gcov=true ;;
-  no)  gcov=false ;;
+  yes) gcov="yes" ;;
+  no)  gcov="no" ;;
   *) AC_MSG_ERROR([bad value ${enableval} for --enable-gcov]) ;;
-esac],[gcov=false])
+esac])
 
 #
 # Checks for programs.
@@ -159,27 +151,37 @@ fi
 ARCH=x86
 AC_SUBST([ARCH])
 
-# Require things for --enable-dev option.
-if ${dev}; then
-       # Require Perl
-       if test -z "$PERL" || test "$PERL" = ":"; then
-               AC_MSG_ERROR([Perl not found in \$PATH])
-       fi
-
-       # Require Perl >= PERL_VERSION
-       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
-
-       # Require groff
-       if test -z "$GROFF" || test "$GROFF" = ":"; then
-               AC_MSG_ERROR([groff not found in \$PATH])
-       fi
+# Require things for --enable-maintainer-mode option.
+if test "$USE_MAINTAINER_MODE" = "yes"; then
+  # Enable debugging
+  if test "$debugging" != "no"; then
+    debugging=yes
+  fi
+
+  # Enable more warnings
+  if test "$GCC" = "yes"; then
+    MORE_CFLAGS="$MORE_CFLAGS -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings"
+  fi
+
+  # Require Perl
+  if test -z "$PERL" || test "$PERL" = ":"; then
+    AC_MSG_ERROR([Perl not found in \$PATH])
+  fi
+
+  # Require Perl >= PERL_VERSION
+  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
+
+  # Require groff
+  if test -z "$GROFF" || test "$GROFF" = ":"; then
+    AC_MSG_ERROR([groff not found in \$PATH])
+  fi
 fi
 
 #
@@ -189,55 +191,52 @@ fi
 # "Check" tests can use fork/wait/msg* if ALL are available.
 AH_TEMPLATE([USE_FORKWAITMSG], [Combined test for fork/wait/msg*])
 if ${check}; then
-       if test "$ac_cv_func_fork" = yes &&
-          test "$ac_cv_func_wait" = yes &&
-          test "$ac_cv_func_msgctl" = yes &&
-          test "$ac_cv_func_msgget" = yes &&
-          test "$ac_cv_func_msgrcv" = yes &&
-          test "$ac_cv_func_msgsnd" = yes; then
-               AC_DEFINE([USE_FORKWAITMSG])
-               AC_DEFINE([_GNU_SOURCE], 1,
-                         [Make sure we see all GNU extensions.])
-               AC_DEFINE([_SVID_SOURCE], 1,
-                         [Make sure we see all SVID extensions.])
-       fi
-fi
-
-# Enable debugging if --enable-dev, otherwise optimize
-if ${dev}; then
-       DEVFLAGS=" -g"
-else
-       DEVFLAGS=" -O"
+  if test "$ac_cv_func_fork" = yes &&
+     test "$ac_cv_func_wait" = yes &&
+     test "$ac_cv_func_msgctl" = yes &&
+     test "$ac_cv_func_msgget" = yes &&
+     test "$ac_cv_func_msgrcv" = yes &&
+     test "$ac_cv_func_msgsnd" = yes; then
+    AC_DEFINE([USE_FORKWAITMSG])
+    AC_DEFINE([_GNU_SOURCE], 1,
+             [Make sure we see all GNU extensions.])
+    AC_DEFINE([_SVID_SOURCE], 1,
+             [Make sure we see all SVID extensions.])
+  fi
 fi
 
-# More warnings to help write clean code
-if ${morewarn}; then
-       MOREWARNFLAGS="-Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings"
+if test "$debugging" = "no" ; then
+  changequote(,)
+  CFLAGS="`echo $CFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`"
+  changequote([,])
 fi
 
 # Turn warnings into errors
-if ${warnerror}; then
-       WARNERRORFLAGS="-Werror"
+if test "$warnerror" = "yes"; then
+  if test "$GCC" = "yes"; then
+    MORE_CFLAGS="$MORE_CFLAGS -Werror"
+  fi
 fi
 
 # Enable output of profiling information
-if ${profiling}; then
-       PROFILINGFLAGS="-pg"
+if test "$profiling" = "yes"; then
+  if test "$GCC" = "yes"; then
+    MORE_CFLAGS="$MORE_CFLAGS -pg"
+  fi
 fi
 
 # Enable output of gcov information
-if ${gcov}; then
-       GCOVFLAGS="-fprofile-arcs -ftest-coverage"
+if test "$gcov" = "yes"; then
+  if test "$GCC" = "yes"; then
+    MORE_CFLAGS="$MORE_CFLAGS -fprofile-arcs -ftest-coverage"
+  fi
 fi
 
-# If we're using GCC, then we can enable the above CFLAGS as well as turn on
-# -ansi -pedantic -Wall.
+# If we're using GCC, then we can turn on -ansi -pedantic -Wall too.
 if test "$GCC" = yes; then
-       ANSI_CFLAGS="-ansi -pedantic -Wall $MOREWARNFLAGS $WARNERRORFLAGS $DEVFLAGS $PROFILINGFLAGS $GCOVFLAGS"
-else
-       ANSI_CFLAGS=""
+  MORE_CFLAGS="-ansi -pedantic -Wall $MORE_CFLAGS"
 fi
-AC_SUBST(ANSI_CFLAGS)
+AC_SUBST(MORE_CFLAGS)
 
 # Substitutions for libltdl
 AC_SUBST(INCLTDL)