[mythtv] [patch] automagic settings.pro

Daniel Thor Kristjansson danielk at mrl.nyu.edu
Thu Feb 24 15:00:07 UTC 2005


This patch uses our ffmpeg configure script to setup the compile
flags. I've added support for adding pentiumpro, pentium 4, and x86_64
specific -march flags to configure based on the output of `uname -p`
please send the output of `uname -p` for other CPUs so I can 
add these to the configure script.

I've also put all the config options closer to the head of the file
with the dependent defines, libraries, etc below. The arts location
is found using the location of artsc.h; so if it isn't found on your 
distribution, please send me the location of your artsc.h and
working ARTS_LIBS, EXTRA_LIBS, and INCLUDEPATH for your arts 
implementation.

I've also renamed using_opengl to using_opengl_vsync, in anticipation of 
mythui, and I've added using_xvmc_normal so that we can test to make 
sure only one of using_xvmc_vld or using_xvmc_normal is enabled.

-- Daniel
-------------- next part --------------
Index: settings.pro
===================================================================
RCS file: /var/lib/mythcvs/mythtv/settings.pro,v
retrieving revision 1.107
diff -u -r1.107 settings.pro
--- settings.pro	22 Feb 2005 15:09:57 -0000	1.107
+++ settings.pro	24 Feb 2005 14:46:57 -0000
@@ -1,6 +1,12 @@
+#CONFIG += profile
 #CONFIG += debug
 CONFIG += release
 
+profile {
+    CONFIG *= release
+    CONFIG -= debug
+}
+
 isEmpty( PREFIX ) {
     PREFIX = /usr/local
 }
@@ -25,21 +31,21 @@
 }
 
 release {
-    contains(TARGET_ARCH_X86, yes) {
-        DEFINES += MMX
-        QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer
-    }
-    contains(TARGET_ARCH_X86_64, yes) {
-        DEFINES += MMX
-        QMAKE_CXXFLAGS_RELEASE = -O3 -march=k8 -fomit-frame-pointer
-    }
+    QMAKE_CXXFLAGS_RELEASE = $$OPTFLAGS -fomit-frame-pointer
+    contains( TARGET_MMX, yes ):DEFINES += MMX
+
     contains( TARGET_ARCH_POWERPC, yes ) {
         # Do not use -O3, it causes some Qt moc methods to go missing
-        QMAKE_CXXFLAGS_RELEASE = -O2
+        QMAKE_CXXFLAGS_RELEASE = $$OPTFLAGS -O2
     }
     QMAKE_CFLAGS_RELEASE = $${QMAKE_CXXFLAGS_RELEASE}
 }
 
+profile {
+    QMAKE_CXXFLAGS_RELEASE *= -g
+    LIBAVCODEC_CFLAGS *= -g
+}
+
 LOCAL_LIBDIR_X11 =
 !isEmpty( QMAKE_LIBDIR_X11 ) {
     LOCAL_LIBDIR_X11 = -L$$QMAKE_LIBDIR_X11
@@ -55,79 +61,146 @@
     CONFIG  += freebsd backend
 }
 
-# X11 support
-CONFIG += using_x11
-
-# Default Xv support
-CONFIG += using_xv
-EXTRA_LIBS += $$LOCAL_LIBDIR_X11 -lXinerama -lXv -lX11 -lXext -lXxf86vm
+### Input Hardware ###
 
 # IVTV (PVR-x50) support
 CONFIG += using_ivtv
-DEFINES += USING_IVTV
-# Use the installed ivtv header instead of the local copy (needs >= v0.2)
-#DEFINES += USING_IVTV_HEADER
+# DVB support, you may need edit the path to your linux-dvb headers below
+#CONFIG += using_dvb
+# Firewire support
+#CONFIG += using_firewire
 
-# Default audio output, OSS.  
+
+### Sound I/O ###
+
+# Native OSS sound driver support
 # Do NOT disable unless compiling on a non-linux platform.
 CONFIG += using_oss
-
-# Native ALSA support
+# Native ALSA sound driver support
 #CONFIG += using_alsa
-#ALSA_LIBS = -lasound
-
-# Native ARTS support
+# Native ARTS sound server support
 #CONFIG += using_arts
-#ARTS_LIBS = -L/opt/kde3/lib -ldl -lartsc -lpthread
-#EXTRA_LIBS += -L/opt/kde3/lib -ldl -lartsc -lpthread
-#INCLUDEPATH += /opt/kde3/include
-# For Mandrake, use the following:
-#ARTS_LIBS = -ldl -lartsc -lpthread
-#EXTRA_LIBS += -ldl -lartsc -lpthread
-#INCLUDEPATH += /usr/include/artsc
-
-# Native JACK support
+# Native JACK sound server support
 #CONFIG += using_jack
-#JACK_LIBS += -ljack
 
-# DVB support
-#CONFIG += using_dvb
-#DEFINES += USING_DVB
-# Note: INCLUDEPATH should point to the directory with
-#   'linux/dvb/frontend.h', not the directory with frontend.h
-# Note: This _must not_ be your linux kernel source includes.  Copy the dvb
-#       includes into a separate directory for now.
-#INCLUDEPATH += /usr/src/linuxtv-dvb-1.0.1/include
-#define the following if you want On Air Guide information
-#DEFINES += USING_DVB_EIT
 
-# Firewire support
-#CONFIG += using_firewire
-#DEFINES += USING_FIREWIRE
-#EXTRA_LIBS += -lraw1394 -liec61883
+### Remote control I/O ###
 
-# Joystick menu support
+# Native lirc support (infrared remotes)
+#CONFIG += using_lirc
+# Joystick menu support (Linux only)
 CONFIG += using_joystick_menu
 
-# Native lirc support
-#CONFIG += using_lirc
-#LIRC_LIBS = -llirc_client
 
-# XvMC support, modify as necessary.
-#CONFIG += using_xvmc
-#DEFINES += USING_XVMC
-#EXTRA_LIBS += -lXvMCNVIDIA -lXvMC
+### Video Output ###
 
+# X11 support (Network friendly video terminal software)
+CONFIG += using_x11
+# Default Xv support (X11 color conversion acceleration)
+CONFIG += using_xv
+# XvMC support, other than epia (Linux/BSD specific MPEG-2 acceleration)
+#CONFIG += using_xvmc_normal
 # XvMC_VLD support, modify as necessary. Incompatible with normal XvMC support.
 # Used for hardware accelerated decoding on VIA EPIA-M (and other) boards.
-#CONFIG += using_xvmc using_xvmc_vld
-#DEFINES += USING_XVMC USING_XVMC_VLD
-#EXTRA_LIBS += -lviaXvMC -lXvMC
-
-# DirectFB support
+#CONFIG += using_xvmc_vld
+# DirectFB support (Linux non-X11 video output)
 #CONFIG += using_directfb
-#EXTRA_LIBS += `directfb-config --libs`
-#QMAKE_CXXFLAGS += `directfb-config --cflags`
+# DirectX support (MS Windows video output)
+#CONFIG += using_directx
+# OpenGL support for vertical retrace sync
+#CONFIG += using_opengl_vsync
+# Allow use of X11 XrandR to change display resolutions
+#CONFIG += using_xrandr
+
+
+###
+### The configuration options above are implemented below,
+### hopefully you will not need to edit these.
+###
+
+using_alsa {
+    ALSA_LIBS = -lasound
+}
+
+using_arts {
+    exists( /opt/kde3/include/artsc.h ) {
+        # For Debian, use the following:
+        ARTS_LIBS = -L/opt/kde3/lib -ldl -lartsc -lpthread
+        EXTRA_LIBS += -L/opt/kde3/lib -ldl -lartsc -lpthread
+        INCLUDEPATH += /opt/kde3/include
+    }
+    exists( /usr/include/artsc/artsc.h ) {
+        # For Mandrake, use the following:
+        ARTS_LIBS = -ldl -lartsc -lpthread
+        EXTRA_LIBS += -ldl -lartsc -lpthread
+        INCLUDEPATH += /usr/include/artsc
+    }
+    exists( /usr/kde/3.3/include/artsc/artsc.h ) {
+        # For Gentoo, use the following:
+        ARTS_LIBS = -L/usr/kde/3.3/lib -ldl -lartsc -lpthread
+        EXTRA_LIBS += -ldl -lartsc -lpthread
+        INCLUDEPATH += /usr/kde/3.3/include
+    }
+}
+
+using_jack {
+    JACK_LIBS += -ljack
+}
+
+using_ivtv {
+    DEFINES += USING_IVTV
+    # Use the installed ivtv header instead of the local copy (needs >= v0.2)
+    #DEFINES += USING_IVTV_HEADER
+}
+
+using_dvb {
+    DEFINES += USING_DVB
+    # Note: INCLUDEPATH should point to the directory with
+    #   'linux/dvb/frontend.h', not the directory with frontend.h
+    # Note: This _must not_ be your linux kernel source includes.  Copy the dvb
+    #       includes into a separate directory for now.
+    INCLUDEPATH += /usr/src/linuxtv-dvb-1.0.1/include
+    #define the following if you want On Air Guide information
+    #DEFINES += USING_DVB_EIT
+}
+
+using_firewire {
+    DEFINES += USING_FIREWIRE
+    EXTRA_LIBS += -lraw1394 -liec61883
+}
+
+using_lirc {
+    LIRC_LIBS = -llirc_client
+}
+
+using_xv {
+    EXTRA_LIBS += $$LOCAL_LIBDIR_X11 -lXinerama -lXv -lX11 -lXext -lXxf86vm
+}
+
+using_xvmc_vld:using_xvmc_normal {
+        message(You have enabled both normal XvMC and EPIA XvMC.)
+        message(Unfortunately you must pick one.)
+        error(Unsupported configuration)
+    }
+}
+
+using_xvmc_vld {
+    CONFIG += using_xvmc
+    DEFINES += USING_XVMC USING_XVMC_VLD
+    EXTRA_LIBS += -lviaXvMC -lXvMC
+}
+
+using_xvmc_normal {
+    CONFIG += using_xvmc
+    DEFINES += USING_XVMC
+    # change this if using a non-nvidia, non-epia XvMC implementation
+    EXTRA_LIBS += -lXvMCNVIDIA -lXvMC
+}
+
+using_directfb {
+    EXTRA_LIBS += `directfb-config --libs`
+    QMAKE_CXXFLAGS += `directfb-config --cflags`
+}
 
 # Windows support
 win32 {
@@ -146,18 +219,18 @@
     }
 }
 
