diff options
Diffstat (limited to 'source4/build/smb_build/makefile.pm')
-rw-r--r-- | source4/build/smb_build/makefile.pm | 40 |
1 files changed, 22 insertions, 18 deletions
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"; } } } |