[mythtv] [patch] automagic settings.pro

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


On Thu, 24 Feb 2005, Jeremiah Morris wrote:
]On Feb 24, 2005, at 10:00 AM, Daniel Thor Kristjansson wrote:
]Let me draw your attention to my patch for doing audio detection in the ffmpeg
]configure script:
]
]http://www.gossamer-threads.com/lists/mythtv/dev/108824

Ok, I've added your audio support detection rutines to the configure 
script. I made a small modification, if `artsc-config --cflags` 
includes the substring "include/artsc", I replace it with "include". 
This lets us to continue using <artsc/artsc.h> to include artsc.h on 
all platforms.

I've also moved all the compile flag stuff to below the CONFIG options 
in settings.pro, since most people shouldn't need to edit those anymore.

-- Daniel
-------------- next part --------------
Index: configure
===================================================================
RCS file: /var/lib/mythcvs/mythtv/configure,v
retrieving revision 1.31
diff -r1.31 configure
45c45,48
< #echo "  --disable-audio-oss      disable OSS audio support [default=no]"
---
> echo "  --disable-audio-oss      disable OSS audio support [default=no]"
> echo "  --disable-audio-alsa     disable ALSA audio support [default=no]"
> echo "  --disable-audio-arts     disable aRts audio support [default=no]"
> echo "  --disable-audio-jack     disable JACK audio support [default=no]"
94a98
> processor=`uname -p`
140a145,147
> audio_alsa="yes"
> audio_arts="yes"
> audio_jack="yes"
213d219
< audio_oss="no"
229d234
< audio_oss="no"
239d243
< audio_oss="yes"
247d250
< audio_oss="yes"
255d257
< audio_oss="no"
272d273
< audio_oss="yes"
288d288
< audio_oss="no"
307d306
< audio_oss="no"
387a387,392
>   --disable-audio-alsa) audio_alsa="no"
>   ;;
>   --disable-audio-arts) audio_arts="no"
>   ;;
>   --disable-audio-jack) audio_jack="no"
>   ;;
618a624,635
> 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
> 
1019a1037,1114
> ##########################################
> # OSS probe
> 
> if test "$audio_oss" = "yes" ; then
> 
> cat > $TMPC << EOF
> #include <sys/ioctl.h>
> #include <sys/soundcard.h>
> int main(void) { return (int) EV_SEQ_LOCAL; }
> EOF
> 
> audio_oss=no
> if $cc -o $TMPE $TMPC > /dev/null 2>&1; then
> audio_oss=yes
> fi
> 
> fi
> 
> ##########################################
> # ALSA probe
> 
> if test "$audio_alsa" = "yes" ; then
> 
> cat > $TMPC << EOF
> #include <alsa/asoundlib.h>
> int main(void) { return (int) SND_LIB_MAJOR; }
> EOF
> 
> audio_alsa=no
> audio_alsa_libs="-lasound"
> if $cc -o $TMPE $TMPC $audio_alsa_libs > /dev/null 2>&1; then
> audio_alsa=yes
> fi
> 
> fi
> 
> ##########################################
> # aRts probe
> 
> if test "$audio_arts" = "yes" ; then
> 
> cat > $TMPC << EOF
> #include <artsc/artsc.h>
> int main(void) { return (int) ARTS_P_BUFFER_SIZE; }
> EOF
> 
> audio_arts=no
> if (artsc-config --version) > /dev/null 2>&1; then
> audio_arts_libs=`artsc-config --libs`
> audio_arts_tmp=`artsc-config --cflags`
> audio_arts_cflags=`echo $audio_arts_tmp | sed "s/include\/artsc/include/g"`
> if $cc -o $TMPE $TMPC $audio_arts_cflags $audio_arts_libs > /dev/null 2>&1; then
> audio_arts=yes
> fi
> fi
> 
> fi
> 
> ##########################################
> # JACK probe
> 
> if test "$audio_jack" = "yes" ; then
> 
> cat > $TMPC << EOF
> #include <jack/jack.h>
> int main(void) { return (int) JACK_MAX_FRAMES; }
> EOF
> 
> audio_jack=no
> audio_jack_libs="-ljack"
> if $cc -o $TMPE $TMPC $audio_jack_libs > /dev/null 2>&1; then
> audio_jack=yes
> fi
> 
> fi
> 
> 
> 
1112c1207,1210
< 
---
> echo "OSS support      $audio_oss"
> echo "ALSA support     $audio_alsa"
> echo "aRts support     $audio_arts"
> echo "JACK support     $audio_jack"
1348a1447,1465
> if test "$audio_alsa" = "yes" ; then
>   echo "#define CONFIG_AUDIO_ALSA 1" >> $TMPH
>   echo "CONFIG_AUDIO_ALSA=yes" >> config.mak
>   echo "CONFIG_AUDIO_ALSA_LIBS=$audio_alsa_libs" >> config.mak
> fi
> 
> if test "$audio_arts" = "yes" ; then
>   echo "#define CONFIG_AUDIO_ARTS 1" >> $TMPH
>   echo "CONFIG_AUDIO_ARTS=yes" >> config.mak
>   echo "CONFIG_AUDIO_ARTS_LIBS=$audio_arts_libs" >> config.mak
>   echo "CONFIG_AUDIO_ARTS_CFLAGS=$audio_arts_cflags" >> config.mak
> fi
> 
> if test "$audio_jack" = "yes" ; then
>   echo "#define CONFIG_AUDIO_JACK 1" >> $TMPH
>   echo "CONFIG_AUDIO_JACK=yes" >> config.mak
>   echo "CONFIG_AUDIO_JACK_LIBS=$audio_jack_libs" >> config.mak
> fi
> 
1536a1654
> 
Index: settings.pro
===================================================================
RCS file: /var/lib/mythcvs/mythtv/settings.pro,v
retrieving revision 1.107
diff -r1.107 settings.pro
0a1,3
> ### Compile release, profile or debug version (pick one) ###
> 
> #CONFIG += profile
3a7,56
> 
> ### Input Hardware ###
> 
> # IVTV (PVR-x50) support
> CONFIG += using_ivtv
> # DVB support, you may need edit the path to your linux-dvb headers below
> #CONFIG += using_dvb
> # Firewire support
> #CONFIG += using_firewire
> 
> 
> ### Remote control I/O ###
> 
> # Native lirc support (infrared remotes)
> #CONFIG += using_lirc
> # Joystick menu support (Linux only)
> CONFIG += using_joystick_menu
> 
> 
> ### 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_vld
> # DirectFB support (Linux non-X11 video output)
> #CONFIG += using_directfb
> # 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.
> ###
> 
> profile {
>     CONFIG *= release
>     CONFIG -= debug
> }
> 
28,35c81,83
<     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
> 
38c86
<         QMAKE_CXXFLAGS_RELEASE = -O2
---
>         QMAKE_CXXFLAGS_RELEASE = $$OPTFLAGS -O2
42a91,95
> profile {
>     QMAKE_CXXFLAGS_RELEASE *= -g
>     LIBAVCODEC_CFLAGS *= -g
> }
> 
58,59c111,113
< # X11 support
< CONFIG += using_x11
---
> using_alsa {
>     ALSA_LIBS = -lasound
> }
61,63c115,134
< # Default Xv support
< CONFIG += using_xv
< EXTRA_LIBS += $$LOCAL_LIBDIR_X11 -lXinerama -lXv -lX11 -lXext -lXxf86vm
---
> 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
>     }
> }
65,91c136,138
< # 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
< 
< # Default audio output, OSS.  
< # Do NOT disable unless compiling on a non-linux platform.
< CONFIG += using_oss
< 
< # Native ALSA support
< #CONFIG += using_alsa
< #ALSA_LIBS = -lasound
< 
< # Native ARTS 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
< #CONFIG += using_jack
< #JACK_LIBS += -ljack
---
> using_jack {
>     JACK_LIBS += -ljack
> }
93,102c140,144
< # 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
---
> using_ivtv {
>     DEFINES += USING_IVTV
>     # Use the installed ivtv header instead of the local copy (needs >= v0.2)
>     #DEFINES += USING_IVTV_HEADER
> }
104,107c146,155
< # Firewire support
< #CONFIG += using_firewire
< #DEFINES += USING_FIREWIRE
< #EXTRA_LIBS += -lraw1394 -liec61883
---
> 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 += /cvs/myth/dvb-kernel/linux/include
>     #define the following if you want On Air Guide information
>     #DEFINES += USING_DVB_EIT
> }
109,110c157,160
< # Joystick menu support
< CONFIG += using_joystick_menu
---
> using_firewire {
>     DEFINES += USING_FIREWIRE
>     EXTRA_LIBS += -lraw1394 -liec61883
> }
112,114c162,168
< # Native lirc support
< #CONFIG += using_lirc
< #LIRC_LIBS = -llirc_client
---
> using_lirc {
>     LIRC_LIBS = -llirc_client
> }
> 
> using_xv {
>     EXTRA_LIBS += $$LOCAL_LIBDIR_X11 -lXinerama -lXv -lX11 -lXext -lXxf86vm
> }
116,119c170,175
< # XvMC support, modify as necessary.
< #CONFIG += using_xvmc
< #DEFINES += USING_XVMC
< #EXTRA_LIBS += -lXvMCNVIDIA -lXvMC
---
> 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)
>     }
> }
121,125c177,181
< # 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
---
> using_xvmc_vld {
>     CONFIG += using_xvmc
>     DEFINES += USING_XVMC USING_XVMC_VLD
>     EXTRA_LIBS += -lviaXvMC -lXvMC
> }
127,130c183,192
< # DirectFB support
< #CONFIG += using_directfb
< #EXTRA_LIBS += `directfb-config --libs`
< #QMAKE_CXXFLAGS += `directfb-config --cflags`
---
> using_xvmc_normal {
>     CONFIG += using_xvmc
>     DEFINES += USING_XVMC
>     EXTRA_LIBS += -lXvMCNVIDIA -lXvMC
> }
> 
> using_directfb {
>     EXTRA_LIBS += `directfb-config --libs`
>     QMAKE_CXXFLAGS += `directfb-config --cflags`
> }
149,151c211,213
< # DirectX support
< #CONFIG += using_directx
< #DEFINES += USING_DIRECTX
---
> using_directx {
>     DEFINES += USING_DIRECTX
> }
153,156c215,218
< # 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
> }
158,160c220,222
< # Allow use of XrandR to change display resolutions
< #CONFIG += using_xrandr
< #DEFINES += USING_XRANDR
---
> using_xrandr {
>     DEFINES += USING_XRANDR
> }
175d236
<     CONFIG     -= using_oss
184d244
<     CONFIG     -= using_oss
Index: libs/libmythtv/libmythtv.pro
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/libmythtv.pro,v
retrieving revision 1.86
diff -r1.86 libmythtv.pro
149c149
< using_opengl {
---
> using_opengl_vsync {


More information about the mythtv-dev mailing list