Skip to content

Commit

Permalink
Autoconf detection of Perl5 and Perl5 modules
Browse files Browse the repository at this point in the history
Add m4 macros for checking for perl modules (JSON)

Fix #74, #29.

Signed-off-by: Nico Williams <nico@twosigma.com>
  • Loading branch information
riton authored and nicowilliams committed Nov 10, 2016
1 parent 7b6bf87 commit 298ee93
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
21 changes: 21 additions & 0 deletions cf/krb-prog-perl.m4
@@ -0,0 +1,21 @@
dnl
dnl perl and some of its module are required to build some headers
dnl

AC_DEFUN([AC_KRB_PROG_PERL],
[AC_CHECK_PROGS(PERL, perl, perl)
if test "$PERL" = ""; then
AC_MSG_ERROR([perl not found - Cannot build Heimdal without perl])
fi
])

AC_DEFUN([AC_KRB_PERL_MOD],
[
AC_MSG_CHECKING([for Perl5 module $1])
if ! $PERL -M$1 -e 'exit(0);' >/dev/null 2>&1; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([perl module $1 not found - Cannot build Heimdal without perl module $1])
else
AC_MSG_RESULT([yes])
fi
])
12 changes: 11 additions & 1 deletion configure.ac
Expand Up @@ -45,6 +45,17 @@ AC_DEFINE([_GNU_SOURCE], 1,
AC_OBJEXT
AC_EXEEXT

dnl
dnl this is needed when der-protos.h or der-private.h has to be generated
dnl
if ! test -f "$srcdir/lib/asn1/der-protos.h" ||
! test -f "$srcdir/lib/asn1/der-private.h"; then
AC_KRB_PROG_PERL
AC_KRB_PERL_MOD(Getopt::Std)
AC_KRB_PERL_MOD(File::Compare)
AC_KRB_PERL_MOD(JSON)
fi

dnl AC_KRB_PROG_YACC
AC_PROG_YACC
AM_PROG_LEX
Expand Down Expand Up @@ -100,7 +111,6 @@ AC_SUBST([ASN1_COMPILE_DEP])
AC_SUBST([SLC])
AC_SUBST([SLC_DEP])


dnl ---

AC_DEFINE(HEIM_WEAK_CRYPTO, 1, [Define if you want support for weak crypto])
Expand Down

0 comments on commit 298ee93

Please sign in to comment.