vlclibdir="\${libdir}/\${PKGDIR}"
AC_SUBST(vlclibdir)
-dnl
-dnl Save *FLAGS
-dnl
-VLC_SAVE_FLAGS
-
dnl
dnl Check for tools
dnl
AC_C_INLINE
AC_C_RESTRICT
+dnl
+dnl Save *FLAGS
+dnl
+VLC_SAVE_FLAGS
+
dnl Extend the --help string at the current spot.
AC_DEFUN([EXTEND_HELP_STRING], [m4_divert_once([HELP_ENABLE], [$1])])
AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
])
-AM_CONDITIONAL(HAVE_SHARED_PLUGINS, [test "${enable_shared}" != "no"])
-
dnl
dnl Gettext stuff
dnl
dnl Check for usual libc functions
AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
-AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp uselocale])
+AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp uselocale])
AC_REPLACE_FUNCS([asprintf atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy vasprintf])
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
])
dnl Check for dynamic plugins
-LIBDL="no"
+LIBDL=""
+have_dynamic_objects="no"
LIBS_save="$LIBS"
AC_SEARCH_LIBS(dlopen, [dl svld], [
AS_IF([test "$ac_cv_search_dlopen" != "none required"], [
LIBDL="$ac_cv_search_dlopen"
])
+ have_dynamic_objects="yes"
])
LIBS="$LIBS_save"
# Windows
AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
LIBDL=""
+ have_dynamic_objects="yes" #assume we can use shared objects
])
-AS_IF([test "$LIBDL" != "no"], [
+test "${enable_shared}" = "no" && have_dynamic_objects=no
+
+AS_IF([test "${have_dynamic_objects}" != "no"], [
AC_DEFINE(HAVE_DYNAMIC_PLUGINS, 1,
[Define to 1 if dynamic plugins are supported.])
], [
dnl Clear $LIBDL so as not to break linking
LIBDL=""
])
+AM_CONDITIONAL(HAVE_DYNAMIC_PLUGINS, [test "${have_dynamic_objects}" != "no"])
+
AC_SUBST(LIBDL)
VLC_ADD_LIBS([realvideo lua],[$LIBDL])
dnl
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],
- [build with run-time assertions and debug symbols (default disabled)])],,
+ [build with run-time assertions (default disabled)])],,
[enable_debug="no"])
AH_TEMPLATE(NDEBUG,
[Define to 1 if debug code should NOT be compiled])
AS_IF([test "${enable_debug}" != "no"], [
AC_CHECK_HEADERS([valgrind/valgrind.h])
- CFLAGS="${CFLAGS} -g"
- CXXFLAGS="${CXXFLAGS} -g"
- OBJCFLAGS="${OBJCFLAGS} -g"
- LDFLAGS="${LDFLAGS} -g"
], [
AC_DEFINE(NDEBUG)
])
])
])
- dnl -O2 and -O in both production and debug builds
- AS_IF([test "x$C_O" = "x"], [
- AC_CACHE_CHECK([if \$CC accepts -O2], [ac_cv_c_o2], [
- CFLAGS="${CFLAGS_save} -O2"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
- ac_cv_c_o2=yes
- ], [
- ac_cv_c_o2=no
- ])
- ])
- AS_IF([test "${ac_cv_c_o2}" != "no"], [
- C_O="-O2"
- ], [
- AC_CACHE_CHECK([if \$CC accepts -O], [ac_cv_c_o], [
- CFLAGS="${CFLAGS_save} -O"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
- ac_cv_c_o=yes
- ], [
- ac_cv_c_o=no
- ])
- ])
- AS_IF([test "${ac_cv_c_o}" != "no"], [
- C_O="-O"
- ])
- ])
- ])
-
VLC_RESTORE_FLAGS
CFLAGS="${CFLAGS} ${C_O}"
CXXFLAGS="${CXXFLAGS} ${C_O}"
fi
dnl
-dnl Video4Linux2 plugin
+dnl Video4Linux 2
dnl
-AC_ARG_ENABLE(v4l2,
- [AS_HELP_STRING([--disable-v4l2],
- [disable Video4Linux2 support (default auto)])])
+AC_ARG_ENABLE(libv4l2, [AS_HELP_STRING([--disable-libv4l2],
+ [disable userspace V4L2 library (default auto)])])
+AC_ARG_ENABLE(pvr, [AS_HELP_STRING([--enable-pvr],
+ [support PVR V4L2 cards (default disabled)])])
have_v4l2="no"
-AS_IF([test "${enable_v4l2}" != "no"], [
- AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
- have_v4l2="yes"
+AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h], [
+ have_v4l2="yes"
+])
+AS_IF([test "$have_v4l2" = "yes"], [
+ AS_IF([test "${enable_libv4l2}" != "no"], [
+ PKG_CHECK_MODULES(LIBV4L2, libv4l2, [
+ AC_DEFINE(HAVE_LIBV4L2, 1, [Define to 1 if libv4l2 is available])
+ ], [
+ AC_MSG_WARN([${LIBV4L2_PKG_ERRORS}])
+ ])
+ ])
+ AS_IF([test "${enable_pvr}" = "yes"], [
+ VLC_ADD_PLUGIN([pvr])
])
])
AM_CONDITIONAL(HAVE_V4L2, [test "${have_v4l2}" != "no"])
-dnl
-dnl libv4l2 support for video4linux.
-dnl
-AC_ARG_ENABLE(libv4l2,
- [AS_HELP_STRING([--enable-libv4l2],
- [use V4L2 through libv4l2 (default auto)])])
-if test "${enable_libv4l2}" != "no" -a "${enable_v4l2}" != "no"
-then
- PKG_CHECK_MODULES( LIBV4L2, libv4l2, [
- VLC_ADD_LIBS([v4l2],[${LIBV4L2_LIBS}])
- VLC_ADD_CFLAGS([v4l2],[${LIBV4L2_CFLAGS}])
- AC_DEFINE(HAVE_LIBV4L2, 1, Define if libv4l2 is available)],
- AC_MSG_WARN([LibV4L2 support disabled because libv4l2 development headers were not found])
- )
-fi
-
-dnl
-dnl special access module for Hauppauge PVR cards
-dnl
-AC_ARG_ENABLE(pvr,
- [AS_HELP_STRING([--enable-pvr],
- [support PVR V4L2 cards (default disabled)])])
-if test "${enable_pvr}" = "yes"
-then
- VLC_ADD_PLUGIN([pvr])
-fi
-
dnl
dnl special access module for Blackmagic SDI cards
dnl
PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
if test "${enable_sout}" != "no"; then
PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg mux support], [auto])
-fi
-
-if test "${enable_sout}" != "no"; then
dnl Check for libshout
-PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
+ PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
fi
dnl
dnl
dnl Skins2 module
dnl
-AC_ARG_ENABLE(libtar,
- [ --enable-libtar libtar support for skins2 (default auto)])
-AS_IF([test "${enable_libtar}" != "no"], [
- AC_CHECK_HEADERS(libtar.h, [
- VLC_ADD_LIBS([skins2],[-ltar])
- ])
-])
-
AC_ARG_ENABLE(skins2,
- [AS_HELP_STRING([--enable-skins2],[Skins2 interface module (default
- enabled except on MacOSX and WinCE)])],, [
- AS_IF([test "${SYS}" != "darwin" && test "${SYS}" != "mingwce"], [
- enable_skins2="yes"
- ], [
- enable_skins2="no"
- ])
-])
-AS_IF([test "${enable_skins2}" = "yes"], [
- dnl freetype
- AS_IF([test "${have_freetype}" != "yes"], [
- AC_MSG_ERROR([Could not find FreeType (required for skins2)])
- ])
-
+ [AS_HELP_STRING([--enable-skins2], [skins interface module (default auto)])])
+AS_IF([test "${enable_skins2}" != "no"], [
+ have_skins_deps="yes"
AS_IF([test "${SYS}" = "mingw32"], [
VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -Imodules/gui/skins2 -DWIN32_SKINS])
VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
VLC_ADD_LIBS([skins2],[-Wl,-framework,Carbon])
], [
- PKG_CHECK_MODULES([XPM], [xpm])
- PKG_CHECK_MODULES([XINERAMA], [xinerama])
- PKG_CHECK_MODULES([XEXT], [xext])
+ PKG_CHECK_MODULES([XPM], [xpm],, [have_skins_deps="no"])
+ PKG_CHECK_MODULES([XINERAMA], [xinerama],, [have_skins_deps="no"])
+ PKG_CHECK_MODULES([XEXT], [xext],, [have_skins_deps="no"])
VLC_ADD_CPPFLAGS([skins2],[-Imodules/gui/skins2 ${X_CFLAGS} ${XEXT_CFLAGS} ${XPM_CFLAGS} -DX11_SKINS])
VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} ${XEXT_LIBS} ${XPM_LIBS} ${XINERAMA_LIBS} -lX11])
])
- VLC_ADD_PLUGIN([skins2])
- ALIASES="${ALIASES} svlc"
+ AS_IF([test "${have_freetype}" != "yes"], [
+ have_skins_deps="no"
+ ])
+
+ AS_IF([test "${have_skins_deps}" = "no"], [
+ AS_IF([test "x${enable_skins2}" = "x"], [
+ AC_MSG_WARN([Skins2 interface disabled due to missing dependencies.])
+ ], [
+ AC_MSG_ERROR([Skins2 interface requires FreeType, libxpm, libxext and libxinerama])
+ ])
+ enable_skins2="no"
+ ], [
+ VLC_ADD_PLUGIN([skins2])
+ ALIASES="${ALIASES} svlc"
+ ])
])
AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes"])
+AC_ARG_ENABLE(libtar,
+ [ --enable-libtar libtar support for skins2 (default auto)])
+AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
+ AC_CHECK_HEADERS(libtar.h, [
+ VLC_ADD_LIBS([skins2],[-ltar])
+ ])
+])
+
dnl
dnl Hildon UI
dnl