]> git.sesse.net Git - vlc/blobdiff - configure.ac
Create a modules-like directory for libraries
[vlc] / configure.ac
index a9d910dff7f2e264de1a8f48e03bd56260a47f9f..69bd5c91d37944cb236760eadf4f867e5431aefe 100644 (file)
@@ -844,8 +844,8 @@ fi
 dnl Check for dbus
 AC_ARG_ENABLE(dbus,
   [  --enable-dbus           Linux D-BUS message bus system (default enabled)])
-if test "${enable_dbus}" != "no" -a "$SYS" = "Linux"
+
+if test "${enable_dbus}" != "no" -a "${SYS}" = "linux"
 then
   dnl api stable dbus
   PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0.0,
@@ -1361,18 +1361,24 @@ AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
 if test "${ac_cv_c_altivec}" != "no"; then
   CPPFLAGS="${CPPFLAGS_save} ${ac_cv_c_altivec}"
 fi
-AC_CHECK_HEADERS(altivec.h)
-CPPFLAGS="${CPPFLAGS_save}"
 
-if test "${ac_cv_c_altivec}" != "no"; then
-  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
-  VLC_ADD_CFLAGS([libvlc],[${ac_cv_c_altivec}])
-  VLC_ADD_CFLAGS([idctaltivec motionaltivec],[${ac_cv_c_altivec}])
-  VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
-  if test "${ac_cv_altivec_inline}" = "no"; then
-    ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
+AS_IF( test "${enable_altivec}" != "no",
+[
+  AC_CHECK_HEADERS(altivec.h)
+  CPPFLAGS="${CPPFLAGS_save}"
+  
+  if test "${ac_cv_c_altivec}" != "no"; then
+    AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
+    VLC_ADD_CFLAGS([libvlc],[${ac_cv_c_altivec}])
+    VLC_ADD_CFLAGS([idctaltivec motionaltivec],[${ac_cv_c_altivec}])
+    VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
+    if test "${ac_cv_altivec_inline}" = "no"; then
+      ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
+    fi
   fi
-fi
+],[
+  CPPFLAGS="${CPPFLAGS_save}"
+])
 
 AC_CACHE_CHECK([if linker needs -framework vecLib],
     [ac_cv_ld_altivec],
@@ -2908,7 +2914,6 @@ dnl Trying with pkg-config
       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
       AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
       AC_CHECK_HEADERS(ffmpeg/avformat.h)
-      AC_CHECK_HEADERS(ffmpeg/swscale.h)
       AC_CHECK_HEADERS(ffmpeg/avutil.h)
       AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
 
@@ -2936,6 +2941,7 @@ dnl Trying with pkg-config
       CPPFLAGS="${CPPFLAGS_save}"
 
       AC_CHECK_LIB(swscale, sws_getContext, [
+        AC_CHECK_HEADERS(ffmpeg/swscale.h)
         VLC_ADD_LDFLAGS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL])
       LDFLAGS="${LDFLAGS_save}"
       CPPFLAGS="${CPPFLAGS_save}"
@@ -4778,18 +4784,11 @@ dnl
 dnl  wxWidgets module
 dnl
 AC_ARG_ENABLE(wxwidgets,
-  [  --enable-wxwidgets      wxWidgets support (default enabled)])
-if test "${enable_wxwindows}" 
-then
-  AC_MSG_WARN(--{en|dis}able-wxwindows is deprecated. Use --{en|dis}able-wxwidgets instead.)
-fi
+  [  --enable-wxwidgets      wxWidgets support (default disabled)])
 
-if test "${enable_wxwindows}" = "no"
-then
-  enable_wxwidgets="no"
-fi
-if test "${enable_wxwidgets}" != "no"
+if test "${enable_wxwidgets}" = "yes"
 then
+  AC_MSG_WARN([wxWidgets support is deprecated and will be removed. Consider using Qt4 instead.])
   WXWIDGETS_PATH="${PATH}"
   AC_ARG_WITH(wx-config-path,
     [    --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
@@ -4810,7 +4809,7 @@ then
   then
     if expr 2.6.0 \> `${WX_CONFIG} --version` >/dev/null ||  expr 2.7.0 \<= `${WX_CONFIG} --version` >/dev/null
     then
-      AC_MSG_ERROR([You need wxWidgets of the 2.6 branch. Please upgrade and try again. Alternatively you can also configure with --disable-wxwidgets.])
+      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.])
     fi
     AC_LANG_PUSH(C++)
     # Turn this error:
@@ -4844,7 +4843,7 @@ then
       # the following is required to compile for win32
       VLC_ADD_CXXFLAGS([wxwidgets],[-D_UNICODE -DUNICODE])
     else
-      AC_MSG_ERROR([You need a unicode build of wxWidgets. Please upgrade and try again. Alternatively you can also configure with --disable-wxwidgets.])
+      AC_MSG_ERROR([You need a unicode build of wxWidgets. Please fix that and try again. Better yet, you can configure with --disable-wxwidgets.])
     fi
     if test "$have_libcdio" = "yes"
     then 
