[Libosinfo] [PATCH v3] Improve Perl-related routines

Roman Bogorodskiy bogorodskiy at gmail.com
Thu Feb 16 14:40:58 UTC 2017


 * Add a check for the 'perl' program to configure.ac as
   $(PERL) is used in various places
 * Do not hardcode '/usr/bin/perl' in perl scripts
   because on FreeBSD and maybe some other systems it's installed
   in a different prefix, so use '/usr/bin/env perl' instead.
---
 build-aux/bracket-spacing.pl | 2 +-
 configure.ac                 | 4 ++++
 osinfo/check-symfile.pl      | 2 +-
 osinfo/check-symsorting.pl   | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/build-aux/bracket-spacing.pl b/build-aux/bracket-spacing.pl
index e4ae8f0..655dac0 100755
--- a/build-aux/bracket-spacing.pl
+++ b/build-aux/bracket-spacing.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # bracket-spacing.pl: Report any usage of 'function (..args..)'
 # Also check for other syntax issues, such as correct use of ';'
diff --git a/configure.ac b/configure.ac
index 7f29df8..eb37f41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,6 +160,10 @@ case $host in
 esac
 AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
 
+AC_PATH_PROG([PERL], [perl])
+if test -z "$PERL"; then
+  AC_MSG_ERROR([Failed to find perl.])
+fi
 
 GOBJECT_INTROSPECTION_CHECK([0.9.7])
 
diff --git a/osinfo/check-symfile.pl b/osinfo/check-symfile.pl
index d59a213..4f88300 100755
--- a/osinfo/check-symfile.pl
+++ b/osinfo/check-symfile.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # Copyright (C) 2012-2013 Red Hat, Inc.
 #
diff --git a/osinfo/check-symsorting.pl b/osinfo/check-symsorting.pl
index 470247c..cc7b8d6 100755
--- a/osinfo/check-symsorting.pl
+++ b/osinfo/check-symsorting.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # Copyright (C) 2012-2013 Red Hat, Inc.
 #
-- 
2.11.0




More information about the Libosinfo mailing list