File: configure.ac

package info (click to toggle)
povray 1%3A3.7.0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 147,232 kB
  • sloc: cpp: 845,011; ansic: 122,118; sh: 34,204; pascal: 6,420; asm: 3,355; ada: 1,681; makefile: 1,389; cs: 879; awk: 590; perl: 245; xml: 95
file content (406 lines) | stat: -rw-r--r-- 11,717 bytes parent folder | download | duplicates (6)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
dnl Process this file with autoconf to produce a configure script.

AC_INIT(OpenEXR, 2.2.0)

AC_SUBST(OPENEXR_VERSION_MAJOR, 2)
AC_SUBST(OPENEXR_VERSION_MINOR, 2)
AC_SUBST(OPENEXR_VERSION_PATCH, 0)

AC_SUBST(OPENEXR_VERSION, ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH})
AC_SUBST(OPENEXR_VERSION_API, ${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})

AC_CANONICAL_HOST
AC_CONFIG_SRCDIR(IlmImfTest/main.cpp)
AC_CONFIG_HEADER(config/OpenEXRConfig.h)
AM_INIT_AUTOMAKE(1.6.3)  dnl Require automake 1.6.3 or better
AM_MAINTAINER_MODE


LIBTOOL_CURRENT=22
LIBTOOL_REVISION=0
LIBTOOL_AGE=0
LIBTOOL_VERSION=$LIBTOOL_CURRENT:$LIBTOOL_REVISION:$LIBTOOL_AGE
AC_SUBST(LIBTOOL_VERSION)

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET

dnl
dnl PKGCONFIG preparations
dnl

if test -z "${PKG_CONFIG_PATH}"; then
	PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
fi

LIB64_IF_EXISTS=""
if [[ -e /usr/lib64 ]]; then
   LIB64_IF_EXISTS="-L/usr/lib64"
fi         



export PKG_CONFIG_PATH

dnl
dnl get ccflags and libs from openexr packages, then check 
dnl whether test programs compile
AM_PATH_PKGCONFIG(
   [ILMBASE_CXXFLAGS],
   [ILMBASE_LDFLAGS],
   [ILMBASE_LIBS],
   [IlmBase],
   [OpenEXR],
   [$LIB64_IF_EXISTS -L/usr/local/lib],
   [-lImath -lHalf -lIex -lIlmThread -lpthread],
   [ilmbase-prefix])


dnl Define the version string
AC_DEFINE_UNQUOTED(OPENEXR_VERSION_STRING, "${VERSION}")
AC_DEFINE_UNQUOTED(OPENEXR_PACKAGE_STRING, "${PACKAGE_STRING}")
AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MAJOR, ${OPENEXR_VERSION_MAJOR})
AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MINOR, ${OPENEXR_VERSION_MINOR})
AC_DEFINE_UNQUOTED(OPENEXR_VERSION_PATCH, ${OPENEXR_VERSION_PATCH})


dnl --enable-threading
AC_ARG_ENABLE(threading,
              AC_HELP_STRING([--enable-threading],
                             [enable multi-threading [[default=yes]]]),
              [multithread="${enableval}"], [multithread=yes])

if test x$PKG_CONFIG == xno && test "x${multithread}" != xno ; then
    ACX_PTHREAD(
    [
	AC_DEFINE(OPENEXR_IMF_HAVE_PTHREAD)
	ILMBASE_LIBS="$PTHREAD_LIBS $ILMBASE_LIBS"
	ILMBASE_CXXFLAGS="$ILMBASE_CXXFLAGS $PTHREAD_CFLAGS"
	CC="$PTHREAD_CC"
	
	AM_POSIX_SEM()
    ],
    [AC_MSG_ERROR([POSIX thread support required])])
    AC_MSG_NOTICE([multithread true, LIBS = $LIBS, CC = $CC, CXXFLAGS = $CXXFLAGS])
fi

dnl --enable-large-stack
case "$host" in
*linux*)
  AC_ARG_ENABLE(large-stack,
		AC_HELP_STRING([--enable-large-stack],
			       [enable optimizations for systems that support
			       large stack sizes [[default=yes]]]),
		[large_stack="${enableval}"],
		[large_stack=yes])
  ;;
*)
  AC_ARG_ENABLE(large-stack,
		AC_HELP_STRING([--enable-large-stack],
			       [enable optimizations for systems that support
			       large stack sizes [[default=no]]]),
		[large_stack="${enableval}"],
		[large_stack=no])
  ;;
esac

if test "x${large_stack}" != xno ; then
    AC_DEFINE(OPENEXR_IMF_HAVE_LARGE_STACK)
fi

