3 m4_esyscmd_s([sed -e 's/.* \(.*\)/\1/' VAPOURSYNTH_VERSION]),
4 [https://github.com/vapoursynth/vapoursynth/issues],
6 [http://www.vapoursynth.com/]
12 AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects no-define])
13 AM_SILENT_RULES([yes])
20 AC_CONFIG_MACRO_DIRS([m4])
27 AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable compilation options required for debugging. (default=no)]))
29 [test "x$enable_debug" = "xyes"],
31 AC_DEFINE([VS_CORE_DEBUG])
32 AC_SUBST([DEBUGCFLAGS], ["-O0 -g3 -ggdb -ftrapv"])
41 AC_ARG_ENABLE([guard-pattern], AS_HELP_STRING([--enable-guard-pattern], [Adds 32 bytes on the left and the right sides of each frame, fills them with a certain value, and checks their integrity after each filter. It can be used to detect buggy filters that write a little outside the frame.]))
43 [test "x$enable_guard_pattern" = "xyes"],
45 AC_DEFINE([VS_FRAME_GUARD])
53 AS_HELP_STRING([--with-plugindir], [The default value for the configuration option 'SystemPluginDir' in vapoursynth.conf. (default=LIBDIR/vapoursynth)]),
54 [PLUGINDIR=$with_plugindir],
55 [PLUGINDIR=$libdir/$PACKAGE_NAME]
57 dnl Can't do it with AC_DEFINE because $libdir wouldn't be expanded fully.
71 [i?86], [BITS="32" X86="true"],
72 [x86_64], [BITS="64" X86="true"],
73 [powerpc*], [PPC="true"],
74 [arm*], [ARM="true"], # Maybe doesn't work for all arm systems?
75 [aarch64*], [ARM="true"]
82 AC_DEFINE([VS_TARGET_OS_DARWIN])
83 AC_SUBST([UNDEFINEDLDFLAGS], ["-Wl,-undefined,error"])
85 [*linux*|gnu*|dragonfly*|*bsd*], # The BSDs are close enough, right?
87 AC_DEFINE([VS_TARGET_OS_LINUX])
88 AC_SUBST([UNDEFINEDLDFLAGS], ["-Wl,--no-undefined"])
93 [test "x$BITS" = "x32"],
95 AC_SUBST([PLUGINLDFLAGS], ["-Wl,--kill-at"])
96 AC_SUBST([STACKREALIGN], ["-mstackrealign"])
99 AC_DEFINE([VS_TARGET_OS_WINDOWS])
100 AC_SUBST([UNICODECFLAGS], ["-DUNICODE -D_UNICODE"])
101 AC_SUBST([UNICODELDFLAGS], ["-municode"])
103 [AC_MSG_ERROR([Unknown host OS])]
107 [test "x$X86" = "xtrue"],
109 AC_ARG_ENABLE([x86-asm], AS_HELP_STRING([--enable-x86-asm], [Enable assembler code for x86 CPUs. (default=yes)]))
112 [test "x$enable_x86_asm" != "xno"],
114 AC_DEFINE([VS_TARGET_CPU_X86])
118 AC_SUBST([MFLAGS], ["-mfpmath=sse -msse2"])
119 AC_SUBST([AVX2FLAGS], ["-mavx2 -mfma -mtune=haswell"])
124 [test "x$PPC" = "xtrue"],
125 [AC_DEFINE([VS_TARGET_CPU_POWERPC])]
129 [test "x$ARM" = "xtrue"],
130 [AC_DEFINE([VS_TARGET_CPU_ARM])]
135 AC_ARG_ENABLE([core], AS_HELP_STRING([--enable-core], [Build the VapourSynth core library. (default=yes)]))
137 [test "x$enable_core" != "xno"],
139 AC_DEFINE([VS_CORE_EXPORTS])
140 AC_DEFINE([VS_USE_LATEST_API])
141 AC_DEFINE([VS_GRAPH_API])
143 PKG_CHECK_MODULES([ZIMG], [zimg >= 3.0.5])
146 saved_cppflags="$CPPFLAGS"
148 CPPFLAGS="$ZIMG_CFLAGS"
155 #if ZIMG_API_VERSION < ZIMG_MAKE_API_VERSION(2, 4)
156 #error zimg API v2.4 or greater required
160 unsigned major, minor, micro;
161 zimg_get_version_info(&major, &minor, µ);
165 [AC_MSG_ERROR([failed to link zimg. See config.log for details.])]
169 CPPFLAGS="$saved_cppflags"
174 AC_CONFIG_FILES([pc/vapoursynth.pc])
183 AC_SEARCH_LIBS([dlopen], [dl dld], [], [AC_MSG_ERROR([Unable to find the dlopen() function.])])
185 [test "x$ac_cv_search_dlopen" != "xnone required"],
186 [AC_SUBST([DLOPENLIB], ["$ac_cv_search_dlopen"])]
193 AC_MSG_CHECKING([for sched_getaffinity])
202 sched_getaffinity(0, sizeof(cpu_set_t), &affinity);
203 int count = CPU_COUNT(&affinity);
207 AC_DEFINE([HAVE_SCHED_GETAFFINITY])
210 [AC_MSG_RESULT([no])]
215 AC_MSG_CHECKING([for cpuset_getaffinity])
219 #include <sys/param.h>
220 #include <sys/_cpuset.h>
221 #include <sys/cpuset.h>
225 cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &affinity);
226 int count = CPU_COUNT(&affinity);
230 AC_DEFINE([HAVE_CPUSET_GETAFFINITY])
233 [AC_MSG_RESULT([no])]
238 AM_CONDITIONAL([VSCORE], [test "x$enable_core" != "xno"])
239 AM_CONDITIONAL([X86ASM], [test "x$X86" = "xtrue" -a "x$enable_x86_asm" != "xno"])
243 AC_ARG_ENABLE([vsscript], AS_HELP_STRING([--enable-vsscript], [Enable VSScript. Requires Python 3. (default=yes)]))
245 [test "x$enable_vsscript" != "xno"],
249 PKG_CHECK_MODULES([PYTHON3],
250 [python-$PYTHON_VERSION-embed],
253 PKG_CHECK_MODULES([PYTHON3],
254 [python-$PYTHON_VERSION])
257 AC_CONFIG_FILES([pc/vapoursynth-script.pc])
260 AM_CONDITIONAL([VSSCRIPT], [test "x$enable_vsscript" != "xno"])
264 AC_ARG_ENABLE([vspipe], AS_HELP_STRING([--enable-vspipe], [Build vspipe. Requires VSScript. (default=yes)]))
266 [test "x$enable_vsscript" = "xno"],
268 AC_DEFINE([VS_GRAPH_API])
270 [test "x$enable_vspipe" = "xyes"],
271 [AC_MSG_ERROR([Cannot build vspipe when VSScript is disabled.])],
276 AM_CONDITIONAL([VSPIPE], [test "x$enable_vspipe" != "xno"])
280 AC_ARG_ENABLE([python-module], AS_HELP_STRING([--enable-python-module], [Build the Python module. Requires Cython, Python, and the core. (default=yes)]))
282 [test "x$enable_core" = "xno"],
285 [test "x$enable_python_module" = "xyes"],
286 [AC_MSG_ERROR([Cannot build the Python module when the core is disabled.])],
287 [enable_python_module="no"]
292 [test "x$enable_python_module" != "xno"],
294 AC_ARG_WITH([cython], AS_HELP_STRING([--with-cython], [Override the automatic detection of the Cython executable. (default=check)]), [], [with_cython=check])
296 [test "x$with_cython" = "xcheck"],
297 [AC_CHECK_PROGS([CYTHON], [cython3 cython])],
298 [CYTHON="$with_cython"]
302 [test "x$CYTHON" = "x"],
303 [AC_MSG_ERROR([Cython required but not found.])]
308 [test -z "$PYTHON_VERSION"],
309 [AM_PATH_PYTHON([3])]
313 [test -z "$PYTHON3_LIBS"],
315 PKG_CHECK_MODULES([PYTHON3],
316 [python-$PYTHON_VERSION-embed],
319 PKG_CHECK_MODULES([PYTHON3],
320 [python-$PYTHON_VERSION])
329 AC_SUBST([PYTHON_MODULE_UNDEFINED], ["-undefined dynamic_lookup"])
333 AC_SUBST([PYTHON_MODULE_UNDEFINED], ["-no-undefined"])
334 AC_SUBST([MAYBE_PYTHON3_LIBS], ["$PYTHON3_LIBS"])
341 AM_CONDITIONAL([PYTHONMODULE], [test "x$enable_python_module" != "xno"])
345 dnl Workaround for a bug in libtool
346 dnl The windows libtool uses a file magic checking method that only accepts
347 dnl dynamic libraries. Change it for libtool's alternative checking method.
349 dnl Workaround found in configure.ac from ffms2.
351 dnl Reproducing the error message below, for search engines and people
352 dnl looking for a solution...
354 dnl *** Warning: linker path does not have real file for library -lfftw3f.
355 dnl *** I have the capability to make that library automatically link in when
356 dnl *** you link to this library. But I can only do this if you have a
357 dnl *** shared version of the library, which you do not appear to have
358 dnl *** because I did check the linker path looking for a file starting
359 dnl *** with libfftw3f and none of the candidates passed a file format test
360 dnl *** using a file magic. Last file checked: /home/asdf/mingw-w64/i686/mingw/lib/libfftw3f.a
361 dnl *** The inter-library dependencies that have been dropped here will be
362 dnl *** automatically added whenever a program is linked with this library
363 dnl *** or is declared to -dlopen it.
365 dnl *** Since this library must not contain undefined symbols,
366 dnl *** because either the platform does not support them or
367 dnl *** it was explicitly requested with -no-undefined,
368 dnl *** libtool will only create a static version of it.
370 if test "$lt_cv_file_magic_cmd" = "func_win32_libid" ; then
371 deplibs_check_method='file_magic file format pei*-(i386|x86-64)|(.*architecture: i386)?'
372 file_magic_cmd='$OBJDUMP -f'
377 AC_CONFIG_FILES([Makefile])