Skip to content

Commit

Permalink
Added ths static libshout config to scons
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Aug 15, 2019
1 parent f01422e commit 4b9293e
Show file tree
Hide file tree
Showing 4 changed files with 551 additions and 1 deletion.
35 changes: 34 additions & 1 deletion build/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,16 +810,29 @@ def enabled(self, build):
return True
return False

def internal_link(self, build):
build.flags['shoutcast_internal'] = util.get_flags(build.env, 'shoutcast_internal', 1)
if int(build.flags['shoutcast_internal']):
return True
return False

def add_options(self, build, vars):
vars.Add('shoutcast', 'Set to 1 to enable live broadcasting support', 1)
vars.Add('shoutcast_internal', 'Set to 1 to use internal libshout', 1)

def configure(self, build, conf):
if not self.enabled(build):
return

libshout_found = conf.CheckLib(['libshout', 'shout'])
build.env.Append(CPPDEFINES='__BROADCAST__')

if self.internal_link(build):
build.env.Append(CPPPATH='include')
build.env.Append(CPPPATH='src')
return

libshout_found = conf.CheckLib(['libshout', 'shout'])

if not libshout_found:
raise Exception('Could not find libshout or its development headers. Please install it or compile Mixxx without Shoutcast support using the shoutcast=0 flag.')

Expand All @@ -829,6 +842,26 @@ def configure(self, build, conf):
conf.CheckLib('gdi32')

def sources(self, build):
if self.internal_link(build):
# Clone our main environment so we don't change any settings in the
# Mixxx environment
libshout_env = build.env.Clone()

if build.toolchain_is_gnu:
libshout_env.Append(CCFLAGS='-pthread')
libshout_env.Append(LINKFLAGS='-pthread')

libshout_env.Append(CPPPATH="#lib/libshout")
libshout_dir = libshout_env.Dir("#lib/libshout")

env = libshout_env
SCons.Export('env')
SCons.Export('build')
env.SConscript(env.File('SConscript', libshout_dir))

build.env.Append(LIBPATH=libshout_dir)
build.env.Append(LIBS=['libshout_mixxx', 'libogg', 'vorbis', 'theora', 'speex', 'ssl', 'crypto'])

depends.Qt.uic(build)('preferences/dialog/dlgprefbroadcastdlg.ui')
return ['preferences/dialog/dlgprefbroadcast.cpp',
'broadcast/broadcastmanager.cpp',
Expand Down
35 changes: 35 additions & 0 deletions lib/libshout/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python

Import('env')
env = env.Clone()

libshout_sources = [
'src/common/avl/avl.c',
'src/common/net/sock.c',
'src/common/net/resolver.c',
'src/common/timing/timing.c',
'src/common/httpp/httpp.c',
'src/common/httpp/encoding.c',
'src/common/thread/thread.c',
'src/shout.c',
'src/util.c',
'src/queue.c',
'src/proto_http.c',
'src/proto_xaudiocast.c',
'src/proto_icy.c',
'src/proto_roaraudio.c',
'src/format_ogg.c',
'src/format_webm.c',
'src/format_mp3.c',
'src/codec_vorbis.c',
'src/codec_opus.c',
'src/codec_theora.c',
'src/codec_speex.c',
'src/tls.c'
]

env.Append(CPPDEFINES='HAVE_CONFIG_H')
env.Append(CPPPATH='src/common')
env.Append(CPPPATH='include')

env.StaticLibrary(target='libshout_mixxx', source=libshout_sources)
217 changes: 217 additions & 0 deletions lib/libshout/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */

#ifndef __CONFIG_H__
#define __CONFIG_H__ 1

/* Define if you have the C99 integer types */
#define HAVE_C99_INTTYPES 1

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the `endhostent' function. */
#define HAVE_ENDHOSTENT 1

/* Define to 1 if you have the `ftime' function. */
#define HAVE_FTIME 1

/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1

/* Define if you have the getnameinfo function */
#define HAVE_GETNAMEINFO 1

/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the `inet_aton' function. */
#define HAVE_INET_ATON 1

/* Define to 1 if you have the `inet_pton' function. */
#define HAVE_INET_PTON 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define if you have the nanosleep function */
#define HAVE_NANOSLEEP 1

/* Define if you have libogg installed */
#define HAVE_OGG 1

/* Define if you have libopenssl. */
#define HAVE_OPENSSL 1

/* Define if you have POSIX threads libraries and header files. */
/* #undef HAVE_PTHREAD */

/* Define to 1 if you have the `pthread_spin_lock' function. */
#define HAVE_PTHREAD_SPIN_LOCK 1

/* Define if you have the sethostent function */
#define HAVE_SETHOSTENT 1

/* Define to 1 if the system has the type `socklen_t'. */
#define HAVE_SOCKLEN_T 1

/* Define if you want speex streams supported */
#define HAVE_SPEEX 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1

/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1

/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1

/* Define if you want theora streams supported */
#define HAVE_THEORA 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define if you have winsock2.h on MINGW */
/* #undef HAVE_WINSOCK2_H */

/* Define to 1 if you have the `writev' function. */
#define HAVE_WRITEV 1

/* Shout library major version */
#define LIBSHOUT_MAJOR 2

/* Shout library patch version */
#define LIBSHOUT_MICRO 1

/* Shout library minor version */
#define LIBSHOUT_MINOR 4

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"

/* Define if you don't want to use the thread library */
/* #undef NO_THREAD */

/* Name of package */
#define PACKAGE "libshout"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "[email protected]"

/* Define to the full name of this package. */
#define PACKAGE_NAME "libshout"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libshout 2.4.1"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libshout"

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "2.4.1"

/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */

/* The size of `int', as computed by sizeof. */
/* #undef SIZEOF_INT */

/* The size of `long', as computed by sizeof. */
/* #undef SIZEOF_LONG */

/* The size of `long long', as computed by sizeof. */
/* #undef SIZEOF_LONG_LONG */

/* The size of `short', as computed by sizeof. */
/* #undef SIZEOF_SHORT */

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1

/* Version number of package */
#define VERSION "2.4.1"

#ifndef HAVE_C99_INTTYPES
# if SIZEOF_SHORT == 4
typedef unsigned short uint32_t;
# elif SIZEOF_INT == 4
typedef unsigned int uint32_t;
# elif SIZEOF_LONG == 4
typedef unsigned long uint32_t;
# endif
# if SIZEOF_INT == 8
typedef unsigned int uint64_t;
# elif SIZEOF_LONG == 8
typedef unsigned long uint64_t;
# elif SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64_t;
# endif
#endif


#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif


/* Define if you have POSIX and GNU specifications */
#define _GNU_SOURCE /**/

/* Define if you have POSIX and XPG specifications */
#define _XOPEN_SOURCE 600


/* name mangling to protect code we share with other libraries */
#define _mangle(proc) _shout_ ## proc


/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif

/* define if va_copy is not available */
/* #undef va_copy */

#endif
Loading

0 comments on commit 4b9293e

Please sign in to comment.