On Sat, Sep 12, 2009 at 12:37 PM, Nick Treleaven <
[email protected]> wrote:
> On Fri, 11 Sep 2009 14:06:38 -0400
> Erik Southworth <[email protected]> wrote:
>
> > To be clear, if we don't have ``which`` it shouldn't error about a c++
> > compiler. Also, (1) if we must have ``which``, configure should check for
> it
> > before trying to use it. (2) If we need to check a prog use AC_CHECK_PROG
> or
> > AC_PATH_PROG.
> >
> > AFAIK,
> > > which is a coreutils utility, so it should work on all systems capable
> of
> > > executing a shell script.
> >
> >
> > No. It's not part of coreutils.
> >
> >
> > > In fact, I think there are many system scripts which
> > > use 'which', so if you don't have 'which', your system shouldn't even
> work.
> > >
> >
> > It's that Geany is built in a clean chroot build environment along with
> only
> > the compilers and libs required. ``which`` is not a necessary build
> > requirement IMHO. We should have a portable, standard, ``configure`` that
> > can build Geany, not a system utility script that calls any arbitrary
> prog
> > and forces users to figure out which ones are needed.
> >
> >
> > > Chances are that your $CXX is not defined to a correct variable.
> > >
> >
> > > >
> > > > How about just using a shell builtin, ``hash``, ``type -P`` or just
> > > ``eval
> > > > $CXX --version`` as a test instead?
> > > Does $CXX --version really exist with all C++ compilers?
> > >
> >
> > Bottom line: we should use portable autoconf macros not random system
> > utilities.
>
> If you provide a patch that does it portably we would likely apply it.
>
> Here is a patch against Rev 4190 in Trunk.
Regards,
> Nick
> _______________________________________________
> Geany-devel mailing list
> [email protected]
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
--
-Erik S
Index: trunk/configure.in
===================================================================
--- trunk/configure.in (revision 4190)
+++ trunk/configure.in (working copy)
@@ -15,9 +15,10 @@
AC_PROG_CXX
# check for C++ compiler explicitly and fail if none is found, do this check
# after AC_PROG_CXX has set the CXX environment variable
-which $CXX >/dev/null 2>&1
-if test "x$?" != "x0"; then
- AC_MSG_ERROR([No C++ compiler not found. Please install a C++ compiler.])
+AC_PATH_PROG([COMPILER], [$CXX])
+if ! test -x "${COMPILER}"
+then
+ AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
fi
#AC_PROG_RANLIB
@@ -48,7 +49,7 @@
# get svn revision (try GIT first, then check for SVN)
REVISION="r0"
-GIT=`which git 2>/dev/null`
+AC_PATH_PROG([GIT], [git])
if test -d ".git" -a "x${GIT}" != "x" -a -x "${GIT}"
then
REVISION=r`git svn find-rev origin/trunk 2>/dev/null ||
@@ -57,7 +58,7 @@
fi
if test "x${REVISION}" = "xr0"
then
- SVN=`which svn 2>/dev/null`
+ AC_PATH_PROG([SVN], [svn])
if test -d ".svn" -a "x${SVN}" != "x" -a -x "${SVN}"
then
REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
_______________________________________________
Geany-devel mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel