diff options
author | Jesús Leganés Combarro "piranna <piranna@gmail.com> | 2014-08-24 01:01:06 +0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-09-02 22:20:52 +0400 |
commit | cdc01faed2b92f43a58cb86ff3300af1322cfaf6 (patch) | |
tree | 3128bb307357106474b1aa63d2108e3106a39b5e /configure | |
parent | 90d1147b8be188cb53de3d5faea2818310509cf9 (diff) |
configure: generate a fully statically linked exec
Allow to create an executable with no external dynamic libraries, also the
ones from the system. This is somewhat dependent of the used C lib, for
example glibc has some internal dynamic libraries loaded by itself, but for
other ones like eglibc or dietlib, this would produce a true static linked
executable. This can be of interest for embebers or resource constraints
platforms, but the main reason for this is to allow to use a Javascript
file as Linux kernel 'init' on NodeOS.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure index f7f6cc3d72d..cfa5f673804 100755 --- a/configure +++ b/configure @@ -54,6 +54,12 @@ parser.add_option('--no-ifaddrs', dest='no_ifaddrs', help='use on deprecated SunOS systems that do not support ifaddrs.h') +parser.add_option("--fully-static", + action="store_true", + dest="fully_static", + help="Generate an executable without external dynamic libraries. This " + "will not work on OSX when using default compilation environment") + # deprecated parser.add_option('--openssl-includes', action='store', @@ -650,6 +656,14 @@ def configure_openssl(o): o['cflags'] += cflags.split() +def configure_fullystatic(o): + if options.fully_static: + o['libraries'] += ['-static'] + if flavor == 'mac': + print("Generation of static executable will not work on OSX " + "when using default compilation environment") + + def configure_winsdk(o): if flavor != 'win': return @@ -697,6 +711,7 @@ configure_v8(output) configure_openssl(output) configure_winsdk(output) configure_icu(output) +configure_fullystatic(output) # variables should be a root level element, # move everything else to target_defaults |