AM_COMPILELINKRUN(
   [IlmBase],
   [ilmbasetest],
   [$ILMBASE_CXXFLAGS],
   [$ILMBASE_LDFLAGS],
   [$ILMBASE_LIBS],[[
#include <stdlib.h>
#include <ImathFun.h>
]],
   [[double d = IMATH_NAMESPACE::succd(.23); d+= .2;]],
   AC_MSG_RESULT([Compiled and ran IlmBase test program.]), 
   AC_MSG_ERROR([Could not compile IlmBase test program.]))


dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

dnl Checks for zlib
AC_CHECK_LIB(z, compress,
             [:],
             [AC_MSG_ERROR([
*** OpenEXR requires a recent version of zlib, which you don't appear to
*** have.
***
*** This could be because the run-time linker is not finding zlib, or it
*** is finding the wrong version.  In this case, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the proper version.  Also, make sure you have run ldconfig if
*** that is required on your system.
			   ])]
)

dnl Checks for std::right etc. in iomanip
AC_MSG_CHECKING(for complete iomanip support in C++ standard library)
complete_iomanip="no"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iomanip>],[

	std::right;
],
AC_DEFINE(OPENEXR_IMF_HAVE_COMPLETE_IOMANIP) complete_iomanip=yes)
AC_MSG_RESULT($complete_iomanip)
AC_LANG_RESTORE


AC_MSG_CHECKING(for gcc optimization flags)
old_cflags=$CFLAGS
CFLAGS="$CFLAGS -pipe"
AC_TRY_COMPILE([#include <stdio.h>],
[ printf ("hello, world"); ],
[ EXTRA_OPT_CFLAGS="-pipe"],[ EXTRA_OPT_CFLAGS=""])
CFLAGS=$old_cflags
AC_MSG_RESULT([$EXTRA_OPT_CFLAGS])

dnl Check to see if the toolset supports AVX instructions in inline asm
AC_MSG_CHECKING(for AVX instructions in GCC style inline asm)
gcc_inline_asm_avx="no"
AC_COMPILE_IFELSE(
    [
        AC_LANG_PROGRAM([],
        [
             #if defined(__GNUC__) && defined(__SSE2__) 
                 int n   = 0;
                 int eax = 0;
                 int edx = 0;
                 __asm__(
                     "xgetbv     \n"
                     "vzeroupper  "
                     : "=a"(eax), "=d"(edx) : "c"(n) : );
             #else
                 #error No GCC style inline asm supported for AVX instructions
             #endif
        ]) 
   ],
   [
      gcc_inline_asm_avx="yes"
   ],
   [
      gcc_inline_asm_avx="no"
   ]
)
AC_MSG_RESULT([$gcc_inline_asm_avx])
if test "x${gcc_inline_asm_avx}" == xyes ; then
    AC_DEFINE(OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX)
fi

dnl Check if sysconf(_SC_NPROCESSORS_ONLN) can be used for CPU count
AC_MSG_CHECKING([for sysconf(_SC_NPROCESSORS_ONLN)])
sysconf_nproc="no"
AC_COMPILE_IFELSE(
   [
        AC_LANG_PROGRAM(
           [#include <unistd.h>],
           [sysconf(_SC_NPROCESSORS_ONLN);]
        )
   ],
   [sysconf_nproc="yes"],
   [sysconf_nproc="no"]
)
AC_MSG_RESULT([$sysconf_nproc])
if test "x${sysconf_nproc}" == xyes ; then
    AC_DEFINE(OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN)
fi

dnl Platform-specific stuff
case "$host" in
*linux*)
  AC_DEFINE(OPENEXR_IMF_HAVE_LINUX_PROCFS)
  ;;
*darwin*) 
  AC_DEFINE(OPENEXR_IMF_HAVE_DARWIN) 

  dnl OS X universal binary support, requires --disable-dependency-tracking
  AC_ARG_ENABLE(osx-universal-binaries,
	      AC_HELP_STRING([--enable-osx-universal-binaries],
			     [build universal binaries on OS X [[default=no]]]),
	      [build_osxuniversal="${enableval}"], [build_osxuniversal=no])

  if test "${build_osxuniversal}" != no ; then
    if test "$enable_dependency_tracking" != no ; then
      AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
Please re-run configure with these options:
  --disable-dependency-tracking --enable-osx-universal-binary
  		  ])
    fi
    CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
    dnl LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
  fi

  ;;
esac

AM_CFLAGS="$EXTRA_OPT_CFLAGS"
AM_CXXFLAGS="$EXTRA_OPT_CFLAGS"

AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CXXFLAGS)

dnl build imfexamples example program?
build_imfexamples="no"
AC_ARG_ENABLE(imfexamples,
	      AC_HELP_STRING([--enable-imfexamples],
			     [build IlmImf example program [[default=no]]]),
	      [build_imfexamples="${enableval}"], [build_imfexamples=no])

AM_CONDITIONAL(BUILD_IMFEXAMPLES, test "x$build_imfexamples" = xyes)

