Skip to content

Commit

Permalink
Import code.
Browse files Browse the repository at this point in the history
  • Loading branch information
waddlesplash committed Feb 1, 2015
0 parents commit a93fd92
Show file tree
Hide file tree
Showing 645 changed files with 85,386 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Jamfile
@@ -0,0 +1,6 @@
SubDir TOP ;
#SubInclude TOP sources ;
SubInclude TOP sources-experimental ;
MakeDistro distro ;


55 changes: 55 additions & 0 deletions Jamrules
@@ -0,0 +1,55 @@
BUILD_DIR = [ FDirName $(TOP) build ] ;
GENERATED_DIR = [ FDirName $(TOP) generated ] ;
DISTRO_DIR = [ FDirName $(TOP) generated distro ] ;

include [ FDirName $(BUILD_DIR) HelperRules ] ;
include [ FDirName $(BUILD_DIR) ConfigRules ] ;
include [ FDirName $(BUILD_DIR) OverriddenJamRules ] ;
include [ FDirName $(BUILD_DIR) MainBuildRules ] ;
include [ FDirName $(BUILD_DIR) BuildSettings ] ;


# Include UserBuildConfig.
{
local userBuildConfig = [ GLOB $(BUILD_DIR) : UserBuildConfig ] ;
if $(userBuildConfig)
{
LOCATE on UserBuildConfig = $(BUILD_DIR) ;
include UserBuildConfig ;
}
}

# default to strip generated apps if not specified otherwise:
STRIP_APPS ?= 1 ;

# Cache files for header scanning and jamfile caching.
HCACHEFILE = header_cache ;
JCACHEFILE = jamfile_cache ;
LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(GENERATED_DIR) ;


rule MakeDistro
{
# MakeDistro <target>

local target = $1 ;

NotFile $(target) ;
Always $(target) ;
}

actions MakeDistro
{
#jam
cp $(DISTRO_DIR)/BePodder $(TOP)/release
xres -o $(TOP)/release/BePodder $(TOP)/resources/Icons.rsrc $(TOP)/resources/BePodder.rsrc

if [ -f /boot/beos/bin/IconTool ] ; then
echo "Adding SVG Icon"
IconTool $(TOP)/release/BePodder Build STD_ICON 1 -1 SVG $(TOP)/resources/AppIcon.svg
fi

mimeset -f $(TOP)/release/BePodder

}

2,862 changes: 2,862 additions & 0 deletions bepodder_podcasts.opml

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions build/BuildSettings
@@ -0,0 +1,127 @@
# BuildSettings
#
# Setup global variables.

# C and C++ flags
if $(OSPLAT) = PPC {
# filter out -nosyspath
CFLAGS = [ FFilter $(CFLAGS) : -nosyspath ] ;
C++FLAGS = [ FFilter $(C++FLAGS) : -nosyspath ] ;
LINKFLAGS += -warn -export pragma ;

# set file containing preprocessed headers:
PREFIX_FILE ?= [ FDirName $(LOCATE_TARGET) pe.headers ] ;
}

if $(OSPLAT) = X86 {
# check for BONE...
local haveBone = [ GLOB /boot/develop/headers/be/bone/arpa : inet.h ] ;
if $(haveBone) {
CCFLAGS += -DBONE_BUILD ;
C++FLAGS += -DBONE_BUILD ;
SYSHDRS += /boot/develop/headers/be/bone /boot/develop/headers/be/bone/sys ;
LINKLIBS += -lsocket -lbind ;
} else {
LINKLIBS += -lnet ;
}
# check for Zeta...
local haveZeta = [ GLOB /boot/beos/system/lib : libzeta.so ] ;
if $(haveZeta) {
LINKLIBS += -lzeta ;
DEFINES += ZETA ;
}
}

# Use copyattr for copying.
CP = copyattr --data ;

# Default paths for bison and flex:
BISON = bison ;
LEX = flex ;

# mkdir shall not fail, if the directory already exists.
MKDIR = mkdir -p ;

# Modify the main target dirs for languages and extensions.
SetConfigVar LOCATE_MAIN_TARGET : TOP Languages
: [ FDirName $(DISTRO_DIR) Languages ] ;
SetConfigVar LOCATE_MAIN_TARGET : TOP Extensions
: [ FDirName $(DISTRO_DIR) Extensions ] ;

rule SetUpSubDirBuildSettings {
# SetUpSubDirBuildSettings <dir> ;
#
# Sets up the compiler flags and defines based on the WARNINGS, DEBUG, and
# OPTIMIZE variables. Also sets the locations for the targets (objects,
# libraries and executables).
#
# <dir>: Parameters as passed to the SubDir rule, i.e. the name of the
# TOP variable and the subdir tokens.
#
local dir = $(1) ;

# warnings settings
if $(WARNINGS) != 0 {
if $(OSPLAT) = X86 {
CCFLAGS += -Wall -Wno-multichar -Wmissing-prototypes ;
CCFLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ;
C++FLAGS += -Wall -Wno-multichar ;
C++FLAGS += -Wno-ctor-dtor-privacy -Woverloaded-virtual ;
C++FLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ;
C++FLAGS += -Wno-unknown-pragmas ;
} else {
CCFLAGS += -w on -requireprotos ;
}
}

# set the objects-folder according to debugging settings:
if $(DEBUG) && $(DEBUG) != 0
{
OBJECTS_DIR = [ FDirName $(TOP) generated objects-debug ] ;
}
else
{
OBJECTS_DIR = [ FDirName $(TOP) generated objects-nodebug ] ;
}

# debugging settings
if $(DEBUG) > 0 {
OPTIMIZE = 0 ;
STRIP_APPS = 0 ;
DEFINES += DEBUG=$(DEBUG) ;
CCFLAGS += -g ;
C++FLAGS += -g ;
LINKFLAGS += -g ;
}

# optimization settings
if $(OPTIMIZE) = 0 {
if $(OSPLAT) = X86 {
OPTIM = -O0 ;
} else {
OPTIM = -O0 ;
}
} else {
if $(OSPLAT) = X86 {
OPTIM ?= -O2 ;
} else {
OPTIM ?= -O7 ;
}
}

# setup objects location
local objdir = [ FDirName $(OBJECTS_DIR) $(dir[2-]) ] ;
SEARCH_SOURCE += $(objdir) ;
LOCATE_SOURCE = $(objdir) ;
LOCATE_TARGET = $(objdir) ;

# setup main targets location
LOCATE_MAIN_TARGET ?= [ FDirName $(DISTRO_DIR) ] ;
}

# The LOCATE_MAIN_TARGET variable shall be reset for each subdirectory.
AUTO_SET_UP_CONFIG_VARIABLES += LOCATE_MAIN_TARGET ;

# Add the rules setting up the build settings for a subdirectory to the
# rules invoked by SubDir.
SUBDIRRULES += SetUpSubDirBuildSettings ;
146 changes: 146 additions & 0 deletions build/ConfigRules
@@ -0,0 +1,146 @@
# ConfigRules
#
# Contains rules providing the config variable feature. It allows to set the
# values for certain variables for subdirectories in a central place. That is
# one can, for instance, specify in a file like UserBuildConfig for which
# directories to enable debugging, warnings, set special defines, compiler
# flags and the like without needing to edit the Jamfiles for the respective
# dirs.

rule ConfigObject
{
# ConfigObject <dir> ;
#
# Private rule. Returns the dummy object on which the config variables are
# set for a given subdir.
#
# <dir>: Parameters as passed to the SubDir rule, i.e. the name of the
# TOP variable and the subdir tokens.
#
local config = __config__ ;
local grist = [ FGrist root $(1) ] ;
return $(config:G=$(grist)) ;
}

rule SetConfigVar
{
# SetConfigVar <var> : <dir> : <value> [ : <scope> ] ;
#
# Sets a config variable for a specified directory to the given value.
#
# <var>: The name of the variable to be set.
# <dir>: Parameters as passed to the SubDir rule, i.e. the name of the
# TOP variable and the subdir tokens.
# <value>: The value to which the variable shall be set.
# <scope>: Either "global" or "local". The former implies that the variable
# value shall also be used for subdirectories (recursively), if
# for them the variable has not been set. The latter has the same
# effect regarding subdirs as if the variable for the directory
# is not set. Defaults to "global".
#
local var = $(1[1]) ;
local config = [ ConfigObject $(2) ] ;
local scope = $(4) ;
if ! $(scope) {
scope = global ;
}
$(var) on $(config) = $(3) ;
__set_$(var) on $(config) = $(scope) ;
}

