Fix compiler warning due to missing function prototype.
[svn.git] / subversion / bindings / swig / perl / native / Makefile.PL.in
blob50a42200d52acb7fe34811d8ed59c59f8fd4f016
1 #!/usr/bin/perl
2 use ExtUtils::MakeMaker;
3 use Config;
4 use Cwd 'abs_path';
6 my $perl_path = $Config{perlpath};
7 if ($^O ne 'VMS') {
8 $perl_path .= $Config{_exe} unless $perl_path =~ m/$Config{_exe}$/i;
11 my $top_builddir = '@top_builddir@';
12 my $top_srcdir = '@top_srcdir@';
13 my $svnlib_srcdir = "${top_srcdir}/subversion";
14 my $svnlib_builddir = "${top_builddir}/subversion";
15 my $swig_srcdir = "${svnlib_srcdir}/bindings/swig";
16 my $swig_builddir = "${svnlib_builddir}/bindings/swig";
18 my @modules = qw/client delta fs ra repos wc/;
19 my @ldpaths = ("$swig_builddir/perl/libsvn_swig_perl/.libs",
20 map {"$svnlib_builddir/libsvn_$_/.libs"} (@modules, qw/diff subr
21 ra_local
22 ra_svn
23 ra_neon
24 ra_serf
25 fs_base
26 fs_util
27 fs_fs/));
28 my @ldmodules = map {"-lsvn_$_-1"} (@modules, qw/diff subr/);
30 my $apr_shlib_path_var = '@SVN_APR_SHLIB_PATH_VAR@';
31 my $cppflags = '@CPPFLAGS@';
32 my $apr_cflags = '@SVN_APR_INCLUDES@';
33 my $apu_cflags = '@SVN_APRUTIL_INCLUDES@';
35 # According to the log of r7937, the flags guarded by the conditional break
36 # the build on FreeBSD if not conditionalized.
37 my $apr_ldflags = '@SVN_APR_EXPORT_LIBS@'
38 if $^O eq 'darwin' or $^O eq 'cygwin';
40 chomp $apr_shlib_path_var;
42 my %config = (
43 ABSTRACT => 'Perl bindings for Subversion',
44 DEFINE => $cppflags,
45 INC => join(' ',$apr_cflags, $apu_cflags,
46 " -I$swig_srcdir/perl/libsvn_swig_perl",
47 " -I$svnlib_srcdir/include",
48 " -I$svnlib_builddir",
49 " -I$swig_srcdir -g"),
50 OBJECT => q/$(O_FILES)/,
51 LIBS => [join(' ', $apr_ldflags,
52 (map {$_ = abs_path($_); "-L$_"} @ldpaths),
53 @ldmodules, '-lsvn_swig_perl-1',
54 `$swig -perl -ldflags`)],
55 test => { TESTS => "$swig_srcdir/perl/native/t/*.t" }
58 sub perlish {
59 local $_ = $_[0];
60 s/^(\w)/\U$1/;
61 $_;
64 WriteMakefile(%config, NAME => 'SVN::_Core', C => ['core.c'],
65 PM => {map { ("$swig_srcdir/perl/native/$_.pm" =>
66 "\$(INST_LIBDIR)/$_.pm") }
67 map { perlish $_ }
68 ('base', 'core', @modules)},
69 MAN3PODS => {map { ("$swig_srcdir/perl/native/$_.pm" =>
70 "\$(INST_MAN3DIR)/SVN::$_.\$(MAN3EXT)") }
71 map { perlish $_ }
72 ('base', 'core', @modules)},
73 clean => { FILES => "*.bs".
74 join(' Makefile.','',@modules) }
77 for (@modules) {
78 WriteMakefile(%config,
79 MAKEFILE=> "Makefile.$_",
80 NAME => "SVN::_".perlish($_),
81 C => ["svn_$_.c"],
85 # the dependencies need to be fixed
87 sub MY::postamble {
88 package MY ;
90 my $module_c_files = join (' ',map { "svn_$_.c"} @modules);
91 my $module_make_commands = join ('',map {"\t\$(MAKE) -f Makefile.$_\n"} @modules);
93 my $fullperlrun = "$apr_shlib_path_var=" . join(':',@ldpaths);
95 return <<"EOPOST";
96 all :: modules
97 test :: modules
98 install :: modules
100 par :: all
101 \t$perl_path -MPAR::Dist -e"blip_to_par(name=>'SVN",version=>'`$perl_path -Mblib -MSVN::Core -e 'print $SVN::Core::VERSION'`')"
103 modules :: $module_c_files
104 $module_make_commands\t\$(NOECHO) \$(TOUCH) \$\@
106 FULLPERLRUN=$fullperlrun \$(FULLPERL)
108 EOPOST