#938 top_srcdir: command not found

closed-fixed
None
5
2013-05-12
2013-02-19
Ryan Schmidt
No

When running the configure script of libgphoto2 2.5.1.1 on OS X 10.8.2 there are many "command not found" errors being printed:

checking for shared library run path origin... done
./configure: line 17346: top_srcdir: command not found
./configure: line 17346: top_builddir: command not found
./configure: line 17346: top_srcdir: command not found
./configure: line 17346: top_srcdir: command not found
./configure: line 17346: top_builddir: command not found
checking whether NLS is requested... yes
checking for GNU gettext in libc... no
./configure: line 17592: top_srcdir: command not found
./configure: line 17592: top_builddir: command not found
./configure: line 17592: top_srcdir: command not found
./configure: line 17592: top_srcdir: command not found
./configure: line 17592: top_builddir: command not found
checking for iconv... yes
checking how to link with libiconv... -L/opt/local/lib -liconv
./configure: line 17904: top_srcdir: command not found
./configure: line 17904: top_builddir: command not found
./configure: line 17904: top_srcdir: command not found
./configure: line 17904: top_srcdir: command not found
./configure: line 17904: top_builddir: command not found
./configure: line 17904: top_srcdir: command not found
./configure: line 17904: top_builddir: command not found
./configure: line 17904: top_srcdir: command not found
./configure: line 17904: top_srcdir: command not found
./configure: line 17904: top_builddir: command not found
checking for GNU gettext in libintl... yes
checking whether to use NLS... yes

I have a feeling these lines in the configure.ac file are responsible:

AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)"
AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/libgphoto2_port"
AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/libgphoto2"
AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)/libgphoto2"

Those commands would seem to be trying to start subshells to run the (nonexistent) commands "top_srcdir" and "top_builddir". You're probably intending instead to access the top_srcdir and top_builddir variables, but I'm not very familiar with autoconf syntax so I don't know what the correct way to do that would be.

Discussion

  • the \$ quoting should avoid the shell command evaluation, so there must be a quoting problem somewhere else :/

    line 17346 of the generated 2.5.1.1 configure is

    eval x=\"$x\"

    in the non-linux branch, so thats why I am not seeing this personally here.

    Need to understand a bit of this magic how to fix this right :/

     
    • assigned_to: Marcus Meissner
     
  • I rewrote part of this logic today and moved it out of configure.ac to avoid this kind of expansion.

    should not happen anymore.

     
    • status: open --> pending-fixed
     
  • fixed in 2.52.

     
    • status: pending-fixed --> closed-fixed