# Kbtv build script, version 1.2.5 import sys, os, commands # Note: this runs do_configure from do_configure import CC, KDEPYUIC, MEINPROC, PY_COMPILE, PY_INCDIR, \ MAKE, SWIG, PATCH, SDLCONF import buildprefs if not os.access(".", os.W_OK): print "No write access. Stop." sys.exit(1) print "Building bt848 Python module..." os.chdir("bt848") cmds = [] cmds.append(SWIG + " -python bt848.h") cmds.append(CC + " -c -fPIC bt848.c bt848_wrap.c `" + SDLCONF + " --cflags` -I" + PY_INCDIR) cmds.append(CC + " -shared bt848.o bt848_wrap.o `" + SDLCONF + " --libs` -o _bt848.so") for item in cmds: print item, commands.getoutput(item) os.chdir("..") if buildprefs.WITH_PWC: os.chdir("pwc") print "Building pwc driver..." os.chdir("pwcbsd") patches = os.listdir("../patches") if patches: for p in patches: cmd = PATCH + " < " + os.path.join("../patches", p) print cmd print commands.getoutput(cmd) print commands.getoutput(MAKE) os.chdir("..") print "Building pwc Python module..." cmds = [] cmds.append(SWIG + " -python pwc.h") cmds.append(CC + " -c -fPIC pwc.c pwc_wrap.c `" + SDLCONF + " --cflags` -I" + PY_INCDIR) cmds.append(CC + " -shared pwc.o pwc_wrap.o `" + SDLCONF + " --libs` -o _pwc.so") for item in cmds: print item, commands.getoutput(item) os.chdir("..") if buildprefs.WITH_SAA: os.chdir("saa") print "Building saa driver..." os.chdir("saadriver") patches = os.listdir("../patches") if patches: for p in patches: cmd = PATCH + " < " + os.path.join("../patches", p) print cmd print commands.getoutput(cmd) print commands.getoutput(MAKE) os.chdir("..") include = "\n" if buildprefs.SAA_TUNER == buildprefs.SAA_TUNER_PHILIPS_MK3: include += "#define TUNER_API TUNER_API_PHILIPS_MK3\n" elif buildprefs.SAA_TUNER == buildprefs.SAA_TUNER_LG: include += "#define TUNER_API TUNER_API_LG\n" elif buildprefs.SAA_TUNER == buildprefs.SAA_TUNER_ALPS: include += "#define TUNER_API TUNER_API_ALPS\n" elif buildprefs.SAA_TUNER == buildprefs.SAA_TUNER_TEMIC: include += "#define TUNER_API TUNER_API_TEMIC\n" else: include += "#define TUNER_API TUNER_API_PHILIPS\n" if buildprefs.SAA_TUNER_STD == buildprefs.SAA_TUNER_STD_NTSC: include += "#define TV_STD TV_STD_NTSC\n" elif buildprefs.SAA_TUNER_STD == buildprefs.SAA_TUNER_STD_NTSC_JAPAN: include += "#define TV_STD TV_STD_NTSC_JAPAN\n" elif buildprefs.SAA_TUNER_STD == buildprefs.SAA_TUNER_STD_PAL_I: include += "#define TV_STD TV_STD_PAL_I\n" elif buildprefs.SAA_TUNER_STD == buildprefs.SAA_TUNER_STD_PAL_L: include += "#define TV_STD TV_STD_PAL_L\n" elif buildprefs.SAA_TUNER_STD == buildprefs.SAA_TUNER_STD_PAL_LACCENT: include += "#define TV_STD TV_STD_PAL_LACCENT\n" elif buildprefs.SAA_TUNER_STD == buildprefs.SAA_TUNER_STD_PAL_D_K: include += "#define TV_STD TV_STD_PAL_D_K\n" else: include += "#define TV_STD TV_STD_PAL_B_G\n" fd = open("saa_var.h", "a") fd.write(include) fd.close() print "Building saa Python module..." cmds = [] cmds.append(SWIG + " -python saa.h") cmds.append(CC + " -c -fPIC saa.c saa_wrap.c `" + SDLCONF + " --cflags` -I" + PY_INCDIR) cmds.append(CC + " -shared saa.o saa_wrap.o `" + SDLCONF + " --libs` -o _saa.so") for item in cmds: print item, commands.getoutput(item) os.chdir("..") print "Generating UI modules from Designer forms..." os.chdir("ui") cmds = [] for item in os.listdir("."): if item.endswith(".ui"): cmds.append(KDEPYUIC + " " + item) for item in cmds: print item, commands.getoutput(item) print "Byte compiling all python modules..." print commands.getoutput(PY_COMPILE + " .") os.chdir("../bt848") print commands.getoutput(PY_COMPILE + " .") if buildprefs.WITH_PWC: os.chdir("../pwc") print commands.getoutput(PY_COMPILE + " .") if buildprefs.WITH_SAA: os.chdir("../saa") print commands.getoutput(PY_COMPILE + " .") os.chdir("../modules") print commands.getoutput(PY_COMPILE + " .") os.chdir("../Kbtv") print commands.getoutput(PY_COMPILE + " .") print "Building kbtv handbook ..." os.chdir("../doc") cmds = [] for item in os.listdir("."): os.chdir(item) print item, ":", MEINPROC, "index.docbook", commands.getoutput(MEINPROC + " index.docbook") print item, ":", MEINPROC, "--cache index.cache.bz2 index.docbook", commands.getoutput(MEINPROC + " --cache index.cache.bz2 index.docbook") os.chdir("..") os.chdir("..")