最初にすべきことは、Apache拡張ツールapxsまたはapxs2を見つけることです(Apacheのバージョンや構築しているプラットフォームによって異なります)。ツールがどこにあるかがわかったら、クエリを実行して特定のapache構成パラメーターを取得できます。たとえば、システム構成ディレクトリを取得するには、次のコマンドを実行できます。
apxs2 -q SYSCONFDIR
これは、apache拡張ツールを見つける方法のスニペットです:(構文エラーが含まれている可能性があることに注意してください)
dnl Note: AC_DEFUN goes here plus other stuff
AC_MSG_CHECKING(for apache APXS)
AC_ARG_WITH(apxs,
[AS_HELP_STRING([[--with-apxs[=FILE]]],
[path to the apxs, defaults to "apxs".])],
[
if test "$withval" = "yes"; then
APXS=apxs
else
APXS="$withval"
fi
])
if test -z "$APXS"; then
for i in /usr/sbin /usr/local/apache/bin /usr/bin ; do
if test -f "$i/apxs2"; then
APXS="$i/apxs2"
break
fi
if test -f "$i/apxs"; then
APXS="$i/apxs"
break
fi
done
fi
AC_SUBST(APXS)
automake Makefile.amでAPXSを使用する方法は、次のようになります。
## Find apache sys config dir
APACHE2_SYSCONFDIR = `@APXS@ -q SYSCONFDIR`
## Misc automake stuff goes here
install: install-am
cp my.conf $(DESTDIR)${APACHE2_SYSCONFDIR}/conf.d/my.conf
あなたはautomakeとautoconfツールに精通していると思います。