]> git.sesse.net Git - vlc/blobdiff - configure.ac
Revert "luahttp: fix service discovery loading."
[vlc] / configure.ac
index 31ff8c8260e5fc92a7ee8a8df43af7d66da6bd22..e21d62d404ef867acb32c33f9c22b9a5d48357c5 100644 (file)
@@ -2,11 +2,11 @@ dnl Autoconf settings for vlc
 
 AC_COPYRIGHT([Copyright 2002-2010 the VideoLAN team])
 
-AC_INIT(vlc, 1.1.0-git)
+AC_INIT(vlc, 1.1.0-pre1)
 VERSION_MAJOR="1"
 VERSION_MINOR="1"
 VERSION_REVISION="0"
-VERSION_EXTRA="-git"
+VERSION_EXTRA="-pre1"
 PKGDIR="vlc"
 AC_SUBST(PKGDIR)
 
@@ -201,11 +201,30 @@ case "${host_os}" in
     esac
     ;;
   darwin*)
+
+    dnl Force gcc "-arch" flag
+    ARCH_flag=""
+    case "${host}" in
+      i386*)
+        ARCH_flag="-arch i386"
+      ;;
+      ppc64*)
+        ARCH_flag="-arch ppc64"
+      ;;
+      ppc*)
+        ARCH_flag="-arch ppc"
+      ;;
+      x86_64*)
+        ARCH_flag="-arch x86_64"
+      ;;
+    esac
+
     SYS=darwin
-    CFLAGS_save="${CFLAGS_save} -D_INTL_REDIRECT_MACROS"; CFLAGS="${CFLAGS_save}"
-    CXXFLAGS_save="${CXXFLAGS_save} -D_INTL_REDIRECT_MACROS"; CXXFLAGS="${CXXFLAGS_save}"
-    OBJCFLAGS_save="${OBJCFLAGS_save} -D_INTL_REDIRECT_MACROS -std=gnu99"; OBJCFLAGS="${OBJCFLAGS_save}"
-    LDFLAGS_save="${LDFLAGS_save} -Wl,-headerpad_max_install_names"; LDFLAGS="${LDFLAGS_save}"
+    CFLAGS_save="${CFLAGS_save} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"; CFLAGS="${CFLAGS_save}"
+    CXXFLAGS_save="${CXXFLAGS_save} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"; CXXFLAGS="${CXXFLAGS_save}"
+    CPPFLAGS_save="${CPPFLAGS_save} ${ARCH_flag}"; CPPFLAGS="${CPPFLAGS_save}"
+    OBJCFLAGS_save="${OBJCFLAGS_save} -D_INTL_REDIRECT_MACROS -std=gnu99 ${ARCH_flag}"; OBJCFLAGS="${OBJCFLAGS_save}"
+    LDFLAGS_save="${LDFLAGS_save} -Wl,-headerpad_max_install_names ${ARCH_flag}"; LDFLAGS="${LDFLAGS_save}"
     VLC_ADD_LDFLAGS([mkv mp4 motion], [-Wl,-framework,IOKit,-framework,CoreFoundation])
     VLC_ADD_LDFLAGS([libvlc vlc],[-Wl,-undefined,dynamic_lookup])
     VLC_ADD_LDFLAGS([avcodec avformat access_avio swscale postproc i420_rgb_mmx x264],[-Wl,-read_only_relocs,suppress])
@@ -324,6 +343,7 @@ case "${host_os}" in
         then
           AC_CHECK_TOOL(PEFLAGS, peflags, :)
         fi
+        AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
     fi
     if test "${SYS}" = "mingwce"; then
         # add ws2 for closesocket, select, recv
@@ -529,7 +549,7 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS([ctime_r daemon fcntl fdopendir fork getenv getpwuid_r gettimeofday isatty lstat memalign posix_fadvise posix_madvise posix_memalign putenv setenv setlocale stricmp strnicmp tdestroy uselocale])
-AC_REPLACE_FUNCS([asprintf atof atoll getcwd getpid gmtime_r lldiv localtime_r rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab vasprintf])
+AC_REPLACE_FUNCS([asprintf atof atoll getcwd getpid gmtime_r lldiv localtime_r nrand48 rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab vasprintf])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
@@ -646,19 +666,14 @@ AC_CHECK_FUNCS(inet_aton,,[
   ])
 ])
 
-dnl Check for getopt (always use builtin one on win32)
-if test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"; then
-need_getopt=:
-else
-need_getopt=false
-AC_CHECK_FUNCS(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
-[ # FreeBSD has a gnugetopt library for this:
-  AC_CHECK_LIB([gnugetopt],[getopt_long],
-    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support)
-     VLC_ADD_LIBS([libvlccore],[-lgnugetopt])],
-    [need_getopt=:])])
-fi
-AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
+dnl FreeBSD has a gnugetopt library for this:
+GNUGETOPT_LIBS=""
+AC_CHECK_FUNC(getopt_long,, [
+  AC_CHECK_LIB([gnugetopt],[getopt_long], [
+    GNUGETOPT_LIBS="-lgnugetopt"
+  ])
+])
+AC_SUBST(GNUGETOPT_LIBS)
 
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
 AC_CHECK_LIB(m,cos,[
@@ -956,16 +971,6 @@ CFLAGS="${CFLAGS_save}"
 RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration])
 RDC_PROG_CC_FLAGS([-pipe])
 
