~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_with_perl.m4

  • Committer: Brian Aker
  • Date: 2009-08-18 07:20:29 UTC
  • mfrom: (1117.1.9 merge)
  • Revision ID: brian@gaz-20090818072029-s9ch5lcmltxwidn7
Merge of Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
dnl   
4
4
dnl pandora-build: A pedantic build system
5
5
dnl Copyright (C) 2009 Sun Microsystems, Inc.
6
 
dnl This file is free software; Sun Microsystems
 
6
dnl This file is free software; the Free Software Foundation
7
7
dnl gives unlimited permission to copy and/or distribute it,
8
8
dnl with or without modifications, as long as this notice is preserved.
9
9
dnl
18
18
    [with_perl=$withval], 
19
19
    [with_perl=yes])
20
20
 
21
 
  AC_ARG_WITH([perl-arch],
22
 
    [AS_HELP_STRING([--with-perl-arch],
23
 
      [Install Perl bindings into system location @<:@default=no@:>@])],
24
 
    [with_perl_arch=$withval],
25
 
    [with_perl_arch=no])
26
21
 
27
22
  AS_IF([test "x$with_perl" != "xno"],[
28
23
    AS_IF([test "x$with_perl" != "xyes"],
30
25
      [ac_chk_perl=perl])
31
26
    AC_CHECK_PROGS(PERL,$ac_chk_perl)
32
27
  ])
33
 
  AS_IF([test "x$PERL" != "x"],[
34
 
    AC_CACHE_CHECK([for Perl include path],[pandora_cv_perl_include],[
35
 
      pandora_cv_perl_include=`$PERL -MConfig -e 'print $Config{archlib};'`
36
 
      pandora_cv_perl_include="${pandora_cv_perl_include}/CORE"
37
 
    ])
38
 
    AC_CACHE_CHECK([for Perl CPPFLAGS],[pandora_cv_perl_cppflags],[
39
 
      pandora_cv_perl_cppflags=`$PERL -MConfig -e 'print $Config{cppflags};'`
40
 
      pandora_cv_perl_cppflags="${pandora_cv_perl_cppflags}"
41
 
    ])
42
 
    PERL_CPPFLAGS="-I${pandora_cv_perl_include} ${pandora_cv_perl_cppflags}"
43
 
 
44
 
    AC_CACHE_CHECK([for Perl development headers],
45
 
      [pandora_cv_perl_dev],[
46
 
        
47
 
        save_CPPFLAGS="${CPPFLAGS}"
48
 
        CPPFLAGS="${CPPFLAGS} ${PERL_CPPFLAGS}"
49
 
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
50
 
#include <math.h>
51
 
#include <stdlib.h>
52
 
#include "EXTERN.h"
53
 
#include "perl.h"
54
 
#include "XSUB.h"
55
 
        ]])],
56
 
        [pandora_cv_perl_dev=yes],
57
 
        [pandora_cv_perl_dev=no])
58
 
        CPPFLAGS="${save_CPPFLAGS}"
59
 
      ])
60
 
 
61
 
    AS_IF([test "${pandora_cv_perl_dev}" = "no"],
62
 
      [with_perl=no])
63
 
 
64
 
    AC_CACHE_CHECK([for Perl install location],
65
 
      [pandora_cv_perl_archdir],[
66
 
        AS_IF([test "${with_perl_arch}" = "no"],[
67
 
          pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{sitearch}'`
68
 
        ],[
69
 
          pandora_cv_perl_archdir=`$PERL -MConfig -e 'print $Config{archlib}'`
70
 
        ])
71
 
        pandora_cv_perl_archdir="${pandora_cv_perl_archdir}"
72
 
    ])
73
 
 
74
 
    PERL_ARCHDIR="${pandora_cv_perl_archdir}"
75
 
  ])
76
 
  AC_SUBST([PERL_CPPFLAGS])
77
 
  AC_SUBST([PERL_ARCHDIR])
78
 
 
79
 
  AM_CONDITIONAL(BUILD_PERL, [test "$with_perl" != "no"])
 
28
 
 
29
  AM_CONDITIONAL(BUILD_PERL, [test "$with_perl" = "yes"])
 
30
 
 
31
dnl Don't think we need these anymore, but it's a good reference
 
32
dnl if test "x$PERL" != "x"; then
 
33
dnl  PERLCCFLAGS=`$PERL -MConfig -e 'print $Config{ccflags};'`
 
34
dnl  PERLCPPFLAGS=`$PERL -MConfig -e 'print $Config{cppflags};'`
 
35
dnl  PERLLIBS=`$PERL -MConfig -e 'print $Config{perllibs};'`
 
36
dnl fi 
80
37
 
81
38
])