Allow linking clibs.c instead of including it.

This commit is contained in:
Alex Shinn 2014-12-25 13:23:17 +09:00
parent b78187c89b
commit 14e0b4f6eb
2 changed files with 8 additions and 3 deletions

6
eval.c
View file

@ -1221,10 +1221,10 @@ sexp sexp_get_port_fileno (sexp ctx, sexp self, sexp_sint_t n, sexp port) {
#endif #endif
#if SEXP_USE_STATIC_LIBS #if SEXP_USE_STATIC_LIBS
#ifndef PLAN9 #if SEXP_USE_STATIC_LIBS_NO_INCLUDE
#include "clibs.c"
#else
struct sexp_library_entry_t sexp_static_libraries[]; struct sexp_library_entry_t sexp_static_libraries[];
#else
#include "clibs.c"
#endif #endif
static struct sexp_library_entry_t *sexp_find_static_library(const char *file) static struct sexp_library_entry_t *sexp_find_static_library(const char *file)
{ {

View file

@ -336,6 +336,11 @@
#define SEXP_USE_STATIC_LIBS 0 #define SEXP_USE_STATIC_LIBS 0
#endif #endif
/* don't include clibs.c - include separately or link */
#ifndef SEXP_USE_STATIC_LIBS_NO_INCLUDE
#define SEXP_USE_STATIC_LIBS_NO_INCLUDE defined(PLAN9)
#endif
#ifndef SEXP_USE_FULL_SOURCE_INFO #ifndef SEXP_USE_FULL_SOURCE_INFO
#define SEXP_USE_FULL_SOURCE_INFO ! SEXP_USE_NO_FEATURES #define SEXP_USE_FULL_SOURCE_INFO ! SEXP_USE_NO_FEATURES
#endif #endif