~ubuntu-branches/ubuntu/saucy/openexr/saucy

« back to all changes in this revision

Viewing changes to openexr.m4

  • Committer: Bazaar Package Importer
  • Author(s): Adeodato Simó
  • Date: 2008-03-24 23:00:21 UTC
  • mfrom: (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080324230021-gnofz9mnvcj1xlv3
Tags: 1.6.1-3
Disable (hopefully temporarily) the test suite on arm and ia64.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
# PARTICULAR PURPOSE.
13
13
 
14
14
dnl
15
 
dnl OpenEXR
16
 
dnl
17
 
 
18
 
AC_DEFUN([AM_PATH_OPENEXR],
19
 
[dnl 
20
 
dnl Get the cflags and libraries
21
 
dnl
22
 
AC_ARG_WITH(openexr-prefix,[  --with-openexr-prefix=PFX   Prefix where libopenexr is installed (optional)], openexr_prefix="$withval", openexr_prefix="/usr")
23
 
AC_ARG_ENABLE(openexrtest, [  --disable-openexrtest       Do not try to compile and run a test Openexr program],, enable_openexrtest=yes)
24
 
 
25
 
  if test "x$openexr_prefix" != "xNONE" ; then
26
 
    openexr_args="$openexr_args --prefix=$openexr_prefix"
27
 
    OPENEXR_INCLUDES="-I$openexr_prefix/include/OpenEXR"
28
 
    OPENEXR_LIBS="-L$openexr_prefix/lib"
29
 
  elif test "$prefix" != ""; then
30
 
    openexr_args="$openexr_args --prefix=$prefix"
31
 
    OPENEXR_INCLUDES="-I$prefix/include/OpenEXR"
32
 
    OPENEXR_LIBS="-L$prefix/lib"
33
 
  fi
34
 
 
35
 
  OPENEXR_LIBS="$X_LIBS $OPENEXR_LIBS -lIlmImf -lImath -lIex -lHalf -lz"
36
 
 
37
 
  AC_MSG_CHECKING(for OpenEXR)
38
 
  no_openexr=""
39
 
 
40
 
 
41
 
  if test "x$enable_openexrtest" = "xyes" ; then
42
 
    ac_save_CXXFLAGS="$CXXFLAGS"
43
 
    ac_save_LIBS="$LIBS"
44
 
    CXXFLAGS="$CXXFLAGS $OPENEXR_CXXFLAGS $OPENEXR_INCLUDES"
45
 
    LIBS="$LIBS $OPENEXR_LIBS"
46
 
      rm -f conf.openexrtest
47
 
      AC_LANG_SAVE
48
 
      AC_LANG_CPLUSPLUS
49
 
      AC_TRY_RUN([
50
 
#include <stdlib.h>
51
 
#include <ImfRgbaFile.h>
52
 
 
53
 
int main ()
54
 
{
55
 
  try
56
 
  {
57
 
    Imf::RgbaInputFile exr ("");
58
 
  }
59
 
  catch (...)
60
 
  {
61
 
  }
62
 
  system("touch conf.openexrtest");
63
 
  return 0;
64
 
}
65
 
 
66
 
],, no_openexr=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
67
 
       AC_LANG_RESTORE
68
 
       CXXFLAGS="$ac_save_CXXFLAGS"
69
 
       LIBS="$ac_save_LIBS"
70
 
  fi
71
 
 
72
 
  if test "x$no_openexr" = "x" ; then
73
 
     AC_MSG_RESULT(yes)
74
 
     ifelse([$1], , :, [$1])     
75
 
  else
76
 
     AC_MSG_RESULT(no)
77
 
     if test -f conf.openexrtest ; then
78
 
       :
79
 
     else
80
 
       echo "*** Could not run OpenEXR test program, checking why..."
81
 
       CXXFLAGS="$CXXFLAGS $OPENEXR_CXXFLAGS $OPENEXR_INCLUDES"
82
 
       LIBS="$LIBS $OPENEXR_LIBS"
83
 
       AC_LANG_SAVE
84
 
       AC_LANG_CPLUSPLUS
85
 
       AC_TRY_LINK([
86
 
#include <stdio.h>
87
 
#include <ImfRgbaFile.h>
88
 
],     [ Imf::RgbaInputFile exr ("");return 0; ],
89
 
       [ echo "*** The test program compiled, but did not run. This usually means"
90
 
       echo "*** that the run-time linker is not finding OpenEXR or finding the wrong"
91
 
       echo "*** version of OpenEXR. If it is not finding OpenEXR, you'll need to set your"
92
 
       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
93
 
       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
94
 
       echo "*** is required on your system"
95
 
       echo "***"])
96
 
       AC_LANG_RESTORE
97
 
       CXXFLAGS="$ac_save_CXXFLAGS"
98
 
       LIBS="$ac_save_LIBS"
99
 
     fi
100
 
     OPENEXR_INCLUDES=""
101
 
     OPENEXR_LIBS=""
102
 
     ifelse([$2], , :, [$2])
103
 
  fi
104
 
  AC_SUBST(OPENEXR_INCLUDES)
105
 
  AC_SUBST(OPENEXR_LIBS)
106
 
  rm -f conf.openexrtest
107
 
])
 
15
dnl Note: to check whether openexr is properly installed, please 
 
16
dnl look at the m4 macro AM_COMPILELINKRUN and it's use to set 
 
17
dnl OPENEXR_CXXFLAGS and  OPENEXR_LDFLAGS in the OpenEXR_Viewers package
 
18
dnl
 
19