configure: add enable-libav option 83/18683/1
authorKitae Kim <kt920.kim@samsung.com>
Wed, 26 Mar 2014 11:59:03 +0000 (20:59 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Fri, 28 Mar 2014 05:23:07 +0000 (14:23 +0900)
qemu compiles codec module, depending on enable-libav option

Change-Id: If0faa7656ee8d0eff0ebb004cb3f369a755a269e
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
configure
package/build.macos-64
package/build.ubuntu-32
package/build.ubuntu-64
package/build.windows-32
tizen/src/Makefile
tizen/src/Makefile.tizen
tizen/src/hw/maru_board.c

index bb41d08..334904f 100755 (executable)
--- a/configure
+++ b/configure
@@ -264,6 +264,7 @@ gl="yes"
 # for TIZEN-maru 
 maru="no"
 shm="no"
+libav="no"
 #
 glusterfs=""
 glusterfs_discard="no"
@@ -1014,6 +1015,8 @@ for opt do
   ;;
   --enable-shm) shm="yes"
   ;;
+  --enable-libav) libav="yes"
+  ;;
 #
   --disable-glusterfs) glusterfs="no"
   ;;
@@ -1298,6 +1301,8 @@ echo ""
 echo "TIZEN-maru options:"
 echo "  --enable-maru            enable maru board"
 echo "  --enable-shm             enable shared memory for framebuffer"
+echo "  --enable-libav           enable libav library"
+
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
 fi
@@ -3613,6 +3618,73 @@ if compile_prog "" "" ; then
 fi
 
 ##########################################
+# libav probe
+
+if test "$libav" != "no"; then
+    libavcodec_package="libavcodec"
+    libavcodec_version="54.35.0"
+       libavutil_package="libavutil"
+       libavutil_version="52.3.0"
+       libavformat_package="libavformat"
+       libavformat_version="54.20.3"
+       libavresample_package="libavresample"
+       libavresample_version="1.0.1"
+
+    if $pkg_config --exists "$libavcodec_package >= $libavcodec_version" ; then
+               libav_cflags=`$pkg_config --cflags $libavcodec_package`
+               libav_libs=`$pkg_config --libs $libavcodec_package`
+               libs_softmmu="$libav_libs $libs_softmmu"
+           QEMU_CFLAGS="$QEMU_CFLAGS $libav_cflags"
+               libav="yes"
+    else
+               if test "$libav" = "yes" ; then
+                       feature_not_found "libav"
+               fi
+               libav="no"
+    fi
+
+    if $pkg_config --exists "$libavutil_package >= $libavutil_version" ; then
+               libav_cflags=`$pkg_config --cflags $libavutil_package`
+               libav_libs=`$pkg_config --libs $libavutil_package`
+               libs_softmmu="$libav_libs $libs_softmmu"
+           QEMU_CFLAGS="$QEMU_CFLAGS $libav_cflags"
+               libav="yes"
+    else
+               if test "$libav" = "yes" ; then
+                       feature_not_found "libav"
+               fi
+               libav="no"
+    fi
+
+    if $pkg_config --exists "$libavformat_package >= $libavformat_version" ; then
+               libav_cflags=`$pkg_config --cflags $libavformat_package`
+               libav_libs=`$pkg_config --libs $libavformat_package`
+               libs_softmmu="$libav_libs $libs_softmmu"
+           qemu_cflags="$qemu_cflags $libav_cflags"
+               libav="yes"
+    else
+               if test "$libav" = "yes" ; then
+                       feature_not_found "libav"
+               fi
+               libav="no"
+    fi
+
+       if $pkg_config --exists "$libavresample_package >= $libavresample_version" ; then
+               libav_cflags=`$pkg_config --cflags $libavresample_package`
+               libav_libs=`$pkg_config --libs $libavresample_package`
+               libs_softmmu="$libav_libs $libs_softmmu"
+           qemu_cflags="$qemu_cflags $libav_cflags"
+               libav="yes"
+    else
+               if test "$libav" = "yes" ; then
+                       feature_not_found "libav"
+               fi
+               libav="no"
+    fi
+
+fi
+
+##########################################
 # End of CC checks
 # After here, no more $cc or $ld runs
 