rule AppendToConfigVar
{
# AppendToConfigVar <var> : <dir> : <value> [ : <scope> ] ;
#
# Appends a value to a config variable for a specified directory. Shortcut
# for
# SetConfigVar <var> : <dir> : [ ConfigVar <var> : <dir> ] <value
# : <scope> ;
#
# <var>: The name of the variable to be set.
# <dir>: Parameters as passed to the SubDir rule, i.e. the name of the
# TOP variable and the subdir tokens.
# <value>: The value which to append to the variables current value.
# <scope>: Either "global" or "local". The former implies that the variable
# value shall also be used for subdirectories (recursively), if
# for them the variable has not been set. The latter has the same
# effect regarding subdirs as if the variable for the directory
# is not set. Defaults to "global".
#
SetConfigVar $(1) : $(2) : [ ConfigVar $(1) : $(2) ] $(3) : $(4) ;
}

rule ConfigVar
{
# ConfigVar <var> : <dir> [ : <scope> ] ;
#
# Returns the value of a configuration variable for a given subdir.
# If the variable is not set for the subdir, the rule is invoked
# recursively for the parent directory with the scope "global". When
# the root is reached without yielding a value, the value of the global
# variable <var> is returned.
#
# <var>: The name of the variable whose value shall be returned.
# <dir>: Parameters as passed to the SubDir rule, i.e. the name of the
# TOP variable and the subdir tokens.
# <scope>: If not given any scope passed to SetConfigVar for the given
# directory will be accepted, otherwise it must match the scope
# passed to SetConfigVar.
#
local var = $(1[1]) ;
local dir = $(2) ;
local config = [ ConfigObject $(dir) ] ;
local scope = $(3) ;
local varScope = [ on $(config) return $(__set_$(var)) ] ;
if ( ! $(scope) && $(varScope) )
|| ( $(scope) && $(scope) = $(varScope) )
|| ! $(dir) {
on $(config) return $($(var)) ;
} else {
dir = [ FReverse $(dir) ] ;
return [ ConfigVar $(var) : [ FReverse $(dir[2-]) ] : global ] ;
}
}

rule SetUpConfigVars {
# SetUpConfigVars <dir> ;
#
# Sets the global variables defined in AUTO_SET_UP_CONFIG_VARIABLES to the
# values specified for the subdirectory <dir>.
#
# <dir>: Parameters as passed to the SubDir rule, i.e. the name of the
# TOP variable and the subdir tokens.
#
local dir = $(1) ;

# Backup the global variable value on first invocation, otherwise restore
# them, so that ConfigVar returns the right values for not explicity set
# local variables.
local var ;
if ! $(__config_var_backup__) {
__config_var_backup__ = true ;
for var in $(AUTO_SET_UP_CONFIG_VARIABLES) {
__config_var_backup_$(var)__ = $($(var)) ;
}
} else {
for var in $(AUTO_SET_UP_CONFIG_VARIABLES) {
$(var) = $(__config_var_backup_$(var)__) ;
}
}

# Set the variables to their configured values.
for var in $(AUTO_SET_UP_CONFIG_VARIABLES) {
$(var) = [ ConfigVar $(var) : $(dir) ] ;
}
}

# Add the SetUpConfigVars rule to the rules that are invoked at the end of the
# SubDir rule. Prepend it, so that the variables are set up before any other
# rule is invoked.
SUBDIRRULES = SetUpConfigVars $(SUBDIRRULES) ;

# Some config variables that should be set up automatically for subdirs.
AUTO_SET_UP_CONFIG_VARIABLES +=
CCFLAGS C++FLAGS DEBUG DEFINES HDRS LINKFLAGS OPTIM OPTIMIZE
SYSHDRS WARNINGS
;
51 changes: 51 additions & 0 deletions build/HelperRules
@@ -0,0 +1,51 @@
# HelperRules
#
# Helper rules without side effects.

rule FFilter
{
# FFilter <list> : <excludes> ;
#
# Removes all occurrences of <excludes> in <list>.

local list = $(1) ;
local excludes = $(2) ;
local newList ;
local item ;
for item in $(list) {
local skip ;
local exclude ;
for exclude in $(excludes) {
if $(item) = $(exclude) {
skip = true ;
}
}
if ! $(skip) {
newList += $(item) ;
}
}
return $(newList) ;
}

rule FSplitPath
{
# FSplitPath <path> ;
#
# Decomposes a path into its components.
#
# <path>: The path to be decomposed.
#
local path = $(1:G=) ;

local components ;
# $(path:D) for "/" is "/". Therefore the second condition.
while $(path:D) && $(path:D) != $(path)
{
# Note: $(path:B) returns "." for "..", but $(path:D=) is fine.
components = $(path:D=) $(components) ;
path = $(path:D) ;
}
components = $(path) $(components) ;
return $(components) ;
}

0 comments on commit a93fd92

Please sign in to comment.