]> git.sesse.net Git - vlc/blobdiff - configure.in
* ./include/threads_funcs.h: Win32 compilation fix.
[vlc] / configure.in
index 6226375d68042f6c52fb7289a6d2edda8cf9ca04..5105675e50891a2380b636fe33ded43f246a4715 100644 (file)
@@ -4,7 +4,7 @@ AC_CONFIG_HEADER(include/defs.h)
 AC_CANONICAL_SYSTEM
 
 PACKAGE="vlc"
-VERSION="0.3.1"
+VERSION="0.4.3"
 CODENAME=Ourumov
 
 dnl Save CFLAGS and LDFLAGS
@@ -39,7 +39,7 @@ else
 fi
 
 dnl Gettext stuff
-ALL_LINGUAS="de en_GB fr ja no ru nl"
+ALL_LINGUAS="de en_GB fr ja no ru nl pl"
 
 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "$PACKAGE", [Package name])
 AC_DEFINE_UNQUOTED(VLC_VERSION, "$VERSION", [Package version])
@@ -79,6 +79,8 @@ case x"${target_os}" in
     vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
     vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
+    ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
+    http_LDFLAGS="${http_LDFLAGS} -lws2_32"
     rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
     ;;
   x*nto*)
@@ -111,7 +113,7 @@ dnl The -DSYS_FOO flag
 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
 
 dnl Check for system libs needed
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
+AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll)
 
 AC_CHECK_FUNC(connect,,[
   AC_CHECK_LIB(socket,connect,
@@ -124,11 +126,18 @@ AC_CHECK_FUNC(gethostbyname,,[
 AC_CHECK_FUNC(gethostbyname,,[
   AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
 ])
-AC_CHECK_FUNC(nanosleep,,[
-  AC_CHECK_LIB(rt,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lrt",[
-    AC_CHECK_LIB(posix4,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4")
-  ])
+have_nanosleep=0
+AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
+  AC_CHECK_LIB(rt,nanosleep,
+    [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"; have_nanosleep=1],
+    [AC_CHECK_LIB(posix4,nanosleep,
+        [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"; have_nanosleep=1])]
+  )
 ])
+if test x$have_nanosleep = x1; then
+  AC_DEFINE(HAVE_NANOSLEEP, 1,
+            Define if nanosleep is available.)
+fi
 AC_CHECK_FUNC(inet_aton,,[
   AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
 ])
@@ -184,7 +193,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
             Define if <strings.h> defines strncasecmp.)])
 
 dnl Check for headers
-AC_CHECK_HEADERS(getopt.h strings.h)
+AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
 AC_CHECK_HEADERS(dlfcn.h image.h)
 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
@@ -193,6 +202,18 @@ AC_CHECK_HEADERS(linux/version.h)
 
 AC_HEADER_TIME
 
+dnl Mac OS X and other OSes don't have declaration for nanosleep
+AC_EGREP_HEADER(nanosleep,time.h,[
+  AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
+            Define if <time.h> defines nanosleep.)
+])
+
+dnl Make sure we have timespecs
+AC_EGREP_HEADER(timespec,sys/time.h,[
+  AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
+            Define if <sys/time.h> defines struct timespec.)
+])
+
 dnl Check for threads library
 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
 
@@ -406,7 +427,7 @@ dnl
 dnl  default modules
 dnl
 BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope"
+PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone filter_crop fx_scope"
 
 dnl
 dnl  Accelerated modules
@@ -703,28 +724,68 @@ if test "x$enable_dvbpsi" != "xno"
 then
   AC_ARG_WITH(dvbpsi, 
   [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
-  if test "x$with_dvbpsi" = x
-  then
-    test_LDFLAGS=""
-    test_CFLAGS=""
-  else
-    test_LDFLAGS="-L${with_dvbpsi}/lib"
-    test_CFLAGS="-I${with_dvbpsi}/include"
-  fi
-  CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
-  AC_CHECK_HEADER([dvbpsi/dr.h],[
-    PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
-    mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
-    mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
-    ],[
-    if test "x$enable_dvbpsi" != x
+  AC_ARG_WITH(dvbpsi,
+  [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
+  case "x$with_dvbpsi" in
+  x|xyes)
+    if test "x$with_dvbpsi_tree" = x
     then
-      AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
+      AC_CHECK_HEADERS(dvbpsi/dr.h,
+        [ PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
+          mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
+        [  AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
+    else
+      AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
+      real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
+      if test "x$real_dvbpsi_tree" = x
+      then
+        dnl  The given directory can't be found
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
+      fi
+      if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
+      then
+        dnl  Use a custom libdvbpsi
+        AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
+        BUILTINS="${BUILTINS} mpeg_ts_dvbpsi"
+        mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
+        mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
+      else
+        dnl  The given libdvbpsi wasn't built
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
+      fi
     fi
-  ])
-  CPPFLAGS="$save_CPPFLAGS"
+  ;;
+  xno)
+    dnl  Compile without dvbpsi (dlopen version, works only under Linux)
+  ;;
+  *)
+    AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
+    if test "x$with_dvbpsi" = x
+    then
+      test_LDFLAGS=""
+      test_CFLAGS=""
+    else
+      test_LDFLAGS="-L${with_dvbpsi}/lib"
+      test_CFLAGS="-I${with_dvbpsi}/include"
+    fi
+    CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
+    AC_CHECK_HEADER([dvbpsi/dr.h],[
+      PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
+      mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
+      mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
+      ],[
+      if test "x$enable_dvbpsi" != x
+      then
+        AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
+      fi
+    ])
+    CPPFLAGS="$save_CPPFLAGS"
+  ;;
+  esac
 fi
+
 dnl
 dnl  VCD module
 dnl
@@ -767,10 +828,16 @@ AC_ARG_ENABLE(satellite,
 dnl
 dnl  ipv6 plugin - not for QNX yet
 dnl
-if test x$SYS != xnto
+if test x$SYS != xnto && test "x$SYS" != "xmingw32"
 then
   AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
 fi
+if test "x$SYS" = "xmingw32"
+then
+  AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
+  AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
+    PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
+fi
 
 dnl
 dnl  AVI demux plugin
@@ -840,9 +907,9 @@ then
     LDFLAGS="$LDFLAGS $mad_LDFLAGS"
     AC_CHECK_HEADERS(mad.h, ,
       [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
-    AC_CHECK_LIB(mad, mad_bit_init,
+    AC_CHECK_LIB(mad, mad_bit_init, [
       PLUGINS="${PLUGINS} mad"
-      mad_LDFLAGS="${mad_LDFLAGS} -lmad",
+      mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
     CFLAGS=$save_CFLAGS
     LDFLAGS=$save_LDFLAGS
@@ -856,12 +923,18 @@ AC_ARG_ENABLE(ffmpeg,
 [  --enable-ffmpeg         ffmpeg codec (default disabled)])
 if test "x$enable_ffmpeg" = "xyes"
 then
+  AC_ARG_WITH(ffmpeg,
+    [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
+  if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"
+  then
+    ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I$with_ffmpeg/include/libffmpeg"
+    ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L$with_ffmpeg/lib"
+  fi
+
   AC_ARG_WITH(ffmpeg-tree, 
   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
-  if test "x$with_ffmpeg_tree" = x
+  if test "x$with_ffmpeg_tree" != "x"
   then
-    AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
-  else
     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
     if test "x$real_ffmpeg_tree" = x
@@ -875,13 +948,24 @@ then
       dnl  Use a custom libffmpeg
       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
       BUILTINS="${BUILTINS} ffmpeg"
-      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
+      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
     else
       dnl  The given libavcodec wasn't built
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
     fi
+  else
+    save_CFLAGS=$CFLAGS
+    save_LDFLAGS=$LDFLAGS
+    CFLAGS="$CFLAGS $ffmpeg_CFLAGS"
+    LDFLAGS="$LDFLAGS $ffmpeg_LDFLAGS -lm"
+    AC_CHECK_LIB(avcodec, avcodec_init, [
+      BUILTINS="${BUILTINS} ffmpeg"
+      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
+      [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
+    CFLAGS=$save_CFLAGS
+    LDFLAGS=$save_LDFLAGS
   fi
 fi
 
@@ -1664,11 +1748,13 @@ AC_SUBST(ggi_LDFLAGS)
 AC_SUBST(glide_LDFLAGS)
 AC_SUBST(gnome_LDFLAGS)
 AC_SUBST(gtk_LDFLAGS)
+AC_SUBST(http_LDFLAGS)
 AC_SUBST(idctaltivec_LDFLAGS)
 AC_SUBST(imdct_LDFLAGS)
 AC_SUBST(imdct3dn_LDFLAGS)
 AC_SUBST(imdctsse_LDFLAGS)
 AC_SUBST(ipv4_LDFLAGS)
+AC_SUBST(ipv6_LDFLAGS)
 AC_SUBST(kde_LDFLAGS)
 AC_SUBST(lirc_LDFLAGS)
 AC_SUBST(macosx_LDFLAGS)
@@ -1686,7 +1772,7 @@ AC_SUBST(waveout_LDFLAGS)
 AC_SUBST(x11_LDFLAGS)
 AC_SUBST(xvideo_LDFLAGS)
 
-AC_OUTPUT([Makefile.opts po/Makefile.in])
+AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in])
 
 echo "
 vlc configuration