[Freeswitch-dev] ARM cross compile

Michael Jerris mike at jerris.com
Sun Jun 29 19:06:39 EDT 2008


See questions/comments inline

On Jun 29, 2008, at 1:19 PM, Simon Capper wrote:

> I'm trying to get freeswitch to cross compile on arm (linux 2.6.21),  
> build
> o/s linux, using OpenWRT buildroot.
>
> I've gotten as far as getting the console running and loading all the
> modules (no calls attempted yet), the switch will be SIP only with a  
> custom
> (yet to be developed) endpoint module for an analog line interface.
>
> I'm using these modules:
> mod_console
> mod_syslog
> mod_commands
> mod_conference
> mod_dptools
> mod_limit
> mod_expr
> mod_esf
> mod_fsv
> mod_ilbc
> mod_dialplan_asterisk
> mod_sofia
> mod_event_socket
> mod_sndfile
> mod_tone_stream
> mod_lua
>
> Is there a way to disable the c++ code in freeswitch without totally
> breaking it? I'm in an embedded environment and libstdc++ is large  
> and takes
> up valuable flash space.

We could fairly easily get rid of the cpp wrapper we use for embedded  
languages, but its used in mod_lua.  The other thing you would have to  
disable would be portions of the switch_xml which uses cpp for the  
globbing routines which would have to be re-written in c or all of the  
globbing includes in the xml would have to not be used.


>
> Is there a way to specify a different install and runtime location  
> for the
> modules (like you can do for log conf and db?) Could be runtime or  
> build
> time, I found --with-modinstdir but this seems to affect the install
> location and the runtime search location.
>

I am sure there is a way with modifications to the build system, but  
why?

>
> In switch_core_state_machine.c backtrace_symbols() fails, not  
> supported in
> my arm environment. I hacked this to use the alternative version of
> print_trace.

Is there a better ifdef we can use here so you don't need to hack?

>
>
> In pcre, libtool failed with the host build tools, had to add -- 
> tag=CC in
> LINK_FOR_BUILD.
> LINK_FOR_BUILD = $(LIBTOOL) --mode=link --tag=CC $(CC_FOR_BUILD)
> $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -I. -I$(top_srcdir)

We should (but clearly do not) do this from the top level configure.   
Can you open a bug on jira for this please.

>
> Although I don't need it the voipcodecs lib it will not load, causes
> freeswitch to exit, lrintf & rintf are not available in my arm  
> environment
> and the voipcodecs configure does not test for them (libsndfile  
> handles this
> correctly).
>

Can you open a bug on jira for this as well
>
> My configure command line:
>    export config_TARGET_CC="$(TARGET_CC)"; \
>    export config_BUILD_CC="$(HOSTCC)"; \
>    export config_TARGET_CFLAGS="$(TARGET_CFLAGS)"; \
>    export config_TARGET_LIBS="-L$(STAGING_DIR)/usr/lib"; \
>    export CC_FOR_BUILD="$(HOSTCC)"; \

We should modify our top level configure to push these down to the  
appropriate libs.

>
>    export ac_cv_file__dev_zero=no; \
>    export apr_cv_tcp_nodelay_with_cork=yes; \
>    export ac_cv_sizeof_ssize_t=4; \
>    export ac_cv_file_dbd_apr_dbd_mysql_c=yes; \

This I assume would be typical in any cross compile situation.  You  
can use a config.cache file for this.
>
>    export
> ac_cv_path__libcurl_config=$(BUILD_DIR)/curl-7.18.2/install/bin/curl- 
> config;
> \

We have configure options for this one --with-libcurl

>
>    export apr_cv_mutex_recursive=yes; \

typical cross stuff, should be able to use config.cache

>
>    (cd $(TOPDIR)/ooma/freeswitch; rm -rf config.{cache,status} ; \

Why?

>
>        $(TARGET_CONFIGURE_OPTS) \
>        CFLAGS='$(TARGET_CFLAGS)' \
>        CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
>        LDFLAGS="-L$(STAGING_DIR)/usr/lib" \

why?

>
>        ./configure \
>        --prefix=$(PKG_BUILD_DIR) \
>        --target=$(GNU_TARGET_NAME) \
>        --host=$(GNU_TARGET_NAME) \
>        --build=$(GNU_HOST_NAME) \
>        --with-libcurl=$(BUILD_DIR)/curl-7.18.2/install \
>        --with-devrandom=/dev/urandom \
>        --with-modinstdir=/mod \
>
>
> Thanks,
>
> Simon
>
>
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org




More information about the Freeswitch-dev mailing list