Init($srcdir, 'default.cfg');
Log "### Configuring subauthd ###\n\n";
Include Get("CONFIG");
-# What should be detected?
require UCW::Configure::Build;
require UCW::Configure::Paths;
require UCW::Configure::C;
-require UCW::Configure::Pkg;
+use UCW::Configure::Pkg;
# Get some libraries
-UCW::Configure::Pkg::PkgConfig("libucw") or Fail("libucw is required");
-UCW::Configure::Pkg::PkgConfig("libucw-json") or Fail("libucw-json is required");
-UCW::Configure::Pkg::TrivConfig("libgcrypt", script => "libgcrypt-config", minversion => '1.6') or Fail("libgcrypt is required");
+PkgConfig("libucw") or Fail("libucw is required");
+PkgConfig("libucw-json") or Fail("libucw-json is required");
+TrivConfig("libgcrypt", script => "libgcrypt-config", minversion => '1.6') or Fail("libgcrypt is required");
+
+if (IsSet("CONFIG_APACHE_MOD")) {
+ Log "Checking for apxs2 ... ";
+ my $cf = TryCmd("apxs2 -q CFLAGS");
+ my $ei = TryCmd("apxs2 -q EXTRA_INCLUDES");
+ my $id = TryCmd("apxs2 -q INCLUDEDIR");
+ if (!defined($cf) || !defined($id) || !defined($ei)) {
+ Log "NO\n";
+ Fail "Apache's apxs2 utility is required to build the Apache module.";
+ }
+ Log "YES\n";
+ Set("APACHE2_CFLAGS" => "-g $cf $ei -I$id");
+ Set("INSTALL_APACHE2_MOD_DIR" => '$(INSTALL_LIB_DIR)/apache2/modules');
+ Set("INSTALL_APACHE2_CONFIG_DIR" => '$(INSTALL_PREFIX)etc/apache2');
+}
+
+require UCW::Configure::Doc;
+
Finish();
Log "\nConfigured, run `make' to build everything.\n";