Changes needed to build correctly, tested under linux, please let me know how other platforms go.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2701 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
5053ef2e39
commit
78c7eff787
|
@ -1,19 +1,25 @@
|
||||||
VERSION = mono-1.1.13.8
|
VERSION = mono-1.1.13.8
|
||||||
TARBALL = mono-1.1.13.8.tar.gz
|
TARBALL = mono-1.1.13.8.tar.gz
|
||||||
CFLAGS += `pkg-config --cflags mono`
|
GLIB_TARBALL = glib-2.12.3.tar.gz
|
||||||
LDFLAGS += `pkg-config --libs mono`
|
GETTEXT_TARBALL = gettext-0.15.tar.gz
|
||||||
|
PKGCONFIG_TARBALL = pkg-config-0.21.tar.gz
|
||||||
|
CFLAGS += `$(PREFIX)/bin/pkg-config --cflags mono`
|
||||||
|
LDFLAGS += `$(PREFIX)/bin/pkg-config --libs mono`
|
||||||
|
|
||||||
all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN)
|
all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN)
|
||||||
|
|
||||||
depends:
|
depends:
|
||||||
MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install $(TARBALL) --prefix=$(PREFIX) --with-pic
|
MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install $(GETTEXT_TARBALL) --prefix=$(PREFIX) --with-pic
|
||||||
|
MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install $(PKGCONFIG_TARBALL) --prefix=$(PREFIX) --with-pic
|
||||||
|
export PKG_CONFIG=$(PREFIX)/bin/pkg-config; export MSGFMT=$(PREFIX)/bin/; MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install $(GLIB_TARBALL) --prefix=$(PREFIX) --with-pic
|
||||||
|
export PATH=$(PATH):$(PREFIX)/bin/; MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install $(TARBALL) --prefix=$(PREFIX) --with-pic
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -fPIC $(CFLAGS) -c -o $@ $<
|
$(CC) -fPIC $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c
|
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c
|
||||||
$(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o
|
$(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o
|
||||||
$(LINKER) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o $(LDFLAGS)
|
$(CC) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LDFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
|
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
|
||||||
|
|
|
@ -36,12 +36,12 @@
|
||||||
#include <mono/metadata/debug-helpers.h>
|
#include <mono/metadata/debug-helpers.h>
|
||||||
#include <mono/metadata/image.h>
|
#include <mono/metadata/image.h>
|
||||||
#include <mono/metadata/threads.h>
|
#include <mono/metadata/threads.h>
|
||||||
#include <gc/gc.h>
|
//#include <gc/gc.h>
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
#define SWITCH_MONO_MODULES "mono/"
|
#define SWITCH_MONO_MODULES "mono/"
|
||||||
#define SWITCH_MONO_LIBDIR "lib/"
|
#define SWITCH_MONO_LIBDIR "lib/"
|
||||||
#define SWITCH_MONO_ASSEMBLY "Freeswitch.dll"
|
#define SWITCH_MONO_ASSEMBLY "FreeSwitch.dll"
|
||||||
|
|
||||||
/* Module functions */
|
/* Module functions */
|
||||||
switch_status_t mod_mono_load_modules(const char *module_dir);
|
switch_status_t mod_mono_load_modules(const char *module_dir);
|
||||||
|
@ -90,7 +90,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Construct the path to the Freeswitch assembly, then check to make sure it exists */
|
/* Construct the path to the FreeSwitch assembly, then check to make sure it exists */
|
||||||
switch_size_t assembly_dir_len = strlen(SWITCH_GLOBAL_dirs.base_dir) + strlen(SWITCH_MONO_LIBDIR) + 2; /* Account for / and \0 */
|
switch_size_t assembly_dir_len = strlen(SWITCH_GLOBAL_dirs.base_dir) + strlen(SWITCH_MONO_LIBDIR) + 2; /* Account for / and \0 */
|
||||||
switch_size_t assembly_file_len = assembly_dir_len + strlen(SWITCH_MONO_ASSEMBLY);
|
switch_size_t assembly_file_len = assembly_dir_len + strlen(SWITCH_MONO_ASSEMBLY);
|
||||||
char *assembly_dir = (char *) switch_core_alloc(mono_pool, assembly_dir_len);
|
char *assembly_dir = (char *) switch_core_alloc(mono_pool, assembly_dir_len);
|
||||||
|
@ -102,11 +102,11 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
|
||||||
snprintf(assembly_file, assembly_file_len, "%s/%s%s", SWITCH_GLOBAL_dirs.base_dir, SWITCH_MONO_LIBDIR, SWITCH_MONO_ASSEMBLY);
|
snprintf(assembly_file, assembly_file_len, "%s/%s%s", SWITCH_GLOBAL_dirs.base_dir, SWITCH_MONO_LIBDIR, SWITCH_MONO_ASSEMBLY);
|
||||||
|
|
||||||
if (apr_stat(finfo, assembly_file, 0, mono_pool) != SWITCH_STATUS_SUCCESS) {
|
if (apr_stat(finfo, assembly_file, 0, mono_pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not find Freeswitch.NET assembly");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not find FreeSwitch.NET assembly\n");
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mono wants to know where it will be able to find the Freeswitch assembly if it's not in the GAC */
|
/* Mono wants to know where it will be able to find the FreeSwitch assembly if it's not in the GAC */
|
||||||
if (getenv("MONO_PATH") != NULL) {
|
if (getenv("MONO_PATH") != NULL) {
|
||||||
switch_size_t mono_path_len = strlen(getenv("MONO_PATH")) + strlen(assembly_dir) + 2; /* Account for : and \0 */
|
switch_size_t mono_path_len = strlen(getenv("MONO_PATH")) + strlen(assembly_dir) + 2; /* Account for : and \0 */
|
||||||
char *mono_path = (char *) switch_core_alloc(mono_pool, mono_path_len);
|
char *mono_path = (char *) switch_core_alloc(mono_pool, mono_path_len);
|
||||||
|
@ -144,7 +144,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
|
||||||
|
|
||||||
for (p = switch_hash_first(mono_pool, globals.plugins); p; p = switch_hash_next(p)) {
|
for (p = switch_hash_first(mono_pool, globals.plugins); p; p = switch_hash_next(p)) {
|
||||||
mono_plugin *plugin = (mono_plugin *) switch_core_alloc(mono_pool, sizeof(*plugin));
|
mono_plugin *plugin = (mono_plugin *) switch_core_alloc(mono_pool, sizeof(*plugin));
|
||||||
switch_size_t *key_length = NULL;
|
apr_ssize_t *key_length = NULL;
|
||||||
const void *key = NULL;
|
const void *key = NULL;
|
||||||
void *value = NULL;
|
void *value = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue