Skip to content

Commit

Permalink
move demux config out of lpsrc
Browse files Browse the repository at this point in the history
  • Loading branch information
skaller committed Sep 8, 2015
1 parent a8c7ab6 commit cfe880b
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 64 deletions.
50 changes: 34 additions & 16 deletions fbuildroot.py
Expand Up @@ -450,29 +450,29 @@ def configure(ctx):
# later when Erick figures out how to fix this
# we'd copy the win32 subdirectory entries instead
if "posix" in target.platform:
print("COPYING POSIX RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/unix/*.fpc').glob())
if types.voidp.size == 4:
print("32 bit Unix")
print("COPYING POSIX RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/unix/unix32/*.fpc').glob())
else:
print("64 bit Unix")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/unix/unix64/*.fpc').glob())
ctx.buildroot / 'host/config', Path('src/config/unix/*.fpc').glob())
if types.voidp.size == 4:
print("32 bit Unix")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/unix/unix32/*.fpc').glob())
else:
print("64 bit Unix")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/unix/unix64/*.fpc').glob())

if "linux" in target.platform:
print("COPYING LINUX RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/linux/*.fpc').glob())
print("COPYING LINUX RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/linux/*.fpc').glob())


# enable this on win32 **instead** of the above to copy fpc files
if "windows" in target.platform:
print("COPYING WIN32 RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/win32/*.fpc').glob())
print("COPYING WIN32 RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/win32/*.fpc').glob())

# enable this on solaris to clobber any fpc files
# where the generic unix ones are inadequate
Expand All @@ -482,9 +482,27 @@ def configure(ctx):
# enable this on osx to clobber any fpc files
# where the generic unix ones are inadequate
if 'macosx' in target.platform:
print("COPYING MACOSX RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/macosx/*.fpc').glob())

if 'cygwin' in target.platform:
print("COPYING CYWGIN (POSIX) RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/cygwin/*.fpc').glob())

if 'msys' in target.platform:
print("COPYING MSYS RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/msys/*.fpc').glob())


if 'solaris' in target.platform:
print("COPYING SOLARIS RESOURCE DATABASE")
buildsystem.copy_to(ctx,
ctx.buildroot / 'host/config', Path('src/config/solaris/*.fpc').glob())


# extract the configuration
iscr = call('buildsystem.iscr.Iscr', ctx)

Expand Down
48 changes: 0 additions & 48 deletions lpsrc/flx_maker.pak
Expand Up @@ -127,54 +127,6 @@
#endif
@doc()


@h = tangler('host/config/demux.fpc')
@select(h)
Name: demux
Description: Event handling
Comment: Generated during configuration

@if pyconfig.CYGWIN:
tangle("provides_dlib: -ldemux_dynamic")
tangle("provides_slib: -ldemux_static")
elif pyconfig.HAVE_MSVC:
tangle("provides_dlib: /DEFAULTLIB:demux_dynamic")
tangle("requires_dlibs: /DEFAULTLIB:ws2_32 /DEFAULTLIB:mswsock")
tangle("provides_slib: /DEFAULTLIB:demux_static")
tangle("requires_slibs: /DEFAULTLIB:ws2_32 /DEFAULTLIB:mswsock")
elif pyconfig.WIN32:
tangle("provides_dlib: -ldemux_dynamic")
tangle("requires_dlibs: -lws2_32 -lmswsock")
tangle("provides_slib: -ldemux_static")
tangle("requires_slibs: -lws2_32 -lmswsock")
elif pyconfig.SOLARIS:
tangle("provides_dlib: -ldemux_dynamic")
tangle("provides_slib: -ldemux_static -lsocket -lnsl")
else:
tangle("provides_dlib: -ldemux_dynamic")
tangle("provides_slib: -ldemux_static")

Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
@if pyconfig.TARGET_CXX.options.CYGWIN:
tangle("src: poll/.*\\.cpp")
elif pyconfig.TARGET_CXX.options.WIN32:
tangle("src: win/.*\\.cpp")
elif pyconfig.TARGET_CXX.options.SOLARIS:
tangle("src: evtport/.*\\.cpp")
elif pyconfig.TARGET_CXX.options.LINUX:
tangle("src: epoll/.*\\.cpp")
elif pyconfig.TARGET_CXX.options.MACOSX:
tangle("src: kqueue/.*\\.cpp")
if pyconfig.TARGET_CXX.options.POSIX:
tangle("src: posix/.*\\.cpp")

@select(tangler('host/lib/rtl/demux_sockety_config.hpp'))
#ifndef __DEMUX_SOCKETY_CONFIG_H__
#define __DEMUX_SOCKETY_CONFIG_H__
Expand Down
149 changes: 149 additions & 0 deletions src/packages/demux.fdoc
Expand Up @@ -2,6 +2,155 @@
@tangler demux.py = $PWD/buildsystem/demux.py
@tangler flx_demux_config.hpp = share/lib/rtl/flx_demux_config.hpp

@tangler demux_default.fpc = $PWD/src/config/demux.fpc
@tangler demux_unix.fpc = $PWD/src/config/unix/demux.fpc
@tangler demux_linux.fpc = $PWD/src/config/linux/demux.fpc
@tangler demux_solaris.fpc = $PWD/src/config/solaris/demux.fpc
@tangler demux_macosx.fpc = $PWD/src/config/macosx/demux.fpc
@tangler demux_win32.fpc = $PWD/src/config/win32/demux.fpc
@tangler demux_msys.fpc = $PWD/src/config/msys/demux.fpc
@tangler demux_cygwin.fpc = $PWD/src/config/cygwin/demux.fpc

@tangle demux_default.fpc
Name: demux
Description: Event handling: select
Comment: Generated during configuration
provides_dlib: -ldemux_dynamic
provides_slib: -ldemux_static
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: posix/.*\.cpp
@
@tangle demux_unix.fpc
Name: demux
Description: Event handling (poll)
Comment: Generated during configuration
provides_dlib: -ldemux_dynamic
provides_slib: -ldemux_static
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: posix/.*\.cpp
src: poll/.*\.cpp

@
@tangle demux_linux.fpc
Name: demux
Description: Event handling (epoll)
Comment: Generated during configuration
provides_dlib: -ldemux_dynamic
provides_slib: -ldemux_static
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: posix/.*\.cpp
src: epoll/.*\.cpp
@

@tangle demux_solaris.fpc
Name: demux
Description: Event handling (event ports)
Comment: Generated during configuration
provides_dlib: -ldemux_dynamic
provides_slib: -ldemux_static -lsocket -lnsl
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: posix/.*\.cpp
src: evtport/.*\.cpp
@
@tangle demux_macosx.fpc
Name: demux
Description: Event handling (kqueue)
Comment: Generated during configuration
provides_dlib: -ldemux_dynamic
provides_slib: -ldemux_static
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: posix/.*\.cpp
src: kqueue/.*\.cpp
@
@tangle demux_win32.fpc
Name: demux
Description: Event handling (windows event ports with msvc)
Comment: Generated during configuration
provides_dlib: /DEFAULTLIB:demux_dynamic
requires_dlibs: /DEFAULTLIB:ws2_32 /DEFAULTLIB:mswsock
provides_slib: /DEFAULTLIB:demux_static
requires_slibs: /DEFAULTLIB:ws2_32 /DEFAULTLIB:mswsock
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: win/.*\.cpp
@
@tangle demux_msys.fpc
Name: demux
Description: Event handling (windows event ports with gcc)
Comment: Generated during configuration
provides_dlib: -ldemux_dynamic
requires_dlibs: -lws2_32 -lmswsock
provides_slib: -ldemux_static
requires_slibs: -lws2_32 -lmswsock
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: win/.*\.cpp
@
@tangle demux_cygwin.fpc
Name: demux
Description: Event handling (poll)
Comment: Generated during configuration
provides_dlib: -ldemux_dynamic
provides_slib: -ldemux_static
Requires: flx_pthread
flx_requires_driver: flx_arun
includes: '"flx_demux.hpp"'
library: demux
headers: (.*/)?([^/\\]+\.hpp)>${2}
build_includes: build/release/share/lib/rtl
srcdir: src/demux
src: [^/\\]+\.cpp
src: posix/.*\.cpp
src: poll/.*\.cpp
@

@tangle demux.py
import fbuild
from fbuild.functools import call
Expand Down
1 change: 1 addition & 0 deletions src/packages/toolchain.fdoc
Expand Up @@ -486,6 +486,7 @@ println$ "[make_lib] source directory " + srcpath;
var pats = db.getpkgfield(pkg,"src");
var pat = catmap '|' (fun (x:string)=>"("+x+")") pats;
//println$ "Finding Sources in "+srcpath;
//println$ "Matching pattern "+pat;
var files = FileSystem::regfilesin (srcpath,pat);
//println$ "Sources = " + str files;
if not static_only
Expand Down

0 comments on commit cfe880b

Please sign in to comment.