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"],
247 AC_DEFINE([VS_USE_LATEST_API])
248 AC_DEFINE([VSSCRIPT_USE_LATEST_API])
252 PKG_CHECK_MODULES([PYTHON3],
253 [python-$PYTHON_VERSION-embed],
256 PKG_CHECK_MODULES([PYTHON3],
257 [python-$PYTHON_VERSION])
260 AC_CONFIG_FILES([pc/vapoursynth-script.pc])
263 AM_CONDITIONAL([VSSCRIPT], [test "x$enable_vsscript" != "xno"])
267 AC_ARG_ENABLE([vspipe], AS_HELP_STRING([--enable-vspipe], [Build vspipe. Requires VSScript. (default=yes)]))
269 [test "x$enable_vsscript" = "xno"],
271 AC_DEFINE([VS_USE_LATEST_API])
272 AC_DEFINE([VS_GRAPH_API])
273 AC_DEFINE([VSSCRIPT_USE_LATEST_API])
275 [test "x$enable_vspipe" = "xyes"],
276 [AC_MSG_ERROR([Cannot build vspipe when VSScript is disabled.])],
281 AM_CONDITIONAL([VSPIPE], [test "x$enable_vspipe" != "xno"])
285 AC_ARG_ENABLE([python-module], AS_HELP_STRING([--enable-python-module], [Build the Python module. Requires Cython, Python, and the core. (default=yes)]))
287 [test "x$enable_core" = "xno"],
290 [test "x$enable_python_module" = "xyes"],
291 [AC_MSG_ERROR([Cannot build the Python module when the core is disabled.])],
292 [enable_python_module="no"]
297 [test "x$enable_python_module" != "xno"],
299 AC_ARG_WITH([cython], AS_HELP_STRING([--with-cython], [Override the automatic detection of the Cython executable. (default=check)]), [], [with_cython=check])
301 [test "x$with_cython" = "xcheck"],
302 [AC_CHECK_PROGS([CYTHON], [cython3 cython])],
303 [CYTHON="$with_cython"]
307 [test "x$CYTHON" = "x"],
308 [AC_MSG_ERROR([Cython required but not found.])]
313 [test -z "$PYTHON_VERSION"],
314 [AM_PATH_PYTHON([3])]
318 [test -z "$PYTHON3_LIBS"],
320 PKG_CHECK_MODULES([PYTHON3],
321 [python-$PYTHON_VERSION-embed],
324 PKG_CHECK_MODULES([PYTHON3],
325 [python-$PYTHON_VERSION])
334 AC_SUBST([PYTHON_MODULE_UNDEFINED], ["-undefined dynamic_lookup"])
338 AC_SUBST([PYTHON_MODULE_UNDEFINED], ["-no-undefined"])
339 AC_SUBST([MAYBE_PYTHON3_LIBS], ["$PYTHON3_LIBS"])
346 AM_CONDITIONAL([PYTHONMODULE], [test "x$enable_python_module" != "xno"])
350 dnl Workaround for a bug in libtool
351 dnl The windows libtool uses a file magic checking method that only accepts
352 dnl dynamic libraries. Change it for libtool's alternative checking method.
354 dnl Workaround found in configure.ac from ffms2.
356 dnl Reproducing the error message below, for search engines and people
357 dnl looking for a solution...
359 dnl *** Warning: linker path does not have real file for library -lfftw3f.
360 dnl *** I have the capability to make that library automatically link in when
361 dnl *** you link to this library. But I can only do this if you have a
362 dnl *** shared version of the library, which you do not appear to have
363 dnl *** because I did check the linker path looking for a file starting
364 dnl *** with libfftw3f and none of the candidates passed a file format test
365 dnl *** using a file magic. Last file checked: /home/asdf/mingw-w64/i686/mingw/lib/libfftw3f.a
366 dnl *** The inter-library dependencies that have been dropped here will be
367 dnl *** automatically added whenever a program is linked with this library
368 dnl *** or is declared to -dlopen it.
370 dnl *** Since this library must not contain undefined symbols,
371 dnl *** because either the platform does not support them or
372 dnl *** it was explicitly requested with -no-undefined,
373 dnl *** libtool will only create a static version of it.
375 if test "$lt_cv_file_magic_cmd" = "func_win32_libid" ; then
376 deplibs_check_method='file_magic file format pei*-(i386|x86-64)|(.*architecture: i386)?'
377 file_magic_cmd='$OBJDUMP -f'
382 AC_CONFIG_FILES([Makefile])