$self->{torture_progs} = [];
$self->{static_libs} = [];
$self->{python_dsos} = [];
+ $self->{python_pys} = [];
$self->{shared_libs} = [];
$self->{installable_shared_libs} = [];
$self->{headers} = [];
$self->output("# Autogenerated by build/smb_build/makefile.pm #\n");
$self->output("################################################\n");
$self->output("\n");
+ $self->output("include mkconfig.mk\n");
$self->output("default: all\n\n");
sub _prepare_suffix_rules($)
{
my ($self) = @_;
- my $first_prereq = '$*.c';
-
- if ($self->{config}->{GNU_MAKE} eq 'yes') {
- $first_prereq = '$<';
- }
$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 \$@
-# Dependencies for host objects
-HDEPENDS = \$(CC) -M -MG -MP -MT \$(<:.c=.ho) -MT \$@ \\
- `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(HOSTCC_FLAGS) \$(FIRST_PREREQ) -o \$@
-# Dependencies for precompiled headers
-PCHDEPENDS = \$(CC) -M -MG -MT include/includes.h.gch -MT \$@ \\
- \$(CFLAGS) \$(FIRST_PREREQ) -o \$@
-
-# \$< is broken in older BSD versions:
-# when \$@ is foo/bar.o, \$< could be torture/foo/bar.c
-# if it also exists. So better use \$* which is foo/bar
-# and append .c manually to get foo/bar.c
-#
-# If we have GNU Make, it is safe to use \$<, which also lets
-# building with \$srcdir != \$builddir work.
-
-# Run a static analysis checker
-CHECK = \$(CC_CHECKER) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
-
-# Run the configured compiler
-COMPILE = \$(CC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
-
-# Run the compiler for the build host
-HCOMPILE = \$(HOSTCC) `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(HOSTCC_FLAGS) -c \$(FIRST_PREREQ) -o \$@
-
-# Precompile headers
-PCHCOMPILE = @\$(CC) -Ilib/replace \\
- `\$(PERL) \$(srcdir)/script/cflags.pl \$@` \\
- \$(CFLAGS) \$(PICFLAG) -c \$(FIRST_PREREQ) -o \$@
+FIRST_PREREQ = $self->{config}->{FIRST_PREREQ}
__EOD__
);
CPPFLAGS=$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -I\$(srcdir)/lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $self->{config}->{CPPFLAGS}
CC=$self->{config}->{CC}
-CFLAGS=$self->{config}->{CFLAGS} \$(CPPFLAGS)
+CFLAGS=$self->{config}->{CFLAGS}
+CFLAG_NO_UNUSED_MACROS=$self->{config}->{CFLAG_NO_UNUSED_MACROS}
PICFLAG=$self->{config}->{PICFLAG}
INSTALL_LINK_FLAGS=$extra_link_flags
SHLIBEXT=$self->{config}->{SHLIBEXT}
HOSTCC=$self->{config}->{HOSTCC}
-HOSTCC_FLAGS=-D_SAMBA_HOSTCC_ $self->{config}->{CFLAGS} \$(CPPFLAGS)
+HOSTCC_FLAGS=-D_SAMBA_HOSTCC_ \$(CFLAGS)
HOSTLD=$self->{config}->{HOSTLD}
HOSTLD_FLAGS=$self->{config}->{LDFLAGS}
XSLTPROC=$self->{config}->{XSLTPROC}
+LIB_PATH_VAR=$self->{config}->{LIB_PATH_VAR}
+
LEX=$self->{config}->{LEX}
YACC=$self->{config}->{YACC}
YAPP=$self->{config}->{YAPP}
push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
- if (defined($ctx->{INIT_FUNCTION})) {
+ if (defined($ctx->{INIT_FUNCTION}) and $ctx->{TYPE} ne "PYTHON") {
my $init_fn = $ctx->{INIT_FUNCTION_TYPE};
$init_fn =~ s/\(\*\)/init_module/;
my $proto_fn = $ctx->{INIT_FUNCTION_TYPE};
push (@{$self->{torture_progs}}, "$installdir/$ctx->{BINARY}");
}
-
push (@{$self->{binaries}}, "$localdir/$ctx->{BINARY}");
$self->_prepare_list($ctx, "OBJ_LIST");
my $target = "bin/python/".basename($_);
my $source = output::add_dir_str($ctx->{BASEDIR}, $_);
$self->output("$target: $source\n" .
+ "\tmkdir -p \$(builddir)/bin/python\n" .
"\tcp $source \$@\n\n");
- push (@{$self->{python_dsos}}, $target);
+ push (@{$self->{python_pys}}, $target);
}
}
push (@{$self->{manpages}}, $path);
}
-sub PkgConfig($$$)
-{
- my ($self,$ctx,$other) = @_;
-
- my $link_name = $ctx->{NAME};
-
- $link_name =~ s/^LIB//g;
- $link_name = lc($link_name);
-
- return if (not defined($ctx->{DESCRIPTION}));
-
- my $path = output::add_dir_str($ctx->{BASEDIR}, "$link_name.pc");
-
- push (@{$self->{pc_files}}, $path);
-
- my $pubs;
- my $privs;
- my $privlibs;
-
- if (defined($ctx->{PUBLIC_DEPENDENCIES})) {
- foreach (@{$ctx->{PUBLIC_DEPENDENCIES}}) {
- next if ($other->{$_}->{ENABLE} eq "NO");
- if ($other->{$_}->{TYPE} eq "LIBRARY") {
- s/^LIB//g;
- $_ = lc($_);
-
- $pubs .= "$_ ";
- } else {
- s/^LIB//g;
- $_ = lc($_);
-
- $privlibs .= "-l$_ ";
- }
- }
- }
-
- if (defined($ctx->{PRIVATE_DEPENDENCIES})) {
- foreach (@{$ctx->{PRIVATE_DEPENDENCIES}}) {
- next if ($other->{$_}->{ENABLE} eq "NO");
- if ($other->{$_}->{TYPE} eq "LIBRARY") {
- s/^LIB//g;
- $_ = lc($_);
-
- $privs .= "$_ ";
- } else {
- s/^LIB//g;
- $_ = lc($_);
-
- $privlibs .= "-l$_ ";
- }
- }
- }
-
- smb_build::env::PkgConfig($self,
- $path,
- $link_name,
- "-L\${libdir} -l$link_name",
- $privlibs,
- "",
- "$ctx->{VERSION}",
- $ctx->{DESCRIPTION},
- defined($ctx->{INIT_FUNCTIONS}),
- $pubs,
- "",
- [
- "prefix=$self->{config}->{prefix}",
- "exec_prefix=$self->{config}->{exec_prefix}",
- "libdir=$self->{config}->{libdir}",
- "includedir=$self->{config}->{includedir}"
- ]
- );
- my $abs_srcdir = abs_path($self->{config}->{srcdir});
- smb_build::env::PkgConfig($self,
- "bin/pkgconfig/$link_name-uninstalled.pc",
- $link_name,
- "-Lbin/shared -Lbin/static -l$link_name",
- $privlibs,
- join(' ',
- "-I$abs_srcdir",
- "-I$abs_srcdir/include",
- "-I$abs_srcdir/lib",
- "-I$abs_srcdir/lib/replace"),
- "$ctx->{VERSION}",
- $ctx->{DESCRIPTION},
- defined($ctx->{INIT_FUNCTIONS}),
- $pubs,
- $privs,
- [
- "prefix=bin/",
- "includedir=$ctx->{BASEDIR}"
- ]
- );
-}
-
sub ProtoHeader($$)
{
my ($self,$ctx) = @_;
$self->output("STATIC_LIBS = " . array2oneperline($self->{static_libs}) . "\n");
$self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n");
$self->output("PYTHON_DSOS = " . array2oneperline($self->{python_dsos}) . "\n");
+ $self->output("PYTHON_PYS = " . array2oneperline($self->{python_pys}) . "\n");
$self->output("INSTALLABLE_SHARED_LIBS = " . array2oneperline($self->{installable_shared_libs}) . "\n");
$self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n");
$self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");