httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rasmus Lerdorf <ras...@raleigh.ibm.com>
Subject Re: Apache 2000, err Apache 2.0 gets real
Date Sun, 01 Aug 1999 13:39:05 GMT
> It's correct that Automake is a benefit to deal with _very large_ source
> trees. And there it's great. There it's clear - already from the software
> engineering point of view - that one has to use a tool in order to avoid
> reinvention of the wheel in every subdir. But there are easier and smaller
> tools available which do the job better then Automake, IMHO. At least they
> generate cleaner Makefiles which look like hand-made and can be still be
> understood and better customized. For instance I often used my own very-old
> SMake (Skeleton Make) tool or some similar approaches.

I guess it depends what you consider a very large source tree.  We
switched to automake for PHP4 to make it easy for people to add and
maintain new modules without needing to know anything about the build
process.  The Makefile.am file in each module directory is only 3 lines
long.  For example, for the snmp module it is:

  INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
  noinst_LIBRARIES=libphpext_snmp.a
  libphpext_snmp_a_SOURCES=snmp.c

And then the only other thing a module author needs to do is provide an m4
autoconf script that covers that particular module.  For the snmp module
it looks like this:

AC_MSG_CHECKING(for SNMP support)
AC_ARG_WITH(snmp,
[  --with-snmp[=DIR]       Include SNMP support.  DIR is the SNMP base
                          install directory. It defaults to searching through
                          a number of common locations for the snmp install.],
[
  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then
      SNMP_INCDIR=/usr/local/include
      SNMP_LIBDIR=/usr/local/lib
      test -d /usr/local/include/ucd-snmp && SNMP_INCDIR=/usr/local/include/ucd-snmp
      test -d /usr/include/ucd-snmp && SNMP_INCDIR=/usr/include/ucd-snmp
      test -d /usr/include/snmp && SNMP_INCDIR=/usr/include/snmp
      test -f /usr/lib/libsnmp.a && SNMP_LIBDIR=/usr/lib
    else
      SNMP_INCDIR=$withval/include
      test -d $withval/include/ucd-snmp && SNMP_INCDIR=$withval/include/ucd-snmp
      SNMP_LIBDIR=$withval/lib
    fi
    AC_DEFINE(HAVE_SNMP)
    AC_MSG_RESULT(yes)
    PHP_EXTENSION(snmp)
    AC_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR)
    AC_ADD_INCLUDE($SNMP_INCDIR)
    AC_CHECK_LIB(kstat, kstat_read, [AC_ADD_LIBRARY(kstat)])
  else
    AC_MSG_RESULT(no)
  fi
],[
  AC_MSG_RESULT(no)
])

AC_MSG_CHECKING(whether to enable UCD SNMP hack)
AC_ARG_ENABLE(ucd-snmp-hack,
[  --enable-ucd-snmp-hack  Enable UCD SNMP hack],[
  if test "$enableval" = "yes" ; then
    AC_DEFINE(UCD_SNMP_HACK, 1)
    AC_MSG_RESULT(yes)
  else
    AC_MSG_RESULT(no)
  fi
],[
  AC_MSG_RESULT(no)
])

This means that all configure-related requirements for that particular
module is isolated to that module's own directory.  This is a major
benefit, at least in the PHP project, and I bet with the multiple mpms and
as more modules get added to the Apache base distribution it would be a
major win for Apache as well.

-Rasmus


Mime
View raw message