-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathacinclude.m4
127 lines (108 loc) · 3.86 KB
/
acinclude.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
# rsr: renaming this to acinclude.m4 fixed problem finding AM_PATH_OPENEXR definition 4/11/03
dnl AM_PROG_LEX
dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
AC_DEFUN(AM_PROG_LEX,
[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
AC_PROG_LEX
AC_DECL_YYTEXT])
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
dnl
dnl OpenEXR
dnl
AC_DEFUN(AM_PATH_OPENEXR,
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(openexr-prefix,[ --with-openexr-prefix=PFX Prefix where libopenexr is installed (optional)], openexr_prefix="$withval", openexr_prefix="")
AC_ARG_ENABLE(openexrtest, [ --disable-openexrtest Do not try to compile and run a test Openexr program],, enable_openexrtest=yes)
if test "x$openexr_prefix" != "xNONE" ; then
openexr_args="$openexr_args --prefix=$openexr_prefix"
OPENEXR_INCLUDES="-I$openexr_prefix/include/OpenEXR"
OPENEXR_LIBS="-L$openexr_prefix/lib"
elif test "$prefix" != ""; then
openexr_args="$openexr_args --prefix=$prefix"
OPENEXR_INCLUDES="-I$prefix/include/OpenEXR"
OPENEXR_LIBS="-L$prefix/lib"
fi
OPENEXR_LIBS="$X_LIBS $OPENEXR_LIBS -lIlmImf -lImath -lIex -lHalf -lz"
AC_MSG_CHECKING(for OpenEXR)
no_openexr=""
if test "x$enable_openexrtest" = "xyes" ; then
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CXXFLAGS="$CXXFLAGS $OPENEXR_CXXFLAGS $OPENEXR_INCLUDES $OPENEXR_LIBS"
LIBS="$LIBS $OPENEXR_LIBS"
rm -f conf.openexrtest
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#include <stdlib.h>
#include <ImfRgbaFile.h>
#include <stdio.h>
int main ()
{ printf("running openexrtest program... ");
try
{
Imf::RgbaInputFile exr ("");
}
catch (...)
{
}
system("touch conf.openexrtest");
return 0;
}
],, no_openexr=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_openexr" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.openexrtest ; then
:
else
echo "*** Could not run OpenEXR test program, checking why..."
CXXFLAGS="$CXXFLAGS $OPENEXR_CXXFLAGS $OPENEXR_INCLUDES $OPENEXR_LIBS"
LIBS="$LIBS $OPENEXR_LIBS"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_LINK([
#include <stdio.h>
#include <ImfRgbaFile.h>
], [ Imf::RgbaInputFile exr ("");return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding OpenEXR or finding the wrong"
echo "*** version of OpenEXR. If it is not finding OpenEXR, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "*** LD_LIBRARY_PATH = "
printenv LD_LIBRARY_PATH
echo "*** OPENEXR_LIBS = $OPENEXR_LIBS"
echo "*** OPENEXR_INCLUDES = $OPENEXR_INCLUDES"
echo "***"])
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
OPENEXR_INCLUDES=""
OPENEXR_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OPENEXR_INCLUDES)
AC_SUBST(OPENEXR_LIBS)
rm -f conf.openexrtest
])