@@ -3872,6 +3944,7 @@ echo "vhdx              $vhdx"
 # for TIZEN-maru
 echo "TIZEN-maru support $maru"
 echo "TIZEN-maru shared framebuffer support $shm"
+echo "TIZEN-maru libav support $libav"
 #
 
 if test "$sdl_too_old" = "yes"; then
@@ -4315,6 +4388,10 @@ fi
 if test "$gl" = "yes" ; then
   echo "CONFIG_GL_BACKEND=y" >> $config_host_mak
 fi
+if test "$libav" = "yes" ; then
+  echo "CONFIG_LIBAV=y" >> $config_host_mak
+fi
+
 # TPM passthrough support?
 if test "$tpm" = "yes"; then
   echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak
index 5f59bf9..f810429 100755 (executable)
@@ -25,7 +25,7 @@ prepare()
         exit 1
     fi
 
-    export PKG_CONFIG_PATH=$ROOTDIR/glib2/lib/pkgconfig:$ROOTDIR/curl/lib/pkgconfig:$ROOTDIR/libffi/lib/pkgconfig:$ROOTDIR/libiconv/lib/pkgconfig:$ROOTDIR/libidn/lib/pkgconfig:$ROOTDIR/libxml2/lib/pkgconfig:$ROOTDIR/ncurses/lib/pkgconfig:$ROOTDIR/openssl/lib/pkgconfig:$ROOTDIR/pixman/lib/pkgconfig:$ROOTDIR/zlib/lib/pkgconfig
+    export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ROOTDIR/glib2/lib/pkgconfig:$ROOTDIR/curl/lib/pkgconfig:$ROOTDIR/libffi/lib/pkgconfig:$ROOTDIR/libiconv/lib/pkgconfig:$ROOTDIR/libidn/lib/pkgconfig:$ROOTDIR/libxml2/lib/pkgconfig:$ROOTDIR/ncurses/lib/pkgconfig:$ROOTDIR/openssl/lib/pkgconfig:$ROOTDIR/pixman/lib/pkgconfig:$ROOTDIR/zlib/lib/pkgconfig:$ROOTDIR/libav/lib/pkgconfig
 
     BUILD_CFLAGS="--extra-cflags=-I$ROOTDIR/curl/include "
     BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/libffi/include "
@@ -37,7 +37,6 @@ prepare()
     BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/openssl/include "
     BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/pixman/include "
     BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/zlib/include "
-    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/include"
 
     BUILD_LDFLAGS="--extra-ldflags=-L$ROOTDIR/curl/lib "
     BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/libffi/lib "
@@ -49,7 +48,6 @@ prepare()
     BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/openssl/lib "
     BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/pixman/lib "
     BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/zlib/lib "
