[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/RUBY PATCH 10/16] extensions: Build extensions



All extensions are included in a new library, libruby_ext. Each extension has
its own configuration option and a <extconf.h> header. Given that the
extensions files are generated at build time by the origin build system, we
also have to run `./configure` and `make` for the original build before
building them for Unikraft.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 Config.uk               | 102 ++++++++++++++
 Makefile.uk             | 298 ++++++++++++++++++++++++++++++++++++++++
 generated/ext/extinit.c |  57 ++++++++
 include/ruby/config.h   |   1 +
 4 files changed, 458 insertions(+)

diff --git a/Config.uk b/Config.uk
index dd83267..ff44fd7 100644
--- a/Config.uk
+++ b/Config.uk
@@ -21,4 +21,106 @@ if LIBRUBY
 config LIBRUBY_MINI
        bool "Mini configuration"
        default n
+
+config LIBRUBY_EXT
+       bool "Enable extensions"
+       depends on !LIBRUBY_MINI
+       default y
+
+       if LIBRUBY_EXT
+       config LIBRUBY_EXT_STRSCAN
+               bool "strscan"
+               default y
+       config LIBRUBY_EXT_SYSLOG
+               bool "syslog"
+               default y
+       config LIBRUBY_EXT_JSON
+               bool "json"
+               default y
+       config LIBRUBY_EXT_RBCONFIG_SIZEOF
+               bool "rbconfig/sizeof"
+               default y
+       config LIBRUBY_EXT_BIGDECIMAL
+               bool "bigdecimal"
+               default y
+       config LIBRUBY_EXT_RACC_CPARSE
+               bool "racc/cparse"
+               default y
+       config LIBRUBY_EXT_PSYCH
+               bool "psych"
+               default y
+       if LIBSSL
+       config LIBRUBY_EXT_DIGEST
+               bool "digest"
+               default y
+       endif
+       config LIBRUBY_EXT_CGI_ESCAPE
+               bool "cgi/escape"
+               default y
+       config LIBRUBY_EXT_FCNTL
+               bool "fcntl"
+               default y
+       config LIBRUBY_EXT_SOCKET
+               bool "socket"
+               select LWIP_IPV6
+               select LWIP_IGMP
+               default y
+       config LIBRUBY_EXT_PATHNAME
+               bool "pathname"
+               default y
+       config LIBRUBY_EXT_DATE_CORE
+               bool "date_core"
+               default y
+       config LIBRUBY_EXT_PTY
+               bool "pty"
+               default n
+       if LIBSSL
+       config LIBRUBY_EXT_OPENSSL
+               bool "openssl"
+               default y
+       endif
+       config LIBRUBY_EXT_FIBER
+               bool "fiber"
+               default y
+       if LIBFFI
+       config LIBRUBY_EXT_FIDDLE
+               bool "fiddle"
+               default y
+       endif
+       config LIBRUBY_EXT_ETC
+               bool "etc"
+               default y
+       config LIBRUBY_EXT_CONTINUATION
+               bool "continuation"
+               default y
+       config LIBRUBY_EXT_OBJSPACE
+               bool "objspace"
+               default y
+       config LIBRUBY_EXT_COVERAGE
+               bool "coverage"
+               default y
+       config LIBRUBY_EXT_IO_CONSOLE
+               bool "io/console"
+               default n
+       config LIBRUBY_EXT_IO_NONBLOCK
+               bool "io/nonblock"
+               default y
+       config LIBRUBY_EXT_IO_WAIT
+               bool "io/wait"
+               default y
+       if LIBRUBY_TEST
+       config LIBRUBY_EXT_RIPPER
+               bool "ripper"
+               default y
+       endif
+       config LIBRUBY_EXT_NKF
+               bool "nkf"
+               default y
+       config LIBRUBY_EXT_ZLIB
+               bool "zlib"
+               default y
+       config LIBRUBY_EXT_SDBM
+               bool "sdbm"
+               default y
+       endif
 endif
diff --git a/Makefile.uk b/Makefile.uk
index d65a9c3..42d3348 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -39,6 +39,7 @@
 # Library registration
 
################################################################################
 $(eval $(call addlib_s,libruby,$(CONFIG_LIBRUBY)))
+$(eval $(call addlib_s,libruby_ext,$(CONFIG_LIBRUBY_EXT)))
 
 
################################################################################
 # Sources