-AC_ARG_ENABLE(warnings-as-error,
-      AS_HELP_STRING([--enable-warnings-as-error],[Treat acceptable warnings as error (default disabled)]),, [enable_warnings_as_error="no"])
-AS_IF([test "${enable_warnings_as_error}" = "yes"], [
-    RDC_PROG_CC_WERRORFLAGS([unused-function unused-label unused-value unused-parameter unused-variable unused \
-     missing-braces nonnull parentheses uninitialized address enum-compare undef comment switch \
-     bad-function-cast implicit sequence-point strict-aliasing array-bounds missing-parameter-type \
-     overflow int-to-pointer-cast pointer-to-int-cast div-by-zero overflow ignored])
-])
-AC_SUBST(CFLAGS_WERROR)
-
 dnl Check for various optimization flags
 AC_CACHE_CHECK([if \$CC accepts -Os],
     [ac_cv_c_os],
@@ -1975,45 +1980,7 @@ fi
 dnl
 dnl  OpenCV wrapper and example filters
 dnl
-AC_ARG_ENABLE(opencv,
-  [  --enable-opencv         OpenCV (computer vision) filter (default disabled)])
-if test "${enable_opencv}" = "yes" -a "${CXX}" != "";
-then
-  AC_ARG_WITH(opencv-tree,
-  [  --with-opencv-tree=PATH opencv tree for linking])
-    if test "${SYS}" = "mingw32"
-    then
-      test -z "${with_opencv_tree}" && AC_MSG_ERROR([You have to specify --with-opencv-tree])
-      AC_MSG_CHECKING(for opencv in ${with_opencv_tree})
-      if test -f ${with_opencv_tree}/cv/include/cv.h -a -f ${with_opencv_tree}/cxcore/include/cxcore.h \
-        -a -f ${with_opencv_tree}/cvaux/include/cvaux.h -a -f ${with_opencv_tree}/otherlibs/highgui/highgui.h
-      then
-        AC_MSG_RESULT(yes)
-        VLC_ADD_PLUGIN([opencv_wrapper])
-        VLC_ADD_LIBS([opencv_wrapper],[-L${with_opencv_tree}/lib -lcv -lcxcore -lcvaux -lhighgui])
-        VLC_ADD_CFLAGS([opencv_wrapper],[-I${with_opencv_tree}/cv/include -I${with_opencv_tree}/cxcore/include -I${with_opencv_tree}/cvaux/include -I${with_opencv_tree}/otherlibs/highgui])
-        AC_LANG_PUSH(C++)
-        VLC_ADD_PLUGIN([opencv_example])
-        VLC_ADD_LIBS([opencv_example],[-L${with_opencv_tree}/lib -lcv -lcxcore -lcvaux -lhighgui])
-        VLC_ADD_CXXFLAGS([opencv_example],[-I${with_opencv_tree}/cv/include -I${with_opencv_tree}/cxcore/include -I${with_opencv_tree}/cvaux/include -I${with_opencv_tree}/otherlibs/highgui])
-        AC_LANG_POP(C++)
-      else
-        dnl  No opencv could be found, sorry
-        AC_MSG_RESULT(no)
-        AC_MSG_ERROR([cannot find opencv in ${with_opencv_tree}])
-      fi
-    else
-      PKG_CHECK_MODULES(OPENCV, opencv,
-        [
-          VLC_ADD_PLUGIN([opencv_example opencv_wrapper])
-          VLC_ADD_LIBS([opencv_example opencv_wrapper],[${OPENCV_LIBS}])
-          VLC_ADD_CFLAGS([opencv_wrapper],[${OPENCV_CFLAGS}])
-          VLC_ADD_CXXFLAGS([opencv_example],[${OPENCV_CFLAGS}])
-        ],
-        [AC_MSG_ERROR([libopencv not found!])]
-      )
-    fi
-fi
+PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper], [opencv], (OpenCV (computer vision) filter), [off])
 
 
 dnl