-# DirectX support
-#CONFIG += using_directx
-#DEFINES += USING_DIRECTX
+using_directx {
+    DEFINES += USING_DIRECTX
+}
 
-# OpenGL support for vertical retrace sync
-#DEFINES += USING_OPENGL_VSYNC
-#EXTRA_LIBS += -lGL -lGLU
-#CONFIG += using_opengl
+using_opengl_vsync {
+    DEFINES += USING_OPENGL_VSYNC
+    EXTRA_LIBS += -lGL -lGLU
+}
 
-# Allow use of XrandR to change display resolutions
-#CONFIG += using_xrandr
-#DEFINES += USING_XRANDR
+using_xrandr {
+    DEFINES += USING_XRANDR
+}
 
 ################################################################
 # Please keep these CONFIG blocks as the last part of this file!
Index: configure
===================================================================
RCS file: /var/lib/mythcvs/mythtv/configure,v
retrieving revision 1.31
diff -u -r1.31 configure
--- configure	8 Jan 2005 16:48:12 -0000	1.31
+++ configure	24 Feb 2005 14:46:58 -0000
@@ -92,6 +92,7 @@
 make="make"
 strip="strip"
 cpu=`uname -m`
+processor=`uname -p`
 tune="generic"
 powerpc_perf="no"
 mmx="default"
@@ -616,6 +617,18 @@
     esac
 fi
 
+if test $tune == "generic" -a $cpu == "x86"; then
+   if expr "$processor" : "Intel(R) Pentium(R) 4" > /dev/null ; then
+       CFLAGS="$CFLAGS -march=pentium4"
+   elif expr "$processor" : "AMD Athlon(tm) XP" > /dev/null ; then
+       CFLAGS="$CFLAGS -march=pentiumpro -mmmx"
+   elif test `uname -m` = "i686"; then
+       CFLAGS="$CFLAGS -march=pentiumpro"
+   fi
+elif test $tune == "generic" -a $cpu == "x86_64"; then
+   CFLAGS="$CFLAGS -march=k8"
+fi
+
 # AltiVec flags: The FSF version of GCC differs from the Apple version 
 if test $cpu = "powerpc"; then
     if test $altivec = "yes"; then
Index: libs/libmythtv/libmythtv.pro
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/libmythtv.pro,v
retrieving revision 1.86
diff -u -r1.86 libmythtv.pro
--- libs/libmythtv/libmythtv.pro	2 Feb 2005 07:11:10 -0000	1.86
+++ libs/libmythtv/libmythtv.pro	24 Feb 2005 14:46:58 -0000
@@ -146,7 +146,7 @@
     HEADERS += videoout_dx.h
 }
 
-using_opengl {
+using_opengl_vsync {
     CONFIG += opengl
 }
 


More information about the mythtv-dev mailing list