@@ -180,7 +181,304 @@ LIBRUBY_SRCS-y += 
$(LIBRUBY_BASE)/generated/enc/trans/newline.c
 LIBRUBY_SRCS-y += $(LIBRUBY_SRC)/./missing/setproctitle.c
 LIBRUBY_SRCS-y += $(LIBRUBY_SRC)/addr2line.c
 
+################################################################################
+# Extensions
+################################################################################
+LIBRUBY_EXT_CFLAGS-y += $(LIBRUBY_CINCLUDES-y)
+LIBRUBY_EXT_CFLAGS-y += $(LIBRUBY_SUPPRESS_FLAGS)
+LIBRUBY_EXT_CFLAGS-y += -DRUBY_EXTCONF_H=\"extconf.h\"
+
+ifeq ($(CONFIG_LIBRUBY_EXT),y)
+LIBRUBY_SRCS-y += $(LIBRUBY_BASE)/generated/ext/extinit.c
+else
 LIBRUBY_SRCS-y += $(LIBRUBY_SRC)/dmyext.c
+endif
+
+ifeq ($(CONFIG_LIBRUBY_EXT_STRSCAN),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/strscan/strscan.c
+LIBRUBY_EXT_STRSCAN_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/strscan
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_SYSLOG),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/syslog/syslog.c
+LIBRUBY_EXT_SYSLOG_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/syslog
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_JSON),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/json/generator/generator.c
+LIBRUBY_EXT_GENERATOR_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/json/generator
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/json/parser/parser.c|json
+LIBRUBY_EXT_PARSER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/json/parser
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_RBCONFIG_SIZEOF),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/rbconfig/sizeof/sizes.c
+LIBRUBY_EXT_SIZES_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/rbconfig/sizeof
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/rbconfig/sizeof/limits.c
+LIBRUBY_EXT_LIMITS_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/rbconfig/sizeof
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_BIGDECIMAL),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/bigdecimal/bigdecimal.c
+LIBRUBY_EXT_BIGDECIMAL_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/bigdecimal
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/bigdecimal/util/util.c
+LIBRUBY_EXT_UTIL_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/bigdecimal/util
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_RACC_CPARSE),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/racc/cparse/cparse.c
+LIBRUBY_EXT_CPARSE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/racc/cparse
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_DIGEST),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/digest/digest.c
+LIBRUBY_EXT_DIGEST_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/digest
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/digest/bubblebabble/bubblebabble.c
+LIBRUBY_EXT_BUBBLEBABBLE_FLAGS-y += 
-I$(LIBRUBY_BASE)/generated/ext/digest/bubblebabble
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/digest/md5/md5init.c
+LIBRUBY_EXT_MD5INIT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/digest/md5
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/digest/rmd160/rmd160init.c
+LIBRUBY_EXT_RMD160INIT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/digest/rmd160
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/digest/sha1/sha1init.c
+LIBRUBY_EXT_SHA1INIT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/digest/sha1
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/digest/sha2/sha2init.c
+LIBRUBY_EXT_SHA2INIT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/digest/sha2
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_PSYCH),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/psych_to_ruby.c
+LIBRUBY_EXT_PSYCH_TO_RUBY_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/psych_yaml_tree.c
+LIBRUBY_EXT_PSYCH_YAML_TREE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/psych_emitter.c
+LIBRUBY_EXT_PSYCH_EMITTER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/psych_parser.c|psych
+LIBRUBY_EXT_PSYCH_PARSER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/psych.c
+LIBRUBY_EXT_PSYCH_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/dumper.c
+LIBRUBY_EXT_DUMPER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/parser.c|yaml
+LIBRUBY_EXT_PARSER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/scanner.c
+LIBRUBY_EXT_SCANNER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/api.c
+LIBRUBY_EXT_API_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/loader.c
+LIBRUBY_EXT_LOADER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/writer.c
+LIBRUBY_EXT_WRITER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/emitter.c
+LIBRUBY_EXT_EMITTER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/psych/yaml/reader.c
+LIBRUBY_EXT_READER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/psych 
-I$(LIBRUBY_BASE)/generated/ext/psych/yaml
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_CGI_ESCAPE),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/cgi/escape/escape.c
+LIBRUBY_EXT_ESCAPE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/cgi/escape
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_FCNTL),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fcntl/fcntl.c
+LIBRUBY_EXT_FCNTL_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fcntl
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_SOCKET),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/init.c|socket
+LIBRUBY_EXT_INIT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/constants.c
+LIBRUBY_EXT_CONSTANTS_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/basicsocket.c
+LIBRUBY_EXT_BASICSOCKET_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/socket.c
+LIBRUBY_EXT_SOCKET_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/ipsocket.c
+LIBRUBY_EXT_IPSOCKET_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/tcpsocket.c
+LIBRUBY_EXT_TCPSOCKET_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/tcpserver.c
+LIBRUBY_EXT_TCPSERVER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/sockssocket.c
+LIBRUBY_EXT_SOCKSSOCKET_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/udpsocket.c
+LIBRUBY_EXT_UDPSOCKET_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/unixsocket.c
+LIBRUBY_EXT_UNIXSOCKET_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/unixserver.c
+LIBRUBY_EXT_UNIXSERVER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/option.c
+LIBRUBY_EXT_OPTION_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/ancdata.c
+LIBRUBY_EXT_ANCDATA_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/raddrinfo.c
+LIBRUBY_EXT_RADDRINFO_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/socket/ifaddr.c
+LIBRUBY_EXT_IFADDR_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/socket
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_PATHNAME),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/pathname/pathname.c
+LIBRUBY_EXT_PATHNAME_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/pathname
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_DATE_CORE),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/date/date_core.c
+LIBRUBY_EXT_DATE_CORE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/date
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/date/date_parse.c
+LIBRUBY_EXT_DATE_PARSE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/date
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/date/date_strftime.c
+LIBRUBY_EXT_DATE_STRFTIME_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/date
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/date/date_strptime.c
+LIBRUBY_EXT_DATE_STRPTIME_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/date
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_PTY),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/pty/pty.c
+LIBRUBY_EXT_PTY_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/pty
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_OPENSSL),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/openssl_missing.c
+LIBRUBY_EXT_OPENSSL_MISSING_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl.c
+LIBRUBY_EXT_OSSL_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_asn1.c
+LIBRUBY_EXT_OSSL_ASN1_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_bio.c
+LIBRUBY_EXT_OSSL_BIO_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_bn.c
+LIBRUBY_EXT_OSSL_BN_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_cipher.c
+LIBRUBY_EXT_OSSL_CIPHER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_config.c
+LIBRUBY_EXT_OSSL_CONFIG_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_digest.c
+LIBRUBY_EXT_OSSL_DIGEST_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_engine.c
+LIBRUBY_EXT_OSSL_ENGINE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_hmac.c
+LIBRUBY_EXT_OSSL_HMAC_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_kdf.c
+LIBRUBY_EXT_OSSL_KDF_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_ns_spki.c
+LIBRUBY_EXT_OSSL_NS_SPKI_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_ocsp.c
+LIBRUBY_EXT_OSSL_OCSP_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_pkcs12.c
+LIBRUBY_EXT_OSSL_PKCS12_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_pkcs7.c
+LIBRUBY_EXT_OSSL_PKCS7_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_pkey.c
+LIBRUBY_EXT_OSSL_PKEY_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_pkey_dh.c
+LIBRUBY_EXT_OSSL_PKEY_DH_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_pkey_dsa.c
+LIBRUBY_EXT_OSSL_PKEY_DSA_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_pkey_ec.c
+LIBRUBY_EXT_OSSL_PKEY_EC_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_pkey_rsa.c
+LIBRUBY_EXT_OSSL_PKEY_RSA_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_rand.c
+LIBRUBY_EXT_OSSL_RAND_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_ssl.c
+LIBRUBY_EXT_OSSL_SSL_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_ssl_session.c
+LIBRUBY_EXT_OSSL_SSL_SESSION_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509.c
+LIBRUBY_EXT_OSSL_X509_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509attr.c
+LIBRUBY_EXT_OSSL_X509ATTR_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509cert.c
+LIBRUBY_EXT_OSSL_X509CERT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509crl.c
+LIBRUBY_EXT_OSSL_X509CRL_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509ext.c
+LIBRUBY_EXT_OSSL_X509EXT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509name.c
+LIBRUBY_EXT_OSSL_X509NAME_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509req.c
+LIBRUBY_EXT_OSSL_X509REQ_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509revoked.c
+LIBRUBY_EXT_OSSL_X509REVOKED_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/openssl/ossl_x509store.c
+LIBRUBY_EXT_OSSL_X509STORE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/openssl
+endif
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/stringio/stringio.c
+LIBRUBY_EXT_STRINGIO_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/stringio
+ifeq ($(CONFIG_LIBRUBY_EXT_FIBER),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fiber/fiber.c
+LIBRUBY_EXT_FIBER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fiber
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_FIDDLE),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fiddle/closure.c
+LIBRUBY_EXT_CLOSURE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fiddle
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fiddle/conversions.c
+LIBRUBY_EXT_CONVERSIONS_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fiddle
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fiddle/fiddle.c
+LIBRUBY_EXT_FIDDLE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fiddle
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fiddle/function.c
+LIBRUBY_EXT_FUNCTION_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fiddle
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fiddle/handle.c
+LIBRUBY_EXT_HANDLE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fiddle
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/fiddle/pointer.c
+LIBRUBY_EXT_POINTER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/fiddle
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_ETC),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/etc/etc.c
+LIBRUBY_EXT_ETC_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/etc
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_CONTINUATION),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/continuation/continuation.c
+LIBRUBY_EXT_CONTINUATION_FLAGS-y += 
-I$(LIBRUBY_BASE)/generated/ext/continuation
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_OBJSPACE),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/objspace/object_tracing.c
+LIBRUBY_EXT_OBJECT_TRACING_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/objspace
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/objspace/objspace.c
+LIBRUBY_EXT_OBJSPACE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/objspace
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/objspace/objspace_dump.c
+LIBRUBY_EXT_OBJSPACE_DUMP_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/objspace
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_COVERAGE),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/coverage/coverage.c
+LIBRUBY_EXT_COVERAGE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/coverage
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_IO_CONSOLE),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/io/console/console.c
+LIBRUBY_EXT_CONSOLE_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/io/console
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_IO_NONBLOCK),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/io/nonblock/nonblock.c
+LIBRUBY_EXT_NONBLOCK_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/io/nonblock
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_IO_WAIT),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/io/wait/wait.c
+LIBRUBY_EXT_WAIT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/io/wait
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_RIPPER),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/ripper/ripper.c
+LIBRUBY_EXT_RIPPER_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/ripper
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_NKF),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/nkf/nkf.c
+LIBRUBY_EXT_NKF_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/nkf
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_ZLIB),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/zlib/zlib.c
+LIBRUBY_EXT_ZLIB_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/zlib
+endif
+ifeq ($(CONFIG_LIBRUBY_EXT_SDBM),y)
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/sdbm/_sdbm.c
+LIBRUBY_EXT__SDBM_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/sdbm
+LIBRUBY_EXT_SRCS-y += $(LIBRUBY_SRC)/ext/sdbm/init.c|sdbm
+LIBRUBY_EXT_INIT_FLAGS-y += -I$(LIBRUBY_BASE)/generated/ext/sdbm
+endif
 
 LIBRUBY_SRCS-y += $(LIBRUBY_SRC)/dmyenc.c
 
