Commit 88663f99 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Fix cross compiling.

Allow selection of toolchains with --host and --build options in configure.
parent a4feee76
......@@ -17,6 +17,13 @@ else
FLEX=/usr/local/bin/flex
endif
BUILDCC:=${CC}
BUILDLIBTOOL:=${LIBTOOL}
ifdef BUILDSYS
BUILDCC:=${BUILDSYS}-gcc
BUILDLIBTOOL:=${BUILDSYS}-libtool
endif
ifdef HOSTSYS
CC=${HOSTSYS}-gcc
LIBTOOL=${HOSTSYS}-libtool
......
HOSTSYS=@HOSTSYS@
BUILDSYS=@BUILDSYS@
BUILD_CONSOLE=@BUILD_CONSOLE@
BUILD_CONSOLE_HTTPD=@BUILD_CONSOLE_HTTPD@
BUILD_CONSOLE_J2000_INDI=@BUILD_CONSOLE_J2000_INDI@
......@@ -60,6 +60,9 @@ AS_CASE(["$with_libindi"],
# Some conclusions based on test results
#
AC_SUBST(HOSTSYS,["$ac_cv_env_host_alias_value"])
AC_SUBST(BUILDSYS,["$ac_cv_env_build_alias_value"])
AS_IF([test "$enable_console" = "yes"],
[AC_SUBST(BUILD_CONSOLE,["yes"])],
[AC_SUBST(BUILD_CONSOLE,[""])])
......
......@@ -79,7 +79,7 @@ static int param_set_gain(struct controller_block *adc, char *param, int argc,
return 0;
}
static int param_set_gain(struct controller_block *adc, char *param, int argc,
static int param_set_offset(struct controller_block *adc, char *param, int argc,
va_list val)
{
adc->private->offset[param[6]-'0'] = va_arg(val, double);
......@@ -107,7 +107,7 @@ static struct controller_block_param_list params[] = {
};
static struct controller_block * block_am335x_adc_create(char *name)
static struct controller_block * block_am335x_adc_create(char *name, int argc, va_list val)
{
struct controller_block *adc;
void *base;
......@@ -230,7 +230,7 @@ static struct controller_block * block_am335x_adc_create(char *name)
adc->calculate = adc_calculate;
if (controller_block_param_list_init(adc, params))
if (controller_block_param_list_add(adc, params))
goto err_param;
if (controller_block_add(adc))
......
......@@ -50,7 +50,7 @@ static struct controller_block_outterm_list outterms[] = {
};
static struct controller_block * block_am335x_gpi_create(char *name, va_list ap)
static struct controller_block * block_am335x_gpi_create(char *name, int argc, va_list ap)
{
struct controller_block *gpi;
void *base;
......
......@@ -52,7 +52,7 @@ static struct controller_block_interm_list interms[] = {
};
static struct controller_block * block_am335x_gpo_create(char *name, va_list ap)
static struct controller_block * block_am335x_gpo_create(char *name, int argc, va_list ap)
{
struct controller_block *gpo;
void *base;
......
......@@ -150,7 +150,7 @@ static struct controller_block_interm_list interms[] = {
};
static struct controller_block * block_am335x_pwm_create(char *name, va_list ap)
static struct controller_block * block_am335x_pwm_create(char *name, int argc, va_list ap)
{
struct controller_block *pwm;
void *base;
......@@ -224,7 +224,7 @@ static struct controller_block * block_am335x_pwm_create(char *name, va_list ap)
pwm->calculate = pwm_calculate;
if (controller_block_param_list_init(pwm, params))
if (controller_block_param_list_add(pwm, params))
goto err_param;
if (controller_block_add(pwm))
......@@ -233,6 +233,7 @@ static struct controller_block * block_am335x_pwm_create(char *name, va_list ap)
return pwm;
err_add:
err_param:
err_interm:
controller_block_free(pwm);
err_alloc:
......
......@@ -46,7 +46,7 @@ static struct controller_block_outterm_list outterms[] = {
};
static struct controller_block * block_am335x_qed_create(char *name, va_list ap)
static struct controller_block * block_am335x_qed_create(char *name, int argc, va_list ap)
{
struct controller_block *qed;
void *base;
......
......@@ -22,6 +22,11 @@ IL2C_OBJS := $(IL2C_SRCS:.c=.o)
$(IL2C_OBJS): CFLAGS += -O3 -Wall
$(DIR)/il2c: $(IL2C_OBJS)
# il2c is used in the build, not runtime
$(IL2C_OBJS): CC = $(BUILDCC)
$(DIR)/il2c: CC = $(BUILDCC)
$(DIR)/il2c: LIBTOOL = $(BUILDLIBTOOL)
TARGETS += $(IL2C_TARGETS)
CLEAN += $(IL2C_TARGETS) $(IL2C_OBJS)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment