]> eyrie.org Git - kerberos/perl-kerberos.git/commitdiff
Get Heimdal compiler flags using pkg-config
authorRuss Allbery <eagle@eyrie.org>
Fri, 28 Feb 2014 04:36:00 +0000 (20:36 -0800)
committerRuss Allbery <eagle@eyrie.org>
Fri, 28 Feb 2014 04:36:00 +0000 (20:36 -0800)
For right now, until we support a wider range of Kerberos libraries,
get the Heimdal compiler flags using pkg-config.  This will let the
package build properly on a Debian system with heimdal-multidev but
not heimdal-dev.

Build.PL

index 678d0c1bf7559507b4e29408eda627597130c498..f2f61576e5f9f0803909cad8f092d32cbb0df086 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -29,8 +29,14 @@ use autodie;
 use strict;
 use warnings;
 
+use IPC::System::Simple qw(capturex);
 use Module::Build;
 
+# Get the compiler and linker flags for Heimdal.  Currently, a new enough
+# Heimdal to support pkg-config is required.
+my $compiler_flags = capturex('pkg-config', '--cflags', 'heimdal-kadm-server');
+my $linker_flags   = capturex('pkg-config', '--libs',   'heimdal-kadm-server');
+
 # Basic package configuration.
 my $build = Module::Build->new(
     module_name          => 'Authen::Kerberos',
@@ -41,13 +47,15 @@ my $build = Module::Build->new(
     recursive_test_files => 1,
 
     # XS configuration.
-    extra_linker_flags => ['-lkadm5srv'],
+    extra_compiler_flags => [split(q{ }, $compiler_flags)],
+    extra_linker_flags   => [split(q{ }, $linker_flags)],
 
     # Other package relationships.
     configure_requires => {
-        'Module::Build' => '0.28',
-        autodie         => 0,
-        perl            => '5.010',
+        'IPC::System::Simple' => 0,
+        'Module::Build'       => '0.28',
+        autodie               => 0,
+        perl                  => '5.010',
     },
     requires => {
         autodie => 0,