+################################################################################
+# Prepare rules
+################################################################################
+
+# Configure origin
+$(LIBRUBY_BUILD)/.configured: $(LIBRUBY_BUILD)/.origin
+       cd $(LIBRUBY_SRC) && \
+               autoconf && \
+               ./configure --with-static-linked-ext && \
+               touch $@
+
+# Build Ruby
+$(LIBRUBY_BUILD)/.build: $(LIBRUBY_BUILD)/.configured
+       cd $(LIBRUBY_SRC) && make && touch $@
+
+ifeq ($(CONFIG_LIBRUBY_EXT),y)
+UK_PREPARE += $(LIBRUBY_BUILD)/.build
+endif
+
diff --git a/generated/ext/extinit.c b/generated/ext/extinit.c
index 492a933..ce2e77c 100644
--- a/generated/ext/extinit.c
+++ b/generated/ext/extinit.c
@@ -1,3 +1,4 @@
+#include <uk/config.h>
 #include "ruby/ruby.h"
 
 #define init(func, name) {     \
@@ -9,40 +10,96 @@ void ruby_init_ext(const char *name, void (*init)(void));
 
 void Init_ext(void)
 {
+#if CONFIG_LIBRUBY_EXT_STRSCAN
     init(Init_strscan, "strscan");
+#endif
+#if CONFIG_LIBRUBY_EXT_SYSLOG
     init(Init_syslog, "syslog");
+#endif
+#if CONFIG_LIBRUBY_EXT_SYSLOG
     init(Init_generator, "json/ext/generator");
     init(Init_parser, "json/ext/parser");
+#endif
+#if CONFIG_LIBRUBY_EXT_RBCONFIG_SIZEOF
     init(Init_sizeof, "rbconfig/sizeof");
+#endif
+#if CONFIG_LIBRUBY_EXT_BIGDECIMAL
     init(Init_bigdecimal, "bigdecimal");
     init(Init_util, "bigdecimal/util");
+#endif
+#if CONFIG_LIBRUBY_EXT_RACC_CPARSE
     init(Init_cparse, "racc/cparse");
+#endif
+#if CONFIG_LIBRUBY_EXT_DIGEST
     init(Init_digest, "digest");
     init(Init_bubblebabble, "digest/bubblebabble");
     init(Init_md5, "digest/md5");
     init(Init_rmd160, "digest/rmd160");
     init(Init_sha1, "digest/sha1");
     init(Init_sha2, "digest/sha2");
+#endif
+#if CONFIG_LIBRUBY_EXT_PSYCH
     init(Init_psych, "psych");
+#endif
+#if CONFIG_LIBRUBY_EXT_CGI_ESCAPE
     init(Init_escape, "cgi/escape");
+#endif
+#if CONFIG_LIBRUBY_EXT_FCNTL
     init(Init_fcntl, "fcntl");
+#endif
     init(Init_stringio, "stringio");
+#if CONFIG_LIBRUBY_EXT_SOCKET
     init(Init_socket, "socket");
+#endif
+#if CONFIG_LIBRUBY_EXT_PATHNAME
     init(Init_pathname, "pathname");
+#endif
+#if CONFIG_LIBRUBY_EXT_DATE_CORE
     init(Init_date_core, "date_core");
+#endif
+#if CONFIG_LIBRUBY_EXT_PTY
     init(Init_pty, "pty");
+#endif
+#if CONFIG_LIBRUBY_EXT_OPENSSL
     init(Init_openssl, "openssl");
+#endif
+#if CONFIG_LIBRUBY_EXT_FIBER
     init(Init_fiber, "fiber");
+#endif
+#if CONFIG_LIBRUBY_EXT_FIDDLE
     init(Init_fiddle, "fiddle");
+#endif
+#if CONFIG_LIBRUBY_EXT_ETC
     init(Init_etc, "etc");
+#endif
+#if CONFIG_LIBRUBY_EXT_CONTINUATION
     init(Init_continuation, "continuation");
+#endif
+#if CONFIG_LIBRUBY_EXT_OBJSPACE
     init(Init_objspace, "objspace");
+#endif
+#if CONFIG_LIBRUBY_EXT_COVERAGE
     init(Init_coverage, "coverage");
+#endif
+#if CONFIG_LIBRUBY_EXT_IO_CONSOLE
     init(Init_console, "io/console");
+#endif
+#if CONFIG_LIBRUBY_EXT_IO_NONBLOCK
     init(Init_nonblock, "io/nonblock");
+#endif
+#if CONFIG_LIBRUBY_EXT_IO_WAIT
     init(Init_wait, "io/wait");
+#endif
+#if CONFIG_LIBRUBY_EXT_RIPPER
     init(Init_ripper, "ripper");
+#endif
+#if CONFIG_LIBRUBY_EXT_RIPPER
     init(Init_nkf, "nkf");
+#endif
+#if CONFIG_LIBRUBY_EXT_RIPPER
     init(Init_zlib, "zlib");
+#endif
+#if CONFIG_LIBRUBY_EXT_RIPPER
     init(Init_sdbm, "sdbm");
+#endif
 }
diff --git a/include/ruby/config.h b/include/ruby/config.h
index e9ff4d1..2b0fae0 100644
--- a/include/ruby/config.h
+++ b/include/ruby/config.h
@@ -422,6 +422,7 @@
 /* #define HAVE_VALGRIND_MEMCHECK_H 1 */
 #define DLEXT_MAXLEN 3
 #define DLEXT ".so"
+#define EXTSTATIC 1
 #define HAVE__SETJMP 1
 #define RUBY_SETJMP(env) __builtin_setjmp((env))
 #define RUBY_LONGJMP(env,val) __builtin_longjmp((env),val)
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.