dnl build imffuzztest?
build_imffuzztest="no"
AC_ARG_ENABLE(imffuzztest,
	  AC_HELP_STRING([--enable-imffuzztest],
		 [build IlmImf damaged input resilience test [[default=no]]]),
	  [build_imffuzztest="${enableval}"], [build_imffuzztest=no])

AM_CONDITIONAL(BUILD_IMFFUZZTEST, test "x$build_imffuzztest" = xyes)

dnl build imfhugetest?
build_imfhugetest="no"
AC_ARG_ENABLE(imfhugetest,
	  AC_HELP_STRING([--enable-imfhugetest],
		 [build IlmImf huge input resilience test [[default=no]]]),
	  [build_imfhugetest="${enableval}"], [build_imfhugetest=no])

AM_CONDITIONAL(BUILD_IMFHUGETEST, test "x$build_imfhugetest" = xyes)

if test "x${build_imfhugetest}" != xno ; then
    AC_DEFINE(OPENEXR_IMF_HUGETEST)
fi


dnl
dnl Handle namespacing configuration : internal library namespace
dnl                                    user-client namespace 
dnl
library_namespace_versioning="yes"
AC_ARG_ENABLE(namespaceversioning,
          AC_HELP_STRING([--enable-namespaceversioning],
                         [enable symbol versioning via versioned/custom namespace to prevent runtime conflicts <no/yes/custom> [[default=yes]]] ),
          [library_namespace_versioning="${enableval}"], 
          [library_namespace_versioning=yes])
              
dnl Suffix for the shared library via the '-release' option
LIB_SUFFIX=""
lib_suffix_valid="no"

lib_namespace="Imf"
if test "x${library_namespace_versioning}" == xyes ; then
    AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, Imf_${OPENEXR_VERSION_API})
    AC_DEFINE(OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM)

    lib_namespace="Imf_${OPENEXR_VERSION_API}"
    LIB_SUFFIX="${OPENEXR_VERSION_API}"
    lib_suffix_valid="yes"
elif test "x${library_namespace_versioning}" == xno ; then
    AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, Imf)

    lib_namespace="Imf"
else
    AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, ${library_namespace_versioning} )
    AC_DEFINE(OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM)

    lib_namespace="${library_namespace_versioning}"
    LIB_SUFFIX="${library_namespace_versioning}"
    lib_suffix_valid="yes"
fi
AC_SUBST(LIB_SUFFIX)

if test "x${lib_suffix_valid}" == xyes ; then
AC_SUBST(LIB_SUFFIX_DASH,"-${LIB_SUFFIX}")
AM_CONDITIONAL(LIB_SUFFIX_EXISTS,true)
else
AC_SUBST(LIB_SUFFIX_DASH,"")
AM_CONDITIONAL(LIB_SUFFIX_EXISTS,false)
fi


dnl
dnl User namespace 
dnl 
custom_usr_namespace="no"
usr_namespace="Imf"
AC_ARG_ENABLE(customusernamespace,
        AC_HELP_STRING([--enable-customusernamespace],
                       [user namespace; this is the namespace into which the library namespace will be exported to <no/custom> [[default=Imf]]] ),
        [custom_usr_namespace="${enableval}"], 
        [custom_usr_namespace=no])

if test "x${custom_usr_namespace}" == xyes ; then
    AC_MSG_WARN([Enabling 'custom user namespace' requires an additional argument, reverting to 'Imf'])
    AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, Imf)
    usr_namespace="Imf"
elif test "x${custom_usr_namespace}" == xno ; then
    AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, Imf)
    usr_namespace="Imf"
else
    AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, ${custom_usr_namespace})
    AC_DEFINE(OPENEXR_IMF_NAMESPACE_CUSTOM)
    
    usr_namespace=${custom_usr_namespace}
fi



AC_OUTPUT([
Makefile
OpenEXR.pc
config/Makefile
IlmImf/Makefile
IlmImfTest/Makefile
IlmImfUtil/Makefile
IlmImfUtilTest/Makefile
IlmImfFuzzTest/Makefile
exrheader/Makefile
exrmaketiled/Makefile
IlmImfExamples/Makefile
doc/Makefile
exrstdattr/Makefile
exrmakepreview/Makefile
exrenvmap/Makefile
exrmultiview/Makefile
exrmultipart/Makefile
])

AC_MSG_RESULT([
---------------------------------------------
Summary for OpenEXR features:

build IlmImf example program                    $build_imfexamples
build IlmImf damaged input resilience test      $build_imffuzztest
build IlmImf huge input test                    $build_imfhugetest
enable large stack optimizations                $large_stack
internal library namespace                      $lib_namespace
user-client namespace                           $usr_namespace])

if test "x$build_osxuniversal" == xyes; then
AC_MSG_RESULT([
build OS X universal binaries                   $build_osxuniversal])
fi

AC_MSG_RESULT([
---------------------------------------------
])