Automatically write AC_SUBST() vars to mkconfig.mk and use them.
[ira/wip.git] / source / build / smb_build / makefile.pm
index dfa7387c753d6a1b99c4cb87b130f1ea1994da91..c28229c23b1787b558aa6853244741addd53e940 100644 (file)
@@ -50,8 +50,6 @@ sub new($$$)
 
        $self->output("default: all\n\n");
 
-       $self->_prepare_path_vars();
-       $self->_prepare_suffix_rules();
        $self->_prepare_compiler_linker();
 
        if (!$self->{automatic_deps}) {
@@ -69,57 +67,6 @@ sub output($$)
        $self->{output} .= $text;
 }
 
-sub _prepare_path_vars($)
-{
-       my ($self) = @_;
-
-       $self->output(<< "__EOD__"
-prefix = $self->{config}->{prefix}
-exec_prefix = $self->{config}->{exec_prefix}
-selftest_prefix = $self->{config}->{selftest_prefix}
-
-builddir = $self->{config}->{builddir}
-srcdir = $self->{config}->{srcdir}
-datarootdir = $self->{config}->{datarootdir}
-
-VPATH = \$(builddir):\$(srcdir):heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des
-
-BASEDIR = $self->{config}->{prefix}
-BINDIR = $self->{config}->{bindir}
-SBINDIR = $self->{config}->{sbindir}
-LIBDIR = $self->{config}->{libdir}
-TORTUREDIR = $self->{config}->{libdir}/torture
-MODULESDIR = $self->{config}->{modulesdir}
-INCLUDEDIR = $self->{config}->{includedir}
-CONFIGDIR = $self->{config}->{sysconfdir}
-DATADIR = $self->{config}->{datadir}
-SWATDIR = \$(DATADIR)/swat
-JSDIR = \$(DATADIR)/js
-SETUPDIR = \$(DATADIR)/setup
-VARDIR = $self->{config}->{localstatedir}
-LOGFILEBASE = $self->{config}->{logfilebase}
-NCALRPCDIR = $self->{config}->{localstatedir}/ncalrpc
-LOCKDIR = $self->{config}->{lockdir}
-PIDDIR = $self->{config}->{piddir}
-MANDIR = $self->{config}->{mandir}
-PRIVATEDIR = $self->{config}->{privatedir}
-WINBINDD_SOCKET_DIR = $self->{config}->{winbindd_socket_dir}
-
-__EOD__
-);
-}
-
-sub _prepare_suffix_rules($)
-{
-       my ($self) = @_;
-
-       $self->output(<< "__EOD__"
-FIRST_PREREQ = $self->{config}->{FIRST_PREREQ}
-
-__EOD__
-);
-}
-
 sub _prepare_compiler_linker($)
 {
        my ($self) = @_;
@@ -140,54 +87,22 @@ sub _prepare_compiler_linker($)
        }
 
        $self->output(<< "__EOD__"
-SHELL=$self->{config}->{SHELL}
 
-PERL=$self->{config}->{PERL}
-PYTHON=$self->{config}->{PYTHON}
-SWIG=$self->{config}->{SWIG}
-
-CPP=$self->{config}->{CPP}
 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}
-CFLAG_NO_UNUSED_MACROS=$self->{config}->{CFLAG_NO_UNUSED_MACROS}
-PICFLAG=$self->{config}->{PICFLAG}
-
 INSTALL_LINK_FLAGS=$extra_link_flags
 
 BNLD=$self->{config}->{LD} 
 BNLD_FLAGS=$self->{config}->{LDFLAGS} -L$libdir
 
-STLD=$self->{config}->{STLD}
-STLD_FLAGS=$self->{config}->{STLD_FLAGS}
-
-SHLD=$self->{config}->{SHLD}
 SHLD_FLAGS=$self->{config}->{SHLD_FLAGS} -L\$(builddir)/bin/shared
 
-MDLD=$self->{config}->{MDLD}
 MDLD_FLAGS=$self->{config}->{MDLD_FLAGS} -L\$(builddir)/bin/shared
 
-SHLIBEXT=$self->{config}->{SHLIBEXT}
-
-HOSTCC=$self->{config}->{HOSTCC}
 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}
-
-GCOV=$self->{config}->{GCOV}
-
-DEFAULT_TEST_OPTIONS=$self->{config}->{DEFAULT_TEST_OPTIONS}
-
 __EOD__
 );
 }
@@ -281,16 +196,16 @@ sub SharedModule($$)
        } else {
                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)/$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";
+               $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)/$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";
+                               $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";
                        }
                }
        }