From 78c7eff78738420607233841a97c5b6cf8298eb0 Mon Sep 17 00:00:00 2001 From: James Green Date: Thu, 14 Sep 2006 14:48:26 +0000 Subject: [PATCH] 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 --- src/mod/languages/mod_mono/Makefile | 14 ++++++++++---- src/mod/languages/mod_mono/mod_mono.c | 12 ++++++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/mod/languages/mod_mono/Makefile b/src/mod/languages/mod_mono/Makefile index d63a4b911c..e8ae691ed4 100644 --- a/src/mod/languages/mod_mono/Makefile +++ b/src/mod/languages/mod_mono/Makefile @@ -1,19 +1,25 @@ VERSION = mono-1.1.13.8 TARBALL = mono-1.1.13.8.tar.gz -CFLAGS += `pkg-config --cflags mono` -LDFLAGS += `pkg-config --libs mono` +GLIB_TARBALL = glib-2.12.3.tar.gz +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) 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 $(CC) -fPIC $(CFLAGS) -c -o $@ $< $(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(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: rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~ diff --git a/src/mod/languages/mod_mono/mod_mono.c b/src/mod/languages/mod_mono/mod_mono.c index e294563317..7e3d6d4012 100755 --- a/src/mod/languages/mod_mono/mod_mono.c +++ b/src/mod/languages/mod_mono/mod_mono.c @@ -36,12 +36,12 @@ #include #include #include -#include +//#include #include #define SWITCH_MONO_MODULES "mono/" #define SWITCH_MONO_LIBDIR "lib/" -#define SWITCH_MONO_ASSEMBLY "Freeswitch.dll" +#define SWITCH_MONO_ASSEMBLY "FreeSwitch.dll" /* Module functions */ 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; } - /* 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_file_len = assembly_dir_len + strlen(SWITCH_MONO_ASSEMBLY); 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); 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; } - /* 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) { 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); @@ -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)) { 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; void *value = NULL;