]> git.sesse.net Git - vlc/blobdiff - configure.ac
Added strnlen replacement (Untested)
[vlc] / configure.ac
index 266b5a433bf85b06f3b5023dd96da1a06969f954..471ff16a89a461f942bc851afcfcd10f3f909b7e 100644 (file)
@@ -173,6 +173,48 @@ case "${host_os}" in
     VLC_ADD_LDFLAGS([mkv mp4], [-framework IOKit -framework CoreFoundation])
     VLC_ADD_CFLAGS([libvlc vlc],[-x objective-c])
     VLC_ADD_LDFLAGS([vlc],[-undefined dynamic_lookup])
+    AC_ARG_ENABLE(macosx-defaults,
+        [  --enable-macosx-defaults Build the default configuration on Mac OS X (default enabled)])
+    if test "x${enable_macosx_defaults}" != "xno"
+    then
+        echo ""
+        echo "Building with Mac OS X defaults:"
+        enable_faad="yes"
+        echo "  Assuming --enable-faad"
+        enable_flac="yes"
+        echo "  Assuming --enable-flac"
+        enable_theora="yes"
+        echo "  Assuming --enable-theora"
+        enable_shout="yes"
+        echo "  Assuming --enable-shout"
+        enable_cddax="yes"
+        echo "  Assuming --enable-cddax"
+        enable_vcdx="yes"
+        echo "  Assuming --enable-vcdx"
+        enable_caca="yes"
+        echo "  Assuming --enable-caca"
+        enable_goom="yes"
+        echo "  Assuming --enable-goom"
+        enable_ncurses="yes"
+        echo "  Assuming --enable-ncurses"
+        enable_twolame="yes"
+        echo "  Assuming --enable-twolame"
+        enable_realrtsp="yes"
+        echo "  Assuming --enable-realrtsp"
+
+        enable_skins2="no"
+        echo "  Assuming --disable-skins2"
+        enable_x11="no"
+        echo "  Assuming --disable-x11"
+        enable_glx="no"
+        echo "  Assuming --disable-glx"
+        enable_xvideo="no"
+        echo "  Assuming --disable-xvideo"
+
+        enable_libtool="no"
+        echo "  Assuming --disable-libtool"
+        echo ""
+    fi
     ;;
   *mingw32* | *cygwin* | *wince* | *mingwce* | *pe*)
     AC_CHECK_TOOL(WINDRES, windres, :)
@@ -282,7 +324,7 @@ AC_PROG_LIBTOOL
 
 AC_ARG_ENABLE(libtool,
     [  --enable-libtool        use libtool (default enabled)])
-AM_CONDITIONAL(USE_LIBTOOL, [test "x${enable_libtool}" != "xno"])
+AM_CONDITIONAL(USE_LIBTOOL, [test "x${enable_libtool}" != "xno"] )
 
 
 dnl
@@ -421,7 +463,7 @@ need_libc=false
 AC_CHECK_FUNCS(gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy)
 
 dnl Check for usual libc functions
-AC_CHECK_FUNCS(strdup strndup atof)
+AC_CHECK_FUNCS(strdup strndup strnlen atof)
 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
 AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
@@ -1493,7 +1535,7 @@ dnl
 dnl  Test coverage
 dnl
 AC_ARG_ENABLE(coverage,
-       [  --enable-debug          build for test coverage (default disabled)],,
+       [  --enable-coverage       build for test coverage (default disabled)],,
        [enable_coverage="no"])
 AS_IF([test "${enable_coverage}" != "no"], [
        CFLAGS="-fprofile-arcs -ftest-coverage ${CFLAGS}"
@@ -1560,10 +1602,24 @@ then
     PKG_CHECK_MODULES(LUA, lua >= 5.1,
       [ have_lua=yes ],
       [ 
-       AC_MSG_WARN([lua >= 5.1 not found!])
+        have_lua=yes
+        AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h], 
+         [],  
+          [ have_lua=no ] )
+       AC_CHECK_LIB(  lua5.1 , luaL_newstate, 
+          [LUA_LIBS="-llua5.1"],
+         AC_CHECK_LIB( lua51 , luaL_newstate, 
+            [LUA_LIBS="-llua51"],
+                 AC_CHECK_LIB( lua , luaL_newstate, 
+                   [LUA_LIBS="-llua"],
+             [ have_lua=no
+                AC_MSG_WARN([lua >= 5.1 not found!])
+              ])
+           )
+         )
       ])
     ])
-  if test "x${have_lua}" = "xyes"; then
+  if test "x${have_lua}" = "xyes" ;  then
      AC_DEFINE(HAVE_LUA, [], [Define if you have the lua library])
      VLC_ADD_PLUGINS([luaplaylist])
      VLC_ADD_LDFLAGS([luaplaylist],[$LUA_LIBS])
@@ -4882,9 +4938,9 @@ then
   AC_PATH_PROG(WX_CONFIG, ${WXWIDGETS_NAME}, no, ${WXWIDGETS_PATH})
   if test "${WX_CONFIG}" != "no" -a "${CXX}" != ""
   then
-    if expr 2.6.0 \> `${WX_CONFIG} --version` >/dev/null ||  expr 2.7.0 \<= `${WX_CONFIG} --version` >/dev/null
+    if expr 2.6.0 \> `${WX_CONFIG} --version` >/dev/null
     then
-      AC_MSG_ERROR([You need wxWidgets of the 2.6 branch. Please upgrade/downgrade and try again. Better yet, you can configure with --disable-wxwidgets.])
+      AC_MSG_ERROR([You need wxWidgets version 2.6.0 or upwards. Please upgrade and try again.])
     fi
     AC_LANG_PUSH(C++)
     # Turn this error:
@@ -5311,7 +5367,14 @@ AS_IF([test "${enable_gnutls}" != "no"], [
   ])
 ])
 
-AM_PATH_LIBGCRYPT([1:1.1.94], [have_libgcrypt="yes"], [have_libgcrypt="no"])
+dnl Workaround for cross-compiling since AM_PATH_LIBGRYPT doesn't dectect
+dnl it and looks for libgcrypt headers in the wrong place.
+if test "${host_cpu}" = "${build_cpu}"
+then
+  AM_PATH_LIBGCRYPT([1:1.1.94], [have_libgcrypt="yes"], [have_libgcrypt="no"])
+else
+  AC_CHECK_HEADERS(gcrypt.h,have_libgcrypt="yes",have_libgcrypt="no")
+fi
 AM_CONDITIONAL([HAVE_LIBGCRYPT], [test "${have_libgcrypt}" = "yes"])