From: Juho Vähä-Herttua Date: Sat, 19 May 2012 10:18:23 +0000 (+0300) Subject: Remove the SCons build scripts and move include directory X-Git-Tag: upstream/0.9.0~4^2~52 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f926f8a1cb71f4c903645d593e849beab700ced1;p=deb_shairplay.git Remove the SCons build scripts and move include directory --- diff --git a/Makefile b/Makefile deleted file mode 100644 index b9e553c..0000000 --- a/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -CFLAGS:=-g -Wall -Isrc/include/ -LDFLAGS:=-lm -LIB_OBJS=src/lib/alac/alac.o src/lib/crypto/aes.o src/lib/crypto/bigint.o src/lib/crypto/hmac.o src/lib/crypto/md5.o src/lib/crypto/rc4.o src/lib/crypto/sha1.o src/lib/sdp.o src/lib/raop_buffer.o src/lib/raop_rtp.o src/lib/digest.o src/lib/http_response.o src/lib/http_request.o src/lib/http_parser.o src/lib/httpd.o src/lib/raop.o src/lib/rsakey.o src/lib/rsapem.o src/lib/dnssd.o src/lib/netutils.o src/lib/utils.o src/lib/base64.o src/lib/logger.o - - -all: example - -example: src/test/example.o $(LIB_OBJS) - $(CC) $(CFLAGS) src/test/example.o $(LIB_OBJS) -o $@ $(LDFLAGS) - -clean: - rm -f example src/test/*.o $(LIB_OBJS) diff --git a/SConstruct b/SConstruct deleted file mode 100644 index 49df4a2..0000000 --- a/SConstruct +++ /dev/null @@ -1,63 +0,0 @@ - -AddOption('--force-mingw32', - action='store_true', dest='mingw32', default=False, - help='Cross compile using MinGW for Windows') - -AddOption('--force-mingw64', - action='store_true', dest='mingw64', default=False, - help='Cross compile using MinGW for Windows 64-bit') - -AddOption('--force-32bit', - action='store_true', dest='gcc32', default=False, - help='Always compile using 32-bit compiler flags') - -AddOption('--force-64bit', - action='store_true', dest='gcc64', default=False, - help='Always compile using 64-bit compiler flags') - -AddOption('--build-universal', - action='store_true', dest='universal', default=False, - help='Create Mac 32-bit and 64-bit universal binaries') - -VariantDir('build', 'src') -env = Environment() - -if env['PLATFORM'] == 'win32' or GetOption('mingw32') or GetOption('mingw64'): - env.Append(CPPDEFINES = ['WINVER=0x0501']) - -if GetOption('mingw32'): - env.Tool('crossmingw', toolpath = ['scons-tools']) - -if GetOption('mingw64'): - env.Tool('crossmingw64', toolpath = ['scons-tools']) - -if GetOption('gcc32'): - env.Append(CFLAGS = ['-m32']) - env.Append(CPPFLAGS = ['-m32']) - env.Append(CXXFLAGS = ['-m32']) - env.Append(LINKFLAGS = ['-m32']) - -if GetOption('gcc64'): - env.Append(CFLAGS = ['-m64']) - env.Append(CPPFLAGS = ['-m64']) - env.Append(CXXFLAGS = ['-m64']) - env.Append(LINKFLAGS = ['-m64']) - -env.Append(CFLAGS = ['-Wall', '-Werror', '-O2']) - -conf = Configure(env) -conf.CheckLib('socket') -if conf.CheckFunc('getaddrinfo'): - env.Append(CPPDEFINES = ['HAVE_GETADDRINFO']) -else: - if conf.CheckLibWithHeader('ws2_32', 'ws2tcpip.h','c','getaddrinfo(0,0,0,0);'): - env.Append(CPPDEFINES = ['HAVE_GETADDRINFO']) - else: - if conf.CheckLib('ws2_32'): - # We have windows socket lib without getaddrinfo, disable IPv6 - env.Append(CPPDEFINES = ['DISABLE_IPV6']) -conf.CheckLib('winmm') -env = conf.Finish() - -env.SConscript('build/SConscript', exports='env') - diff --git a/src/include/dnssd.h b/include/shairplay/dnssd.h similarity index 100% rename from src/include/dnssd.h rename to include/shairplay/dnssd.h diff --git a/src/include/raop.h b/include/shairplay/raop.h similarity index 100% rename from src/include/raop.h rename to include/shairplay/raop.h diff --git a/scons-tools/crossmingw.py b/scons-tools/crossmingw.py deleted file mode 100644 index 20eae42..0000000 --- a/scons-tools/crossmingw.py +++ /dev/null @@ -1,180 +0,0 @@ -"""SCons.Tool.gcc - -Tool-specific initialization for MinGW (http://www.mingw.org/) - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - -# -# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "/home/scons/scons/branch.0/branch.96/baseline/src/engine/SCons/Tool/mingw.py 0.96.90.D001 2005/02/15 20:11:37 knight" - -import os -import os.path -import string - -import SCons.Action -import SCons.Builder -import SCons.Tool -import SCons.Util - -# This is what we search for to find mingw: -prefixes = SCons.Util.Split(""" - mingw32- - mingw32msvc- - i386-mingw32- - i486-mingw32- - i586-mingw32- - i686-mingw32- - i386-mingw32msvc- - i486-mingw32msvc- - i586-mingw32msvc- - i686-mingw32msvc- - i686-w64-mingw32- -""") - -def find(env): - for prefix in prefixes: - # First search in the SCons path and then the OS path: - if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'): - return prefix - - return '' - -def shlib_generator(target, source, env, for_signature): - cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) - - dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') - if dll: cmd.extend(['-o', dll]) - - cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) - - implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') - if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature)) - - def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature)) - - return [cmd] - -def shlib_emitter(target, source, env): - dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') - no_import_lib = env.get('no_import_lib', 0) - - if not dll: - raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX") - - if not no_import_lib and \ - not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): - - # Append an import library to the list of targets. - target.append(env.ReplaceIxes(dll, - 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'LIBPREFIX', 'LIBSUFFIX')) - - # Append a def file target if there isn't already a def file target - # or a def file source. There is no option to disable def file - # target emitting, because I can't figure out why someone would ever - # want to turn it off. - def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - if not def_source and not def_target: - target.append(env.ReplaceIxes(dll, - 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')) - - return (target, source) - - -shlib_action = SCons.Action.Action(shlib_generator, generator=1) - -res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') - -res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', - source_scanner=SCons.Tool.SourceFileScanner) -SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan) - -def generate(env): - mingw_prefix = find(env) - - if mingw_prefix: - dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc')) - - # The mingw bin directory must be added to the path: - path = env['ENV'].get('PATH', []) - if not path: - path = [] - if SCons.Util.is_String(path): - path = string.split(path, os.pathsep) - - env['ENV']['PATH'] = string.join([dir] + path, os.pathsep) - - # Most of mingw is the same as gcc and friends... - gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas'] - for tool in gnu_tools: - SCons.Tool.Tool(tool)(env) - - #... but a few things differ: - env['CC'] = mingw_prefix + 'gcc' - env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') - env['CPP'] = mingw_prefix + 'g++' - env['CXX'] = mingw_prefix + 'g++' - env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') - env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') - env['SHLINKCOM'] = shlib_action - env.Append(SHLIBEMITTER = [shlib_emitter]) - env['LINK_CC'] = mingw_prefix + 'gcc' - env['LINK_CXX'] = mingw_prefix + 'g++' - env['AS'] = mingw_prefix + 'as' - env['AR'] = mingw_prefix + 'ar' - env['RANLIB'] = mingw_prefix + 'ranlib' - env['WIN32DEFPREFIX'] = '' - env['WIN32DEFSUFFIX'] = '.def' - env['SHOBJSUFFIX'] = '.o' - env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 - - env['RC'] = mingw_prefix + 'windres' - env['RCFLAGS'] = SCons.Util.CLVar('') - env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS ${INCPREFIX}${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET' - env['BUILDERS']['RES'] = res_builder - - # Some setting from the platform also have to be overridden: - env['OBJPREFIX'] = '' - env['OBJSUFFIX'] = '.o' - env['SHOBJPREFIX'] = '$OBJPREFIX' - env['SHOBJSUFFIX'] = '$OBJSUFFIX' - env['PROGPREFIX'] = '' - env['PROGSUFFIX'] = '.exe' - env['LIBPREFIX'] = '' - env['LIBSUFFIX'] = '.lib' - env['SHLIBPREFIX'] = '' - env['SHLIBSUFFIX'] = '.dll' - env['LIBPREFIXES'] = [ '$LIBPREFIX' ] - env['LIBSUFFIXES'] = [ '$LIBSUFFIX' ] - -def exists(env): - return find(env) diff --git a/scons-tools/crossmingw64.py b/scons-tools/crossmingw64.py deleted file mode 100644 index d8bfcfd..0000000 --- a/scons-tools/crossmingw64.py +++ /dev/null @@ -1,172 +0,0 @@ -"""SCons.Tool.gcc - -Tool-specific initialization for MinGW (http://www.mingw.org/) - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - -# -# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "/home/scons/scons/branch.0/branch.96/baseline/src/engine/SCons/Tool/mingw.py 0.96.90.D001 2005/02/15 20:11:37 knight" - -import os -import os.path -import string - -import SCons.Action -import SCons.Builder -import SCons.Tool -import SCons.Util - -# This is what we search for to find mingw: -prefixes = SCons.Util.Split(""" - amd64-mingw32- - amd64-mingw32msvc- - x86_64-w64-mingw32- -""") - -def find(env): - for prefix in prefixes: - # First search in the SCons path and then the OS path: - if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'): - return prefix - - return '' - -def shlib_generator(target, source, env, for_signature): - cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) - - dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') - if dll: cmd.extend(['-o', dll]) - - cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) - - implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') - if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature)) - - def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature)) - - return [cmd] - -def shlib_emitter(target, source, env): - dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') - no_import_lib = env.get('no_import_lib', 0) - - if not dll: - raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX") - - if not no_import_lib and \ - not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): - - # Append an import library to the list of targets. - target.append(env.ReplaceIxes(dll, - 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'LIBPREFIX', 'LIBSUFFIX')) - - # Append a def file target if there isn't already a def file target - # or a def file source. There is no option to disable def file - # target emitting, because I can't figure out why someone would ever - # want to turn it off. - def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') - if not def_source and not def_target: - target.append(env.ReplaceIxes(dll, - 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')) - - return (target, source) - - -shlib_action = SCons.Action.Action(shlib_generator, generator=1) - -res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') - -res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', - source_scanner=SCons.Tool.SourceFileScanner) -SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan) - -def generate(env): - mingw_prefix = find(env) - - if mingw_prefix: - dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc')) - - # The mingw bin directory must be added to the path: - path = env['ENV'].get('PATH', []) - if not path: - path = [] - if SCons.Util.is_String(path): - path = string.split(path, os.pathsep) - - env['ENV']['PATH'] = string.join([dir] + path, os.pathsep) - - # Most of mingw is the same as gcc and friends... - gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas'] - for tool in gnu_tools: - SCons.Tool.Tool(tool)(env) - - #... but a few things differ: - env['CC'] = mingw_prefix + 'gcc' - env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') - env['CPP'] = mingw_prefix + 'g++' - env['CXX'] = mingw_prefix + 'g++' - env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') - env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') - env['SHLINKCOM'] = shlib_action - env.Append(SHLIBEMITTER = [shlib_emitter]) - env['LINK_CC'] = mingw_prefix + 'gcc' - env['LINK_CXX'] = mingw_prefix + 'g++' - env['AS'] = mingw_prefix + 'as' - env['AR'] = mingw_prefix + 'ar' - env['RANLIB'] = mingw_prefix + 'ranlib' - env['WIN32DEFPREFIX'] = '' - env['WIN32DEFSUFFIX'] = '.def' - env['SHOBJSUFFIX'] = '.o' - env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 - - env['RC'] = mingw_prefix + 'windres' - env['RCFLAGS'] = SCons.Util.CLVar('') - env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS ${INCPREFIX}${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET' - env['BUILDERS']['RES'] = res_builder - - # Some setting from the platform also have to be overridden: - env['OBJPREFIX'] = '' - env['OBJSUFFIX'] = '.o' - env['SHOBJPREFIX'] = '$OBJPREFIX' - env['SHOBJSUFFIX'] = '$OBJSUFFIX' - env['PROGPREFIX'] = '' - env['PROGSUFFIX'] = '.exe' - env['LIBPREFIX'] = '' - env['LIBSUFFIX'] = '.lib' - env['SHLIBPREFIX'] = '' - env['SHLIBSUFFIX'] = '.dll' - env['LIBPREFIXES'] = [ '$LIBPREFIX' ] - env['LIBSUFFIXES'] = [ '$LIBSUFFIX' ] - -def exists(env): - return find(env) diff --git a/src/SConscript b/src/SConscript deleted file mode 100644 index 536cc06..0000000 --- a/src/SConscript +++ /dev/null @@ -1,63 +0,0 @@ -Import('env') - -files = [Glob('lib/*.c'),Glob('lib/alac/*.c'),Glob('lib/crypto/*.c')] - -env.Append(CPPPATH = ['include']) - -# Set up the environment for compiling the libraries -libenv = env.Clone() -conf = Configure(libenv) -conf.CheckLib('pthread') -conf.CheckLib('dns_sd') -libenv = conf.Finish() -libenv.Append(CPPPATH = ['lib']) - -# Make sure libraries are compiled with DLL_EXPORT on windows -if libenv['PLATFORM'] == 'win32' or GetOption('mingw32') or GetOption('mingw64'): - libenv.Append(CPPDEFINES = ['DLL_EXPORT']) - -# Prepare the libobj and shlibobj object files -libobj = libenv.Object(files) -if libenv['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME']: - shlibobj = libobj -else: - shlibobj = libenv.SharedObject(files) - -# Compile the static library into lib directory and shared library -# for the bindings -if not libenv['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME']: - libenv.Library('shairplay', libobj, install=False) -libenv.SharedLibrary('shairplay', shlibobj, install=False) - -# If we want to create universal binaries of the dynamic library on Mac, do it here -if GetOption('universal'): - libenv["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = "10.4" - libenv.Append(CFLAGS = ['-arch', 'i386', '-arch', 'x86_64']) - libenv32 = libenv.Clone() - libenv64 = libenv.Clone() - - libenv32.Append(LINKFLAGS = ['-undefined', 'dynamic_lookup']) - libenv32.Append(LINKFLAGS = ['-arch', 'i386']) - libenv32.Append(LINKFLAGS = ['-install_name', 'libshairplay32.dylib']) - libenv32.SharedLibrary('shairplay32', shlibobj, install=False) - - libenv64.Append(LINKFLAGS = ['-undefined', 'dynamic_lookup']) - libenv64.Append(LINKFLAGS = ['-arch', 'x86_64']) - libenv64.Append(LINKFLAGS = ['-install_name', 'libshairplay64.dylib']) - libenv64.SharedLibrary('shairplay64', shlibobj, install=False) - - libenv.Append(LINKFLAGS = ['-undefined', 'dynamic_lookup']) - libenv.Append(LINKFLAGS = ['-arch', 'i386', '-arch', 'x86_64']) - libenv.Append(LINKFLAGS = ['-install_name', 'libshairplay.dylib']) - -# Set up the environment for compiling the examples -appenv = env.Clone() -conf = Configure(appenv) -conf.CheckLib('pthread') -conf.CheckLib('dns_sd') -appenv = conf.Finish() -appenv.Append(LIBPATH = ['.']) -appenv.Prepend(LIBS = ['shairplay']) - -exampleobj = appenv.Object(['test/example.c']) -appenv.Program('example', exampleobj, install=False)