Skip to content

Commit

Permalink
Don't just look for python2. Instead, first look for python, and then
Browse files Browse the repository at this point in the history
see whether it's Python 2 or not; if it's not, *then* look for Python 2.

That way, you can use Python on systems where python is Python 2 and
python2 doesn't exist.

Move the check for Python up after the check for Perl.  (All the program
checks arguably belong together.)

AC_PATH_PROG() does AC_SUBST() for you; don't do it ourselves.

svn path=/trunk/; revision=49253
  • Loading branch information
guyharris committed May 11, 2013
1 parent 526763c commit 5bf8bd4
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])

AM_DISABLE_STATIC

dnl Checks for programs.
#
# Checks for programs used in the build process.
#
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
Expand All @@ -54,6 +56,34 @@ AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_PATH_PROG(PERL, perl)

# Check for Python.
AC_PATH_PROG(PYTHON, python)
if test ! -z "$PYTHON"; then
#
# OK, we found Python; is it Python 2.x?
# Note: we don't use named components for sys.version_info to get
# the major version number, as named components for version_info
# were apparently introduced in Python 2.7.
#
AC_MSG_CHECKING([whether $PYTHON is Python 2])
python_major_version=`$PYTHON -c 'import sys; print sys.version_info[[0]]'`
if test "$python_major_version" = 2; then
AC_MSG_RESULT([yes])
else
#
# It's not 2.x.
#
AC_MSG_RESULT([no])

#
# Try looking for python2; if we find it, we assume it's
# Python 2
#
AC_PATH_PROG(PYTHON, python2)
fi
fi

#
# XXX - should autogen.sh check for YACC/Bison and Flex? A user building
# from a distribution tarball shouldn't have to have YACC/Bison or Flex,
Expand Down Expand Up @@ -133,12 +163,6 @@ else
fi
fi

AC_SUBST(PERL)
AC_SUBST(LEX)
AC_SUBST(POD2MAN)
AC_SUBST(POD2HTML)
AC_SUBST(XMLLINT)

#
# Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
# flags such as -pedantic, -W warning flags and -f feature flags. Currently,
Expand Down Expand Up @@ -414,8 +438,6 @@ AC_PATH_PROG(LYNX, lynx)
AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)

AC_PATH_PROG(PYTHON, python2)

# Check for w3m (html -> text)
AC_PATH_PROG(W3M, w3m)
AC_CHECK_PROG(HAVE_W3M, w3m, "yes", "no")
Expand Down

0 comments on commit 5bf8bd4

Please sign in to comment.