Commit ecfae1bf authored by Jan Gerber's avatar Jan Gerber
Browse files

options and install in scons script

parent 383a9cc2
......@@ -23,18 +23,26 @@ point to your ffmpeg source:
export PKG_CONFIG_PATH=/path/to/ffmpeg_src:$PKG_CONFIG_PATH
now you can build ffmpeg2theora:
./configure
make
scons
to make a static binary
scons static=1
Installation
------------
install ffmpeg2theora in /usr/local/bin:
scons install
Unless you specify a different prefix,
you will need root privileges for this, ie.:
make install
sudo scons install
Unless you specify a different --prefix option to ./configure, you will
need root privileges for this, ie.:
to install to another prefix:
sudo make install
scons install prefix=/usr
vhook suppport
--------------
......
......@@ -8,21 +8,40 @@ import SCons
pkg_version="0.21+svn"
pkg_name="ffmpeg2theora"
#parse config variables
static = False
opts = Options()
opts.AddOptions(
BoolOption('static', 'Set to 1 for static linking', 0),
('prefix', 'install architecture-independent files in', '/usr/local'),
('bindir', 'user executables', 'PREFIX/bin'),
('mandir', 'man documentation', 'PREFIX/man'),
('destdir', 'extra install time prefix', ''),
('APPEND_CCFLAGS', 'Additional C/C++ compiler flags'),
('APPEND_LINKFLAGS', 'Additional linker flags')
)
env = Environment(options = opts)
Help(opts.GenerateHelpText(env))
env = Environment()
pkg_flags="--cflags --libs"
if static:
if env['static']:
pkg_flags+=" --static"
env.Append(LINKFLAGS=["-static"])
prefix = env['prefix']
if env['destdir']:
if prefix.startswith('/'): prefix = prefix[1:]
prefix = os.path.join(env['destdir'], prefix)
man_dir = env['mandir'].replace('PREFIX', prefix)
bin_dir = env['bindir'].replace('PREFIX', prefix)
env.Append(CPPPATH=['.'])
env.Append(CCFLAGS=[
'-DPACKAGE_VERSION=\\"%s\\"' %pkg_version,
'-DPACKAGE_STRING=\\"%s-%s\\"' %(pkg_name, pkg_version),
'-DPACKAGE_VERSION=\\"%s\\"' % pkg_version,
'-DPACKAGE_STRING=\\"%s-%s\\"' % (pkg_name, pkg_version),
'-DPACKAGE=\\"%s\\"' % pkg_name,
])
env.Append(CCFLAGS = Split('$APPEND_CCFLAGS'))
env.Append(LINKFLAGS = Split('$APPEND_LINKFLAGS'))
#if env['CC'] == 'gcc':
# env.Append(CCFLAGS=["-g", "-O2", "-Wall"])
......@@ -90,3 +109,8 @@ env = conf.Finish()
ffmpeg2theora = env.Copy()
ffmpeg2theora_sources = glob('src/*.c')
ffmpeg2theora.Program('ffmpeg2theora', ffmpeg2theora_sources)
ffmpeg2theora.Install(bin_dir, 'ffmpeg2theora')
ffmpeg2theora.Install(man_dir + "/man1", 'ffmpeg2theora.1')
ffmpeg2theora.Alias('install', prefix)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment