diff options
author | knu <knu@FreeBSD.org> | 2001-09-17 15:45:58 +0800 |
---|---|---|
committer | knu <knu@FreeBSD.org> | 2001-09-17 15:45:58 +0800 |
commit | b8b3b09c9b2dba83a70b16d6b04bab7ee7d160ac (patch) | |
tree | bd7541f041ab0d5fedfcaa010b21e0f7bbbe6bef /lang/ruby16_static | |
parent | e684244c18ad7d1bd38b4268315fb28f6b277f4e (diff) | |
download | freebsd-ports-gnome-b8b3b09c9b2dba83a70b16d6b04bab7ee7d160ac.tar.gz freebsd-ports-gnome-b8b3b09c9b2dba83a70b16d6b04bab7ee7d160ac.tar.zst freebsd-ports-gnome-b8b3b09c9b2dba83a70b16d6b04bab7ee7d160ac.zip |
Do not static link everything (including libc) but just compile in
some dynamic modules, and leave a knob which links everything as
before (-DSTATIC).
Diffstat (limited to 'lang/ruby16_static')
-rw-r--r-- | lang/ruby16_static/Makefile | 23 | ||||
-rw-r--r-- | lang/ruby16_static/pkg-comment | 2 |
2 files changed, 20 insertions, 5 deletions
diff --git a/lang/ruby16_static/Makefile b/lang/ruby16_static/Makefile index c5467346d8f2..04ae8442cfb5 100644 --- a/lang/ruby16_static/Makefile +++ b/lang/ruby16_static/Makefile @@ -7,6 +7,7 @@ PORTNAME= ruby_static PORTVERSION= ${RUBY_PORTVERSION} +PORTREVISION= 1 CATEGORIES= lang ruby ipv6 MASTER_SITES= # none DISTFILES= # none @@ -19,8 +20,8 @@ USE_RUBY= yes USE_AUTOCONF= yes -# Beware, you can't statically link Ruby with GPL'ed libraries, -# which means you can't link such modules as ruby-gdbm within. +# Beware, because gdbm is under GPL, you must treat the whole binary +# as GPL says. EXT_PORTS= archivers/ruby-zlib \ devel/ruby-strscan \ sysutils/ruby-syslog @@ -41,11 +42,19 @@ DESCR= ${_RUBY_PORTDIR}/pkg-descr .include <bsd.port.pre.mk> +# You can build a totally statically linked binary by defining STATIC, +# although it is not capable of loading dynamic modules. + CONFIGURE_ENV= XLDFLAGS="-L${LOCALBASE}/lib" CONFIGURE_ARGS!= cd ${_RUBY_PORTDIR} && ${MAKE} -V CONFIGURE_ARGS +.if defined(STATIC) CONFIGURE_ARGS:= ${CONFIGURE_ARGS:N--enable-shared:M-*} \ --with-static-linked-ext=yes \ --with-opt-dir="${LOCALBASE}" +.else +CONFIGURE_ARGS:= ${CONFIGURE_ARGS:M-*} \ + --with-opt-dir="${LOCALBASE}" +.endif .if ${RUBY_VER} == ${RUBY_DEFAULT_VER} IF_DEFAULT= "" @@ -58,20 +67,26 @@ PLIST_SUB+= IF_DEFAULT=${IF_DEFAULT} do-fetch: @${DO_NADA} +.if defined(STATIC) post-patch: ${RUBY} -i -pe 'gsub /-rdynamic/, "-static"' ${WRKSRC}/configure.in +.endif do-extract: ${MKDIR} ${WRKDIR} ${LN} -sf `cd ${_RUBY_PORTDIR} && ${MAKE} -V WRKSRC` ${WRKSRC} .for p in ${EXT_PORTS} wrksrc=$$(cd ${_PORTSDIR}/${p} && ${MAKE} -V WRKSRC) ; \ - extdir=$$(find $$wrksrc -name extconf.rb); \ + extdir=$$(find -L $$wrksrc -name extconf.rb); \ extdir=$${extdir%/extconf.rb}; \ ${CP} -RPp $$extdir ${WRKSRC}/ext/ .endfor +.if defined(STATIC) + ${ECHO} "option nodynamic" > ${WRKSRC}/ext/Setup +.else + ${ECHO} "#option nodynamic" > ${WRKSRC}/ext/Setup +.endif (cd ${WRKSRC}/ext && \ - ${ECHO} "option nodynamic" > Setup; \ for x in *; do [ -d $$x ] && echo $$x >> Setup; done) do-install: diff --git a/lang/ruby16_static/pkg-comment b/lang/ruby16_static/pkg-comment index 6430c9d862ca..45c15acf497a 100644 --- a/lang/ruby16_static/pkg-comment +++ b/lang/ruby16_static/pkg-comment @@ -1 +1 @@ -An object-oriented interpreted scripting language (statically linked) +A Ruby binary with some modules compiled in (in case of emergency) |