import ConfigParser import sys options = ConfigParser.ConfigParser() options.add_section( "libs" ) options.set( "libs", "dc1394", "no" ) options.set( "libs", "a52", "no" ) options.set( "libs", "xvid", "no" ) options.set( "libs", "x264", "no" ) options.set( "libs", "faad", "no" ) options.read( ["setup.ini"] ) def ffmpeg_flags(): gpl = False flags = [] if options.getboolean( "libs", "dc1394" ): flags += ["--enable-dc1394"] if options.getboolean( "libs", "a52" ): gpl = True flags += ["--enable-a52"] if options.getboolean( "libs", "xvid" ): gpl = True flags += ["--enable-xvid"] if options.getboolean( "libs", "x264" ): gpl = True flags += ["--enable-x264"] if options.getboolean( "libs", "faad" ): gpl = True flags += ["--enable-faad"] if gpl: print >>sys.stderr,"WARNING: License changed to GPL due to inclusion of GPL libraries after reading setup.ini." flags += ["--enable-gpl"] return " ".join( flags ) if __name__ == "__main__": print ffmpeg_flags()