summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/m4/public.m435
-rw-r--r--source4/build/smb_build/input.pm10
-rw-r--r--source4/build/smb_build/makefile.pm40
-rw-r--r--source4/build/smb_build/output.pm6
-rw-r--r--source4/build/smb_build/summary.pm13
5 files changed, 61 insertions, 43 deletions
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4
index 41600986c8..9e82e6aaf1 100644
--- a/source4/build/m4/public.m4
+++ b/source4/build/m4/public.m4
@@ -67,21 +67,14 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
- echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
- SMB_EXT_LIB($1)
- SMB_ENABLE($1, NO)
- $4
-
+ echo "*** Or see http://pkg-config.freedesktop.org/ to get pkg-config."
+ ac_cv_$1_found=no
else
if $PKG_CONFIG --atleast-pkgconfig-version 0.9.0; then
AC_MSG_CHECKING(for $2)
- if test "$SMB_$1"x = "NO"x ; then
- SMB_ENABLE($1, NO)
- AC_MSG_RESULT(disabled)
- $4
- elif $PKG_CONFIG --exists '$2' ; then
- AC_MSG_RESULT(yes)
+ if $PKG_CONFIG --exists '$2' ; then
+ AC_MSG_RESULT(yes)
$1_CFLAGS="`$PKG_CONFIG --cflags '$2'`"
@@ -101,23 +94,27 @@ AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG],
[`$PKG_CONFIG --cflags-only-other '$2'`],
[`$PKG_CONFIG --cflags-only-I '$2'`],
[`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`])
- $3
+ ac_cv_$1_found=yes
else
- SMB_EXT_LIB($1)
- SMB_ENABLE($1, NO)
AC_MSG_RESULT(no)
$PKG_CONFIG --errors-to-stdout --print-errors '$2'
- $4
+ ac_cv_$1_found=no
fi
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
- echo "*** See http://www.freedesktop.org/software/pkgconfig"
- SMB_EXT_LIB($1)
- SMB_ENABLE($1, NO)
- $4
+ echo "*** See http://pkg-config.freedesktop.org/"
+ ac_cv_$1_found=no
fi
fi
+ if test x$ac_cv_$1_found = x"yes"; then
+ ifelse([$3], [], [echo -n ""], [$3])
+ else
+ ifelse([$4], [], [
+ SMB_EXT_LIB($1)
+ SMB_ENABLE($1, NO)
+ ], [$4])
+ fi
])
dnl SMB_INCLUDE_MK(file)
diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm
index 77b497d25c..a96aad2271 100644
--- a/source4/build/smb_build/input.pm
+++ b/source4/build/smb_build/input.pm
@@ -91,11 +91,17 @@ sub check_module($$$)
}
if (not defined($mod->{OUTPUT_TYPE})) {
- $mod->{OUTPUT_TYPE} = $default_ot;
+ if ($INPUT->{$mod->{SUBSYSTEM}}->{TYPE} eq "EXT_LIB") {
+ $mod->{OUTPUT_TYPE} = ["SHARED_LIBRARY"];
+ } else {
+ $mod->{OUTPUT_TYPE} = $default_ot;
+ }
}
if (grep(/SHARED_LIBRARY/, @{$mod->{OUTPUT_TYPE}})) {
- $mod->{INSTALLDIR} = "MODULESDIR/$mod->{SUBSYSTEM}";
+ my $sane_subsystem = lc($mod->{SUBSYSTEM});
+ $sane_subsystem =~ s/^lib//;
+ $mod->{INSTALLDIR} = "MODULESDIR/$sane_subsystem";
push (@{$mod->{PRIVATE_DEPENDENCIES}}, $mod->{SUBSYSTEM});
}
if (grep(/INTEGRATED/, @{$mod->{OUTPUT_TYPE}})) {
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index b88a1ea72e..b1bd215af1 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -88,8 +88,7 @@ MODULESDIR = $self->{config}->{modulesdir}
INCLUDEDIR = $self->{config}->{includedir}
CONFIGDIR = $self->{config}->{sysconfdir}
DATADIR = $self->{config}->{datadir}
-WEBAPPSDIR = \$(DATADIR)/webapps
-SERVICESDIR = \$(DATADIR)/services
+SWATDIR = \$(DATADIR)/swat
JSDIR = \$(DATADIR)/js
SETUPDIR = \$(DATADIR)/setup
VARDIR = $self->{config}->{localstatedir}
@@ -115,17 +114,19 @@ sub _prepare_suffix_rules($)
}
$self->output(<< "__EOD__"
+FIRST_PREREQ = $first_prereq
+
# Dependencies command
DEPENDS = \$(CC) -M -MG -MP -MT \$(<:.c=.o) -MT \$@ \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) $first_prereq -o \$@
+ \$(CFLAGS) \$(FIRST_PREREQ) -o \$@
# Dependencies for host objects
HDEPENDS = \$(CC) -M -MG -MP -MT \$(<:.c=.ho) -MT \$@ \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(HOSTCC_CFLAGS) $first_prereq -o \$@
+ \$(HOSTCC_CFLAGS) \$(FIRST_PREREQ) -o \$@
# Dependencies for precompiled headers
PCHDEPENDS = \$(CC) -M -MG -MT include/includes.h.gch -MT \$@ \\
- \$(CFLAGS) $first_prereq -o \$@
+ \$(CFLAGS) \$(FIRST_PREREQ) -o \$@
# \$< is broken in older BSD versions:
# when \$@ is foo/bar.o, \$< could be torture/foo/bar.c
@@ -137,20 +138,20 @@ PCHDEPENDS = \$(CC) -M -MG -MT include/includes.h.gch -MT \$@ \\
# Run a static analysis checker
CHECK = \$(CC_CHECKER) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@
+ \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
# Run the configured compiler
COMPILE = \$(CC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@
+ \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
# Run the compiler for the build host
HCOMPILE = \$(HOSTCC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(HOSTCC_CFLAGS) -c $first_prereq -o \$@
+ \$(HOSTCC_CFLAGS) -c \$(FIRST_PREREQ) -o \$@
# Precompile headers
PCHCOMPILE = @\$(CC) -Ilib/replace \\
`\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c $first_prereq -o \$@
+ \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
__EOD__
);
@@ -284,24 +285,27 @@ sub SharedLibrary($$)
my $init_obj = "";
my $has_static_lib = 0;
-
+
if ($ctx->{TYPE} eq "LIBRARY") {
push (@{$self->{shared_libs}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION}));
push (@{$self->{installable_shared_libs}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}") if (defined($ctx->{SO_VERSION}));
} elsif ($ctx->{TYPE} eq "MODULE") {
+ my $sane_subsystem = lc($ctx->{SUBSYSTEM});
+ $sane_subsystem =~ s/^lib//;
+
push (@{$self->{shared_modules}}, "$ctx->{TARGET_SHARED_LIBRARY}");
push (@{$self->{plugins}}, "$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}");
- $self->{install_plugins} .= "\t\@echo Installing $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME} as \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
- $self->{install_plugins} .= "\t\@mkdir -p \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/\n";
- $self->{install_plugins} .= "\t\@cp $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME} \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
- $self->{uninstall_plugins} .= "\t\@echo Uninstalling \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
- $self->{uninstall_plugins} .= "\t\@-rm \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$ctx->{LIBRARY_REALNAME}\n";
+ $self->{install_plugins} .= "\t\@echo Installing $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME} as \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n";
+ $self->{install_plugins} .= "\t\@mkdir -p \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/\n";
+ $self->{install_plugins} .= "\t\@cp $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME} \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n";
+ $self->{uninstall_plugins} .= "\t\@echo Uninstalling \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n";
+ $self->{uninstall_plugins} .= "\t\@-rm \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/$ctx->{LIBRARY_REALNAME}\n";
if (defined($ctx->{ALIASES})) {
foreach (@{$ctx->{ALIASES}}) {
- $self->{install_plugins} .= "\t\@rm -f \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$_.\$(SHLIBEXT)\n";
- $self->{install_plugins} .= "\t\@ln -fs $ctx->{LIBRARY_REALNAME} \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$_.\$(SHLIBEXT)\n";
- $self->{uninstall_plugins} .= "\t\@-rm \$(DESTDIR)\$(MODULESDIR)/$ctx->{SUBSYSTEM}/$_.\$(SHLIBEXT)\n";
+ $self->{install_plugins} .= "\t\@rm -f \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/$_.\$(SHLIBEXT)\n";
+ $self->{install_plugins} .= "\t\@ln -fs $ctx->{LIBRARY_REALNAME} \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/$_.\$(SHLIBEXT)\n";
+ $self->{uninstall_plugins} .= "\t\@-rm \$(DESTDIR)\$(MODULESDIR)/$sane_subsystem/$_.\$(SHLIBEXT)\n";
}
}
}
diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm
index ec273b894a..42e68abec9 100644
--- a/source4/build/smb_build/output.pm
+++ b/source4/build/smb_build/output.pm
@@ -55,9 +55,11 @@ sub generate_shared_library($)
$lib->{SHAREDDIR} = $lib->{BASEDIR};
} else {
if ($lib->{TYPE} eq "MODULE") {
- $lib->{SHAREDDIR} = "bin/modules/$lib->{SUBSYSTEM}";
+ my $sane_subsystem = lc($lib->{SUBSYSTEM});
+ $sane_subsystem =~ s/^lib//;
+ $lib->{SHAREDDIR} = "bin/modules/$sane_subsystem";
$lib->{LIBRARY_REALNAME} = $link_name;
- $lib->{LIBRARY_REALNAME} =~ s/^$lib->{SUBSYSTEM}_//g;
+ $lib->{LIBRARY_REALNAME} =~ s/^$sane_subsystem\_//g;
$lib->{LIBRARY_REALNAME}.= ".\$(SHLIBEXT)";
} else {
$lib->{SHAREDDIR} = "bin/shared";
diff --git a/source4/build/smb_build/summary.pm b/source4/build/smb_build/summary.pm
index 7b84266d62..541a569a3b 100644
--- a/source4/build/smb_build/summary.pm
+++ b/source4/build/smb_build/summary.pm
@@ -34,6 +34,13 @@ sub showitem($$$)
}
}
+sub showisexternal($$$)
+{
+ my ($output, $desc, $name) = @_;
+ print "Using external $desc: ".
+ (($output->{$name}->{TYPE} eq "EXT_LIB")?"yes":"no")."\n";
+}
+
sub show($$)
{
my ($output,$config) = @_;
@@ -47,8 +54,10 @@ sub show($$)
showitem($output, "using libblkid", ["BLKID"]);
showitem($output, "using iconv", ["ICONV"]);
showitem($output, "using pam", ["PAM"]);
- print "Using external popt: ".
- (($output->{LIBPOPT}->{TYPE} eq "EXT_LIB")?"yes":"no")."\n";
+ showisexternal($output, "popt", "LIBPOPT");
+ showisexternal($output, "talloc", "LIBTALLOC");
+ showisexternal($output, "tdb", "LIBTDB");
+ showisexternal($output, "ldb", "LIBLDB");
print "Developer mode: ".(enabled($config->{developer})?"yes":"no")."\n";
print "Automatic dependencies: ".
(enabled($config->{automatic_dependencies})