@@ -4886,19 +4885,25 @@ dnl QT 4
 dnl
 enableqt4=false
 AC_ARG_ENABLE(qt4,
-  [  --enable-qt4            QT 4 support (default disabled) ],
-  [if test "${enable_qt4}" = "yes"; then
-      PKG_CHECK_MODULES(QT4, QtCore QtGui,
-       [ VLC_ADD_PLUGINS([qt4])
-          ALIASES="${ALIASES} qvlc"
-         enableqt4=true
-         VLC_ADD_LDFLAGS([qt4],[$QT4_LIBS])
-         VLC_ADD_CXXFLAGS([qt4],[$QT4_CFLAGS])
-         MOC=`$PKG_CONFIG --variable=exec_prefix QtCore`/bin/moc
-         RCC=`$PKG_CONFIG --variable=exec_prefix QtCore`/bin/rcc
-         UIC=`$PKG_CONFIG --variable=exec_prefix QtCore`/bin/uic],
-       [AC_MSG_WARN(QT4 library not found)])
-   fi])
+  [  --enable-qt4            QT 4 support (default enabled) ])
+AS_IF([test "${enable_qt4}" != "no" &&
+  (test "${SYS}" != "darwin" || test "${enable_qt4}" = "yes")], [
+  PKG_CHECK_MODULES(QT4, QtCore QtGui,
+    [ VLC_ADD_PLUGINS([qt4])
+      ALIASES="${ALIASES} qvlc"
+      enableqt4=true
+      VLC_ADD_LDFLAGS([qt4],[$QT4_LIBS])
+      VLC_ADD_CXXFLAGS([qt4],[$QT4_CFLAGS])
+      MOC=`$PKG_CONFIG --variable=exec_prefix QtCore`/bin/moc
+      RCC=`$PKG_CONFIG --variable=exec_prefix QtCore`/bin/rcc
+      UIC=`$PKG_CONFIG --variable=exec_prefix QtCore`/bin/uic],
+      AS_IF([test "${enable_qt4}" = "yes"],[
+       AC_MSG_ERROR(QT4 library not found)
+      ],[
+        AC_MSG_WARN(QT4 library not found)
+      ])
+    )
+])
 AM_CONDITIONAL(ENABLE_QT4, test "$enableqt4" = "true")
 
 dnl
@@ -5031,13 +5036,16 @@ AC_ARG_ENABLE(macosx,
   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
   [if test "${enable_macosx}" = "yes"
    then
-     VLC_ADD_BUILTINS([macosx])
-     VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL -framework AGL])
+     VLC_ADD_PLUGINS([access_eyetv])
+     VLC_ADD_LDFLAGS([access_eyetv], [-framework CoreFoundation])
+     VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL -framework AGL -framework QTKit])
      VLC_ADD_OBJCFLAGS( [macosx],[-fobjc-exceptions] )
    fi],
   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
+     VLC_ADD_PLUGINS([access_eyetv])
+     VLC_ADD_LDFLAGS([access_eyetv], [-framework CoreFoundation])
      VLC_ADD_BUILTINS([macosx])
-     VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL -framework AGL])
+     VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL -framework AGL -framework QTKit])
      VLC_ADD_OBJCFLAGS( [macosx],[-fobjc-exceptions] )
    )])
 CFLAGS=$ORIGCFLAGS
@@ -5296,12 +5304,12 @@ AC_ARG_ENABLE(loader,
 AM_CONDITIONAL(LOADER, [test "${enable_loader}" = "yes"])
 AS_IF([test "${enable_loader}" = "yes"],
   [ VLC_ADD_PLUGINS([dmo])
-    VLC_ADD_CPPFLAGS([dmo],[-I../../../@top_srcdir@/loader])
-    VLC_ADD_LDFLAGS([dmo],[../../../loader/libloader.la -lpthread])
-    VLC_ADD_CPPFLAGS([quicktime],[-I../../@top_srcdir@/loader])
-    VLC_ADD_LDFLAGS([quicktime],[../../loader/libloader.la -lpthread])
-    VLC_ADD_CPPFLAGS([realaudio],[-I../../@top_srcdir@/loader -DLOADER])
-    VLC_ADD_LDFLAGS([realaudio],[../../loader/libloader.la -ldl -lpthread])
+    VLC_ADD_CPPFLAGS([dmo],[-I../../../@top_srcdir@/libs/loader])
+    VLC_ADD_LDFLAGS([dmo],[../../../libs/loader/libloader.la -lpthread])
+    VLC_ADD_CPPFLAGS([quicktime],[-I../../@top_srcdir@/libs/loader])
+    VLC_ADD_LDFLAGS([quicktime],[../../libs/loader/libloader.la -lpthread])
+    VLC_ADD_CPPFLAGS([realaudio],[-I../../@top_srcdir@/libs/loader -DLOADER])
+    VLC_ADD_LDFLAGS([realaudio],[../../libs/loader/libloader.la -ldl -lpthread])
   ])
 
 dnl
@@ -5763,7 +5771,8 @@ AC_CONFIG_FILES([
   doc/Makefile
   intl/Makefile
   ipkg/Makefile
-  loader/Makefile
+  libs/Makefile
+  libs/loader/Makefile
   modules/Makefile
   mozilla/Makefile
   m4/Makefile