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

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

ax_prog_apxs.m4


From: Dustin Mitchell
Subject: ax_prog_apxs.m4
Date: Thu, 24 Jul 2003 17:24:02 -0500
User-agent: Mutt/1.4.1i

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--

Dustin

-- 

  Dustin Mitchell
  address@hidden/address@hidden
  http://people.cs.uchicago.edu/~dustin/




reply via email to

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