Browse Source

Convert to meson

tags/v1.3
Nils 5 years ago
parent
commit
e431cd55ae
18 changed files with 26 additions and 397 deletions
  1. +2
    -4
      .gitignore
  2. +20
    -0
      meson.build
  3. +0
    -1
      nonlib/nonlib
  4. +0
    -22
      nonlib/wscript
  5. +0
    -56
      session-manager/wscript
  6. +0
    -0
      src/Endpoint.cpp
  7. +0
    -0
      src/Endpoint.hpp
  8. +0
    -0
      src/Thread.cpp
  9. +0
    -0
      src/Thread.hpp
  10. +0
    -0
      src/debug.cpp
  11. +0
    -0
      src/debug.h
  12. +0
    -0
      src/file.cpp
  13. +0
    -0
      src/file.h
  14. +0
    -0
      src/jackpatch.c
  15. +0
    -0
      src/nsm.h
  16. +4
    -4
      src/nsmd.cpp
  17. +0
    -172
      waf
  18. +0
    -138
      wscript

+ 2
- 4
.gitignore View File

@@ -4,8 +4,6 @@
*.[ao] *.[ao]
TAGS TAGS
.nfs* .nfs*
.waf*
build build
attic
.lock-waf_linux_build
tools.waf/__pycache__/
builddir
subprojects

+ 20
- 0
meson.build View File

@@ -0,0 +1,20 @@
project('new-session-manager', 'c', 'cpp', version : '1.3.0', license : 'GPLv3')

liblodep = dependency('liblo') #and not 'lo'
threaddep = dependency('threads')
jackdep = dependency('jack') #and not 'libjack'

executable('nsmd',
sources: ['src/nsmd.cpp', 'src/debug.cpp', 'src/Endpoint.cpp', 'src/file.cpp', 'src/Thread.cpp'],
dependencies: [liblodep, threaddep],
install: true,
)

executable('jackpatch',
'src/jackpatch.c',
dependencies: [liblodep, jackdep],
install: true,
)




+ 0
- 1
nonlib/nonlib View File

@@ -1 +0,0 @@
.

+ 0
- 22
nonlib/wscript View File

@@ -1,22 +0,0 @@
#!/usr/bin/env python

def options(opt):
pass

def configure(conf):
pass

def build(bld):
#Thread is needed by OSC/Endpoint
#File is for nsmd lockfiles
bld.stlib(
source = '''
OSC/Endpoint.cpp
Thread.cpp
debug.cpp
file.cpp
''',
includes = '.',
export_incdirs = [ '.', 'nonlib'],
uselib = 'LIBLO JACK PTHREAD',
target = 'nonlib')

+ 0
- 56
session-manager/wscript View File

@@ -1,56 +0,0 @@
#!/usr/bin/env python
import subprocess
import waflib.Options as Options
import string
import os

# Version of this package (even if built as a child)
PACKAGE_VERSION = '1.2.0'

# Variables for 'waf dist'
APPNAME = 'non-session-manager'
VERSION = PACKAGE_VERSION

# Mandatory variables
top = '.'
out = 'build'

def options(opt):
opt.load('compiler_c')
opt.load('compiler_cxx')
opt.load('gnu_dirs')

def configure(conf):
conf.load('compiler_c')
conf.load('compiler_cxx')
conf.load('gnu_dirs')

conf.define('VERSION', PACKAGE_VERSION)

conf.write_config_header('config.h', remove=False)

print('')

def build(bld):

libs = ''

bld.program( source = '''
src/nsmd.cpp
''',
target = 'nsmd',
includes = ['.', 'src', '../nonlib'],
uselib = [ 'LIBLO' ],
use = [ 'nonlib'],
install_path = '${BINDIR}')

bld.program( source = '''
src/jackpatch.c
''',
target = 'jackpatch',
includes = ['.', 'src'],
uselib = [ 'LIBLO', 'JACK' ],
install_path = '${BINDIR}')




nonlib/OSC/Endpoint.cpp → src/Endpoint.cpp View File


nonlib/OSC/Endpoint.hpp → src/Endpoint.hpp View File


nonlib/Thread.cpp → src/Thread.cpp View File


nonlib/Thread.hpp → src/Thread.hpp View File


nonlib/debug.cpp → src/debug.cpp View File


nonlib/debug.h → src/debug.h View File


nonlib/file.cpp → src/file.cpp View File


nonlib/file.h → src/file.h View File


session-manager/src/jackpatch.c → src/jackpatch.c View File


nonlib/nsm.h → src/nsm.h View File


session-manager/src/nsmd.cpp → src/nsmd.cpp View File

@@ -17,9 +17,9 @@
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*******************************************************************************/ /*******************************************************************************/


#define __MODULE__ "nsmd"
#define __MODULE__ "nsmd"


//debug.C has only one function that gets used multiple times by debug.H and for logging and printing
//debug.c has only one function that gets used multiple times by debug.h and for logging and printing
#include "debug.h" #include "debug.h"


