ac-archive-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ax_prog_apxs.m4


From: Guido Draheim
Subject: Re: ax_prog_apxs.m4
Date: Fri, 25 Jul 2003 01:12:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030313



Dustin Mitchell wrote:
I'm also using apxs, and for Apache module builders it would be handy to
be able to find this program easily.  Here's the macro to do just that.

--snip--
dnl @synopsis AX_PROG_APXS
dnl
dnl Locates an installed apxs binary.  Accepts --with-apxs, and failing
dnl that searches for apxs in the path (using AC_PATH_PROG).  If apxs is found,
dnl $APXS is set to the full path of the binary; otherwise, nothing is changed.
dnl
dnl Example:
dnl
dnl   AX_PROG_APXS
dnl   if test -z "$APXS"
dnl   then
dnl     AC_MSG_ERROR("apxs not found")
dnl   fi
dnl
dnl @author Dustin Mitchell <address@hidden>
AC_DEFUN([AX_PROG_APXS],
[
 AC_MSG_CHECKING(for --with-apxs)
 AC_ARG_WITH(apxs,
             AC_HELP_STRING([--with-apxs=APXS],
                            [absolute path name of apxs executable]),
  [
    if test -f $withval -a -x $withval;
    then
       AC_MSG_RESULT($withval)
       APXS="$withval"
       AC_SUBST(APXS)
    else
       AC_MSG_RESULT($withval is not executable)
    fi
  ], [
    AC_MSG_RESULT(no)
  ])

  # if it's not found, check the paths.
if test -z "$APXS" then
    AC_PATH_PROG(APXS, apxs, , 
/usr/local/apxs/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin)
    AC_SUBST(APXS)
  fi
])
--snip--


Same stuff here, perhaps consider to compute a prog search path as
/usr/apxs/bin:/usr/local/apxs/bin:$PATH or even more clever variants.
That heurisistic itselfs lends a functionality that should be
distributed in the ac archive IYAM, it just needs to be done beefy.

HTH, cheers,
-- guido                                  http://google.de/search?q=guidod
GCS/E/S/P C++/++++$ ULHS L++w- N++@ d(+-) s+a- r+@>+++ y++ 5++X- (geekcode)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]