@@ -3343,7 +3310,6 @@ AS_IF([test "${enable_xcb}" != "no"], [
   PKG_CHECK_MODULES(XCB, [xcb])
   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
   VLC_ADD_PLUGIN([screensaver xcb_x11 xcb_screen xcb_apps])
-  VLC_SET_CFLAGS_WERROR([xcb_screen], [-Wno-error=uninitialized]) # some gcc report a warning which doesn't reveal an error
 
   AS_IF([test "${enable_xvideo}" != "no"], [
     PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [
@@ -3434,8 +3400,8 @@ then
         SDL_PATH="${with_sdl_config_path}:${PATH}"
       fi ])
   AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
-  SDL_HEADER="SDL/SDL.h"
-  SDL_IMAGE="SDL/SDL_image.h"
+  SDL_HEADER="SDL.h"
+  SDL_IMAGE="SDL_image.h"
 
   if test "${SDL_CONFIG}" != "no";  then
      PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
@@ -3443,12 +3409,12 @@ then
         if test "${SYS}" != "darwin"; then
           VLC_ADD_PLUGIN([vout_sdl aout_sdl])
         fi
-        VLC_ADD_CFLAGS([vout_sdl aout_sdl sdl_image],[`${SDL_CONFIG} --cflags | sed 's,SDL,,'`])
+        VLC_ADD_CFLAGS([vout_sdl aout_sdl sdl_image],[`${SDL_CONFIG} --cflags`])
         VLC_ADD_LIBS([vout_sdl aout_sdl sdl_image],[`${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`])
 
         # SDL_image
         AS_IF([ test "${enable_sdl_image}" != "no"],[
-          AC_CHECK_HEADERS("SDL/SDL_image.h", [
+          AC_CHECK_HEADERS("SDL_image.h", [
             VLC_ADD_PLUGIN([sdl_image])
             AC_CHECK_LIB(png, png_set_rows, [VLC_ADD_LIBS([sdl_image],[-lpng -lz])],[],[-lz])
             AC_CHECK_LIB(jpeg, jpeg_start_decompress, [VLC_ADD_LIBS([sdl_image],[-ljpeg])])
@@ -3789,6 +3755,7 @@ dnl
 dnl  Pulseaudio module
 dnl
 PKG_ENABLE_MODULES_VLC([PULSE], [], [libpulse >= 0.9.11], [Pulseaudio support], [auto])
+VLC_ADD_LIBS([pulse], [${X_LIBS} ${X_PRE_LIBS} -lX11])
 
 dnl
 dnl  Portaudio module
@@ -4260,7 +4227,7 @@ PKG_ENABLE_MODULES_VLC([UDEV], [], [libudev >= 142], [Linux udev services discov
 
 dnl
 dnl MTP devices services discovery
-PKG_ENABLE_MODULES_VLC([MTP], [], [libmtp >= 0.3.0],[MTP devices support],[auto])
+PKG_ENABLE_MODULES_VLC([MTP], [mtp access_mtp], [libmtp >= 1.0.0], [MTP devices support], [auto])
 
 dnl
 dnl  Lirc plugin
@@ -4447,6 +4414,33 @@ AS_IF([test "${ac_cv_c_bigendian}" = "yes"], [
 ])
 AC_SUBST(DEFS_BIGENDIAN)
 
+dnl
+dnl Where to install KDE solid .desktop
+dnl
+AC_ARG_VAR([KDE4_CONFIG], [path to kde4-config utility])
+AS_IF([test "x$KDE4_CONFIG" = "x"], [
+  KDE4_CONFIG="kde4-config"
+])
+
+AC_ARG_WITH(kde-solid,
+  AS_HELP_STRING([--with-kde-solid=PATH],
+                 [KDE Solid actions directory (auto)]),, [
+  with_kde_solid="yes"
+])
+soliddatadir=""
+AS_IF([test "${with_kde_solid}" != "no"], [
+  AS_IF([test "${with_kde_solid}" = "yes"], [
+    soliddatadir="`${KDE4_CONFIG} --install data`solid/actions"
+    AS_IF([test "x${soliddatadir}" = "x"], [
+      soliddatadir='$(datadir)/kde4/apps/solid/actions'
+    ])
+  ], [
+    soliddatadir="${with_kde_solid}"
+  ])
+])
+AC_SUBST(soliddatadir)
+AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
+
 dnl
 dnl  DLL loader copied from MPlayer copied from somewhere else (WINE ?)
 dnl
@@ -4569,7 +4563,6 @@ then
     AS_IF( [test $found = 1],[
         CPPFLAGS="${CPPFLAGS_save} ${MOZILLA_CFLAGS}"
         MOZILLA_REQUIRED_HEADERS=1
-        AC_CHECK_HEADERS([npfunctions.h])
         AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
         AC_CHECK_HEADERS(npruntime.h,,MOZILLA_REQUIRED_HEADERS=0,
           [#if HAVE_NPAPI_H
@@ -4722,7 +4715,7 @@ dnl
 dnl  Stuff used by the program
 dnl
 VERSION_MESSAGE="${VERSION} ${CODENAME}"
-COPYRIGHT_MESSAGE="VLC media player - version ${VERSION_MESSAGE} - (c) ${COPYRIGHT_YEARS} the VideoLAN team"
+COPYRIGHT_MESSAGE="Copyright © ${COPYRIGHT_YEARS} the VideoLAN team"
 AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION_MESSAGE}", [Simple version string])
 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "${COPYRIGHT_MESSAGE}", [Copyright string])
 AC_DEFINE_UNQUOTED(COPYRIGHT_YEARS, "${COPYRIGHT_YEARS}", [The copyright years])