-    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/lib"
 }
 
 modify_files(){
index 2061a48..2ee6038 100755 (executable)
@@ -4,6 +4,8 @@ clean()
 {
        prepare
 
+       export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${ROOTDIR}/libav/lib/pkgconfig
+
        cd $SRCDIR/tizen
        if test -e "Makefile"
        then
@@ -46,12 +48,10 @@ prepare()
 # build
 build()
 {
-       export PKG_CONFIG_PATH=${ROOTDIR}/remote/lib/pkgconfig:${PKG_CONFIG_PATH}
-       BUILD_CFLAGS=--extra-cflags="-I$ROOTDIR/include"
-       BUILD_LDFLAGS=--extra-ldflags="-L$ROOTDIR/lib"
+       export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${ROOTDIR}/remote/lib/pkgconfig:${ROOTDIR}/libav/lib/pkgconfig
 
        cd $SRCDIR/tizen/
-       ./emulator_configure.sh x86 -e "$BUILD_CFLAGS $BUILD_LDFLAGS"
+       ./emulator_configure.sh x86
        make all_dibs
        if [ $? -eq 0 ]
        then
index 2061a48..2ee6038 100755 (executable)
@@ -4,6 +4,8 @@ clean()
 {
        prepare
 
+       export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${ROOTDIR}/libav/lib/pkgconfig
+
        cd $SRCDIR/tizen
        if test -e "Makefile"
        then
@@ -46,12 +48,10 @@ prepare()
 # build
 build()
 {
-       export PKG_CONFIG_PATH=${ROOTDIR}/remote/lib/pkgconfig:${PKG_CONFIG_PATH}
-       BUILD_CFLAGS=--extra-cflags="-I$ROOTDIR/include"
-       BUILD_LDFLAGS=--extra-ldflags="-L$ROOTDIR/lib"
+       export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${ROOTDIR}/remote/lib/pkgconfig:${ROOTDIR}/libav/lib/pkgconfig
 
        cd $SRCDIR/tizen/
-       ./emulator_configure.sh x86 -e "$BUILD_CFLAGS $BUILD_LDFLAGS"
+       ./emulator_configure.sh x86
        make all_dibs
        if [ $? -eq 0 ]
        then
index 63333be..c9cc6c0 100755 (executable)
@@ -32,20 +32,18 @@ prepare()
         echo "and then set installed Python/bin path into PATH system variable on your PC!"
                exit 1
        fi
-
        
        PURIFIED_ROOTDIR=`TEMP=\`echo "${ROOTDIR}" | cut -c-2 | sed "s/[:/]//g" | awk {'print tolower ($_)'}\`; echo \`echo "${ROOTDIR}" | sed "s/^../\/${TEMP}/"\``
        PATH=$PATH:$PURIFIED_ROOTDIR/bin:$PURIFIED_ROOTDIR/apache-ant_1.9.2/bin:$PURIFIED_ROOTDIR/SDL_1.2.15/bin:$PURIFIED_ROOTDIR/gtk-bundle_2.24.10/bin:$PURIFIED_ROOTDIR/libcurl-4_1.0.1/bin:$PURIFIED_ROOTDIR/pixman_0.30.0/bin
        export PATH
 
-       export PKG_CONFIG_PATH=$ROOTDIR/lib/pkgconfig:$ROOTDIR/SDL_1.2.15/lib/pkgconfig:$ROOTDIR/gtk-bundle_2.24.10/lib/pkgconfig:$ROOTDIR/libcurl-4_1.0.1/lib/pkgconfig:$ROOTDIR/pixman_0.30.0/lib/pkgconfig
-       BUILD_CFLAGS=--extra-cflags="-I$ROOTDIR/include "
+       export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ROOTDIR/libav/lib/pkgconfig:$ROOTDIR/SDL_1.2.15/lib/pkgconfig:$ROOTDIR/gtk-bundle_2.24.10/lib/pkgconfig:$ROOTDIR/libcurl-4_1.0.1/lib/pkgconfig:$ROOTDIR/pixman_0.30.0/lib/pkgconfig
+
        BUILD_CFLAGS+=--extra-cflags="-I$ROOTDIR/apache-ant_1.9.2/include "
        BUILD_CFLAGS+=--extra-cflags="-I$ROOTDIR/SDL_1.2.15/include "
        BUILD_CFLAGS+=--extra-cflags="-I$ROOTDIR/gtk-bundle_2.24.10/include "
        BUILD_CFLAGS+=--extra-cflags="-I$ROOTDIR/libcurl-4_1.0.1/include "
        BUILD_CFLAGS+=--extra-cflags="-I$ROOTDIR/pixman_0.30.0/include"
-       BUILD_LDFLAGS=--extra-ldflags="-L$ROOTDIR/lib "
        BUILD_LDFLAGS+=--extra-ldflags="-L$ROOTDIR/apache-ant_1.9.2/lib "
        BUILD_LDFLAGS+=--extra-ldflags="-L$ROOTDIR/SDL_1.2.15/lib "
        BUILD_LDFLAGS+=--extra-ldflags="-L$ROOTDIR/gtk-bundle_2.24.10/lib "
index e846aa5..3124133 100644 (file)
@@ -98,7 +98,6 @@ install: all
 
 # resources and jar for skin
        cp -pP skin/client/emulator-skin.jar $(EMUL_DIR)/bin
-       cp -pP skin/client/lib/swt.jar $(EMUL_DIR)/bin
        cp -pPR skin/client/skins $(EMUL_DIR)
 ifndef CONFIG_USE_SHM
        cp -pP skin/client/resource/images/blank-guide.png $(EMUL_DIR)/images
@@ -157,10 +156,6 @@ ifdef CONFIG_DARWIN
                install_name_tool -change /opt/local/lib/libncurses.5.dylib @loader_path/libncurses.5.dylib $(EMUL_DIR)/bin/emulator-x86 ;\
                install_name_tool -change /opt/local/lib/libcurl.4.dylib @loader_path/libcurl.4.dylib $(EMUL_DIR)/bin/emulator-x86 ;\
                install_name_tool -change /opt/local/lib/libpixman-1.0.dylib @loader_path/libpixman-1.0.dylib $(EMUL_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavformat-emul.54.dylib @loader_path/libavformat-emul.54.dylib $(EMUL_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavcodec-emul.54.dylib @loader_path/libavcodec-emul.54.dylib $(EMUL_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavresample-emul.1.dylib @loader_path/libavresample-emul.1.dylib $(EMUL_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavutil-emul.52.dylib @loader_path/libavutil-emul.52.dylib $(EMUL_DIR)/bin/emulator-x86 ;\
                ;; \
        arm-softmmu) \
                ;; \
@@ -265,10 +260,6 @@ ifdef CONFIG_DARWIN
                install_name_tool -change /opt/local/lib/libncurses.5.dylib @loader_path/libncurses.5.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\
                install_name_tool -change /opt/local/lib/libcurl.4.dylib @loader_path/libcurl.4.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\
                install_name_tool -change /opt/local/lib/libpixman-1.0.dylib @loader_path/libpixman-1.0.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavformat-emul.54.dylib @loader_path/libavformat-emul.54.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavcodec-emul.54.dylib @loader_path/libavcodec-emul.54.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavresample-emul.1.dylib @loader_path/libavresample-emul.1.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\
-               install_name_tool -change .//lib/libavutil-emul.52.dylib @loader_path/libavutil-emul.52.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\
                ;; \
        arm-softmmu) \
                ;; \
index a2a4dd1..ff9d6e5 100644 (file)
@@ -18,7 +18,7 @@ CFLAGS += -g -O0
 endif
 
 # codec
-LIBS+= -lavformat-emul -lavcodec-emul -lavresample-emul -lavutil-emul
+#LIBS+= -lavformat-emul -lavcodec-emul -lavresample-emul -lavutil-emul
 
 ifdef CONFIG_WIN32
 LIBS += -lcurl -lopengl32 -lglu32 -lgdi32 -lpng14
@@ -122,7 +122,8 @@ obj-y += maru_virtio_nfc.o
 obj-y += maru_virtio_jack.o
 obj-y += maru_virtio_power.o
 obj-y += maru_virtio_esm.o
-obj-y += maru_brill_codec.o
+#obj-y += maru_brill_codec.o
+obj-$(CONFIG_LIBAV) += maru_brill_codec.o
 
 obj-$(CONFIG_PCI) += maru_camera_common_pci.o
 obj-$(CONFIG_LINUX) += maru_camera_linux_pci.o
index d3d6d1b..7635aae 100644 (file)
@@ -84,7 +84,9 @@ extern int enable_spice;
 
 #define MAX_IDE_BUS 2
 
+#if defined(CONFIG_LIBAV)
 int maru_brill_codec_pci_device_init(PCIBus *bus);
+#endif
 
 static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
@@ -119,7 +121,9 @@ static void maru_device_init(void)
 
     pci_maru_overlay_init(pci_bus);
     pci_maru_brightness_init(pci_bus);
+#if defined(CONFIG_LIBAV)
     maru_brill_codec_pci_device_init(pci_bus);
+#endif
 
     if (enable_vigs || enable_yagl) {
         render_queue = work_queue_create();