Home page logo

nmap-dev logo Nmap Development mailing list archives

GTK+ test broken in configure.ac
From: David Fifield <david () bamsoftware com>
Date: Thu, 18 Oct 2007 12:41:45 -0600

The test for GTK+ in the main configure.ac fails with a syntax error if
GTK+ 2.0 is not present:

  checking If you have GTK+ installed...
  ./configure[7104]: test: 2: unexpected operator/operand

This is caused by this snippet in configure.ac:

  ver=`pkg-config --modversion gtk+-2.0`
  dnl Extract the information.
  major=`echo $ver|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  minor=`echo $ver|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  micro=`echo $ver|sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  if test $major -lt $GTK_NEEDED_MAJOR -o $major -eq $GTK_NEEDED_MAJOR \
    -a $minor -lt $GTK_NEEDED_MINOR -o $minor -eq $GTK_NEEDED_MINOR \
    -a $micro -lt $GTK_NEEDED_MICRO; then

If GTK+ is not installed, `pkg-config --modversion gtk+-2.0` returns
nothing; hence $major, $minor, and $micro are blank.

This bug is harmless; by coincidence the test failing because of
improper syntax has the same effect as it failing because GTK+ is too
old. Nevertheless, the attached patch causes configure.ac to use
AM_PATH_GTK_2_0 just like nmapfe/configure.ac does. It also moves the
definition of the RECVFROM_ARG6_TYPE macro to acinclude.m4 where it

David Fifield

Attachment: gtk-config.diff

Sent through the nmap-dev mailing list
Archived at http://SecLists.Org

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]