ADDED build/tcc-patches/0.9.26/tcc-0.9.26-dlopenoptional.diff Index: build/tcc-patches/0.9.26/tcc-0.9.26-dlopenoptional.diff ================================================================== --- build/tcc-patches/0.9.26/tcc-0.9.26-dlopenoptional.diff +++ build/tcc-patches/0.9.26/tcc-0.9.26-dlopenoptional.diff @@ -0,0 +1,19 @@ +diff -uNr tcc-0.9.26.orig/tccrun.c tcc-0.9.26-1dlopenoptional/tccrun.c +--- tcc-0.9.26.orig/tccrun.c 2013-02-15 08:24:00.000000000 -0600 ++++ tcc-0.9.26-1dlopenoptional/tccrun.c 2014-05-21 23:33:35.056517000 -0500 +@@ -674,6 +674,7 @@ + /* ------------------------------------------------------------- */ + #ifdef CONFIG_TCC_STATIC + ++#ifndef CONFIG_TCC_STATIC_NODLOPEN + /* dummy function for profiling */ + ST_FUNC void *dlopen(const char *filename, int flag) + { +@@ -688,6 +689,7 @@ + { + return "error"; + } ++#endif + + typedef struct TCCSyms { + char *str; Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -35,18 +35,34 @@ dnl Determine how to make shared objects DC_GET_SHOBJFLAGS dnl Only export symbols we wish to expose TARGET="tcc4tcl.${SHOBJEXT}" + + no_dlopen='1' else AC_CHECK_TOOL([RANLIB], [ranlib]) AC_CHECK_TOOL([AR], [ar]) TARGET="tcc4tcl-static.a" + + no_dlopen='0' fi AC_SUBST(TARGET) AC_SUBST(TCC4TCL_TARGET) + +AC_ARG_WITH([dlopen], AS_HELP_STRING([--without-dlopen], [do not define dlopen/dlclose/dlerror]), [ + if test "$withval" = "no"; then + no_dlopen='1' + else + no_dlopen='0' + fi +]) + +if test "$no_dlopen" = '1'; then + CPPFLAGS="${CPPFLAGS} -DCONFIG_TCC_STATIC_NODLOPEN=1" +fi dnl Perform Tcl Extension required stuff TCLEXT_INIT dnl This must be done last since it breaks the compilation