summary refs log tree commit diff stats
path: root/plugins/perl/meson.build
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2018-03-18 11:02:54 -0400
committerPatrick Griffis <tingping@tingping.se>2018-03-18 11:09:53 -0400
commit93f926bf1279f98a513aa081c1a06777bb336594 (patch)
tree194dfb0bc47283a9a2d1e2f39f0b633c2b0733fa /plugins/perl/meson.build
parentda56297c5ac0a425cd2eaaa8091dc83621ce3c38 (diff)
build: Re-add support for the legacy perl api
This was accidentally left behind, expose it beind an option as
with the old build system but default to false now. Enough time
has passed and only distros that care about it can enable it.
Diffstat (limited to 'plugins/perl/meson.build')
-rw-r--r--plugins/perl/meson.build17
1 files changed, 11 insertions, 6 deletions
diff --git a/plugins/perl/meson.build b/plugins/perl/meson.build
index 5e5d6d71..180797ee 100644
--- a/plugins/perl/meson.build
+++ b/plugins/perl/meson.build
@@ -13,11 +13,17 @@ hexchat_perl_module = custom_target('hexchat-perl-header',
   command: [generate_perl_header, '@OUTPUT@', '@INPUT@']
 )
 
-irc_perl_module = custom_target('irc-perl-header',
-  input: 'lib/IRC.pm',
-  output: 'irc.pm.h',
-  command: [generate_perl_header, '@OUTPUT@', '@INPUT@']
-)
+perl_cflags = []
+irc_perl_module = []
+
+if get_option('with-perl-legacy-api')
+  irc_perl_module = custom_target('irc-perl-header',
+    input: 'lib/IRC.pm',
+    output: 'irc.pm.h',
+    command: [generate_perl_header, '@OUTPUT@', '@INPUT@']
+  )
+  perl_cflags += '-DOLD_PERL'
+endif
 
 perl = find_program('perl')
 
@@ -25,7 +31,6 @@ ret = run_command([perl, '-MExtUtils::Embed', '-e', 'ccopts'])
 if ret.returncode() != 0
   error('perl: Failed to get cflags')
 endif
-perl_cflags = []
 foreach flag : ret.stdout().strip().split(' ')
   if flag.startswith('-I') or flag.startswith('-D')
     perl_cflags += flag