|
- #
- # Copyright (C) 2007 Arnold Krille
- # Copyright (C) 2007 Pieter Palmers
- #
- # This file originally was part of FFADO
- #
- # This program is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
- #
-
- import os
- import glob
- from string import Template
-
- Import( 'env' )
-
- # paths where include files can be found
- env.AppendUnique( CPPPATH=["#/", "#/common", "#/common/jack"] )
-
- # HACK: this should not be here ideally
- env.AppendUnique( CPPPATH=["#/linux","#/macosx"] )
-
- # a symlinking command
- symlinkcmd = 'cd $TARGET.dir && rm -f -v $TARGET.name && ln -v -s $SOURCE.name $TARGET.name'
-
- #
- # Define the source files
- #
-
- srcfiles_common_serverlib = [
- 'JackActivationCount.cpp',
- 'JackAPI.cpp',
- 'JackAudioDriver.cpp',
- 'JackClient.cpp',
- 'JackConnectionManager.cpp',
- 'JackDriver.cpp',
- 'JackEngine.cpp',
- 'JackEngineControl.cpp',
- 'JackError.c',
- 'JackExternalClient.cpp',
- 'JackFrameTimer.cpp',
- 'JackFreewheelDriver.cpp',
- 'JackGlobalsServer.cpp',
- 'JackGraphManager.cpp',
- 'JackInternalClient.cpp',
- 'JackPort.cpp',
- 'JackPosixSemaphore.cpp',
- 'JackPosixThread.cpp',
- 'JackFifo.cpp',
- 'JackLoopbackDriver.cpp',
- 'JackPortType.cpp',
- 'JackAudioPort.cpp',
- 'JackMidiPort.cpp',
- 'JackMidiAPI.cpp',
- 'JackServer.cpp',
- 'JackShmMem.cpp',
- 'JackThreadedDriver.cpp',
- 'shm.c',
- 'JackSocket.cpp',
- 'JackSocketServerChannel.cpp',
- 'JackSocketNotifyChannel.cpp',
- 'JackSocketServerNotifyChannel.cpp',
- 'JackTime.c',
- 'JackServerAPI.cpp',
- 'JackGlobals.cpp',
- 'JackDriverLoader.cpp',
- 'JackDebugClient.cpp',
- 'JackTransportEngine.cpp',
- 'JackServerGlobals.cpp',
- 'JackServerLaunch.cpp',
- 'timestamps.c',
- 'JackTools.cpp',
- 'ringbuffer.c'
- ]
-
- srcfiles_common_clientlib = [
- 'JackActivationCount.cpp',
- 'JackAPI.cpp',
- 'JackClient.cpp',
- 'JackConnectionManager.cpp',
- 'ringbuffer.c',
- 'JackServerLaunch.cpp',
- 'JackError.c',
- 'JackFrameTimer.cpp',
- 'JackGlobalsClient.cpp',
- 'JackGraphManager.cpp',
- 'JackLibClient.cpp',
- 'JackLibAPI.cpp',
- 'JackPort.cpp',
- 'JackPosixSemaphore.cpp',
- 'JackFifo.cpp',
- 'JackPortType.cpp',
- 'JackAudioPort.cpp',
- 'JackMidiPort.cpp',
- 'JackMidiAPI.cpp',
- 'JackEngineControl.cpp',
- 'JackPosixThread.cpp',
- 'JackShmMem.cpp',
- 'shm.c',
- 'JackSocket.cpp',
- 'JackSocketClientChannel.cpp',
- 'JackTime.c',
- 'JackGlobals.cpp',
- 'JackDebugClient.cpp',
- 'JackTransportEngine.cpp',
- 'timestamps.c',
- 'JackTools.cpp'
- ]
-
- srcfiles_common_wrapperlib = [
- 'JackAPIWrapper.cpp',
- 'ringbuffer.c'
- ]
-
- jack_headers = [
- 'intclient.h',
- 'jack.h',
- 'midiport.h',
- 'ringbuffer.h',
- 'statistics.h',
- 'thread.h',
- 'transport.h',
- 'types.h'
- ]
-
- #
- # Start building
- #
-
- env.AppendUnique( LIBS=["rt", "pthread"] )
-
- # build the common stuff
- if env['PLATFORM'] == 'posix':
- env.AppendUnique( SHLIBSUFFIX=".0.0" )
- clientlib_name = "jackmp"
- serverlib_name = "jackservermp"
- wrapperlib_name = "jackwrapper"
- clientlib = env.SharedLibrary( clientlib_name, srcfiles_common_clientlib )
- serverlib = env.SharedLibrary( serverlib_name, srcfiles_common_serverlib )
- wrapperlib = env.SharedLibrary( wrapperlib_name, srcfiles_common_wrapperlib )
- env.Install( env['libdir'], [clientlib, serverlib, wrapperlib])
- env.Alias("install", env['libdir'])
- if env['PLATFORM'] == 'posix':
- for lib_name, lib in [(clientlib_name, clientlib), (serverlib_name, serverlib), (wrapperlib_name, wrapperlib)]:
- env.Command('lib' + lib_name + '.so.0', lib, symlinkcmd)
- env.Command('lib' + lib_name + '.so', 'lib'+lib_name+'.so.0', symlinkcmd)
- env.Command(env['libdir'] + '/lib' + lib_name + '.so.0', env['libdir'] + '/lib' + lib_name + '.so.0.0', symlinkcmd)
- env.Command(env['libdir'] + '/lib' + lib_name + '.so', env['libdir'] + '/lib' + lib_name + '.so.0', symlinkcmd)
- env.Alias("install", env['libdir'] + '/lib' + lib_name + '.so.0')
- env.Alias("install", env['libdir'] + '/lib' + lib_name + '.so')
-
- # install the headers
- for header in jack_headers:
- env.Install(env['includedir'] + '/jack', 'jack/' + header)
- env.Alias("install", env['includedir'])
- #if env['JACK_FLAGS']:
- #jack_include_dir = env['JACK_INCLUDEDIR']
- #if 'install' in COMMAND_LINE_TARGETS and os.path.isdir( jack_include_dir ):
- #if env.GetOption('clean'):
- #pass
- #else:
- #jack_old_includes_dir = env['includedir'] + '/jack_up'
- #print "moving old jack includes to %s..." % jack_old_includes_dir
- #env.Command(jack_old_includes_dir, jack_include_dir, Move("$TARGET", "$SOURCE"))
-
- # install the libs
- #jack_libdir = env['JACK_LIBDIR']
- #libjackdmp_location = env['libdir'] + '/libjackmp.so'
- #if 'install' in COMMAND_LINE_TARGETS and os.path.isdir( jack_libdir ):
- #if env.GetOption('clean'):
- #note: is this executed before the actual uninstall?
- #lib_files = glob.glob(jack_libdir + '/libjack.so.*.up')
- #for old_name in lib_files:
- #new_name = old_name[:-3]
- #print "restoring old jack lib %s to %s..." % (old_name, new_name)
- #env.Command(Delete(new_name))
- #env.Command(new_name, old_name, Move("$TARGET", "$SOURCE"))
- #else:
- #lib_files = glob.glob(jack_libdir + '/libjack.so.*')
- #env.Alias("install", env.Install(env['libdir'], serverlib))
- #env.Alias("install", env.Install(env['libdir'], clientlib))
- #for old_name in lib_files:
- #new_name = old_name + '.up'
- #print "moving old jack lib %s to %s..." % (old_name, new_name)
- #env.Command(new_name, old_name, Move("$TARGET", "$SOURCE"))
- #print " linking to %s..." % (libjackdmp_location)
- #env.Command(old_name, libjackdmp_location, "ln -s $TARGET $SOURCE")
|