#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
@@ -46,7 +46,7 @@
#include <getopt.h> #include <getopt.h>
#include <sys/time.h> #include <sys/time.h>


#include <OSC/Endpoint.hpp>
#include "Endpoint.hpp"
/* for locking */ /* for locking */
#include "file.h" #include "file.h"


@@ -81,7 +81,7 @@ static char *session_root;
#define ERR_SESSION_LOCKED -11 #define ERR_SESSION_LOCKED -11
#define ERR_OPERATION_PENDING -12 #define ERR_OPERATION_PENDING -12


#define APP_TITLE "Non Session Manager"
#define APP_TITLE "New Session Manager"


enum { enum {
COMMAND_NONE = 0, COMMAND_NONE = 0,

+ 0
- 172
waf
File diff suppressed because it is too large
View File


+ 0
- 138
wscript View File

@@ -1,138 +0,0 @@
#!/usr/bin/env python
import os
import subprocess
import waflib.Logs as Logs, waflib.Options as Options
import string

VERSION = 'xxx'
APPNAME = 'non-things'

top = '.'
out = 'build'

common = [ 'nonlib']
projects = [ 'session-manager' ]

def options(opt):
# opt.add_option('--use-system-ntk', action='store_true', default=False,
# dest='use_system_ntk',
# help="Link to system-installed shared NTK instead of bundled version")
opt.add_option('--enable-debug', action='store_true', default=False, dest='debug',
help='Build for debugging')
opt.add_option('--disable-sse', action='store_false', default=True, dest='sse',
help='Disable SSE optimization')
opt.add_option('--project', action='store', default=False, dest='project',
help='Limit build to a single project (' + ', '.join( projects ) + ')')

for i in projects:
opt.recurse(i)
def configure(conf):
conf.load('compiler_c')
conf.load('compiler_cxx')
conf.load('gnu_dirs')
conf.load('gccdeps')
conf.line_just = 52

conf.env['LIB_PTHREAD'] = ['pthread']
conf.env['LIB_DL'] = ['dl']
conf.env['LIB_M'] = ['m']
if Options.options.sse:
if os.system("grep -q '^flags.*\<sse2\>' /proc/cpuinfo"):
Options.options.sse = 0
print( "Processor lacks sse, disabling..." )

conf.check_cfg(package='jack', uselib_store='JACK', args="--cflags --libs",
atleast_version='0.103.0', mandatory=True)

conf.check_cfg(package='liblo', uselib_store='LIBLO',args="--cflags --libs",
atleast_version='0.26', mandatory=True)

conf.check_cc(msg='Checking for compiler pointer alignment hints',
uselib_store='HAS_BUILTIN_ASSUME_ALIGNED',
fragment='int main ( char**argv, int argc ) { const char *s = (const char*)__builtin_assume_aligned( 0, 16 ); return 0; }',
execute=False, mandatory=False)
###

for i in common:
conf.recurse(i)

optimization_flags = [
"-O3",
"-fomit-frame-pointer",
"-ffast-math",
"-pipe"
]
if Options.options.sse:
print('Using SSE optimization')
optimization_flags.extend( [
"-msse2",
"-mfpmath=sse" ] );

conf.define( 'USE_SSE', 1 )

debug_flags = [ '-O0', '-g3' ]

if Options.options.debug:
print('Building for debugging')
conf.env.append_value('CFLAGS', debug_flags )
conf.env.append_value('CXXFLAGS', debug_flags )
else:
print('Building for performance')
conf.env.append_value('CFLAGS', optimization_flags )
conf.env.append_value('CXXFLAGS', optimization_flags )
#conf.define( 'NDEBUG', 1 )

conf.define( "_GNU_SOURCE", 1)

conf.env.append_value('CFLAGS',['-Wall'])
# conf.env.append_value('CXXFLAGS',['-Wall','-fno-exceptions', '-fno-rtti'])
conf.env.append_value('CXXFLAGS',['-Wall','-fno-rtti'])

global_flags = [ '-pthread',
'-D_LARGEFILE64_SOURCE',
'-D_FILE_OFFSET_BITS=64',
'-D_GNU_SOURCE' ]

conf.env.append_value('CFLAGS', global_flags )
conf.env.append_value('CXXFLAGS', global_flags )


conf.env.PROJECT = conf.options.project

if conf.env.PROJECT:
pl = [ conf.env.PROJECT ]
else:
pl = projects;

for i in pl:
Logs.pprint('YELLOW', 'Configuring %s' % i)
conf.recurse(i);

def run(ctx):
if not Options.options.cmd:
Logs.error("missing --cmd option for run command")
return

cmd = Options.options.cmd
Logs.pprint('GREEN', 'Running %s' % cmd)

subprocess.call(cmd, shell=True, env=source_tree_env())

def build(bld):
for i in common:
bld.recurse(i)

if bld.env.PROJECT:
pl = [ bld.env.PROJECT ]
else:
pl = projects;

for i in pl:
bld.recurse(i);

Loading…
Cancel
Save