usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / usbmodeswitch / jim / autosetup / cc-shared.tcl
blob1e7744099c38824b945a734f2665dd1d10686cab
1 # Copyright (c) 2010 WorkWare Systems http://www.workware.net.au/
2 # All rights reserved
4 # @synopsis:
6 # The 'cc-shared' module provides support for shared libraries and shared objects.
7 # It defines the following variables:
9 ## SH_CFLAGS Flags to use compiling sources destined for a shared library
10 ## SH_LDFLAGS Flags to use linking a shared library
11 ## SHOBJ_CFLAGS Flags to use compiling sources destined for a shared object
12 ## SHOBJ_LDFLAGS Flags to use linking a shared object
13 ## SH_LINKFLAGS Flags to use linking an executable which will load shared objects
14 ## LD_LIBRARY_PATH Environment variable which specifies path to shared libraries
16 module-options {}
18 foreach i {SH_LINKFLAGS SH_CFLAGS SH_LDFLAGS SHOBJ_CFLAGS SHOBJ_LDFLAGS} {
19 define $i ""
22 define LD_LIBRARY_PATH LD_LIBRARY_PATH
24 switch -glob -- [get-define host] {
25 *-*-darwin* {
26 define SH_CFLAGS -dynamic
27 define SH_LDFLAGS "-dynamiclib"
28 define SHOBJ_CFLAGS "-dynamic -fno-common"
29 define SHOBJ_LDFLAGS "-bundle -undefined dynamic_lookup"
30 define LD_LIBRARY_PATH DYLD_LIBRARY_PATH
32 *-*-ming* {
33 define SH_LDFLAGS -shared
34 define SHOBJ_LDFLAGS -shared
36 *-*-cygwin {
37 define SH_LDFLAGS -shared
38 define SHOBJ_LDFLAGS -shared
40 *-*-solaris* {
41 # XXX: These haven't been fully tested.
42 #define SH_LINKFLAGS -Wl,-export-dynamic
43 define SH_CFLAGS -Kpic
44 define SHOBJ_CFLAGS -Kpic
45 define SHOBJ_LDFLAGS "-G"
47 *-*-hpux {
48 # XXX: These haven't been tested
49 define SH_LINKFLAGS -Wl,+s
50 define SH_CFLAGS +z
51 define SHOBJ_CFLAGS "+O3 +z"
52 define SHOBJ_LDFLAGS -b
53 define LD_LIBRARY_PATH SHLIB_PATH
55 * {
56 # Generic Unix settings
57 define SH_LINKFLAGS -rdynamic
58 define SH_CFLAGS -fpic
59 define SH_LDFLAGS -shared
60 define SHOBJ_CFLAGS -fpic
61 define SHOBJ_LDFLAGS "-shared"