diff --git a/conf/Makefile.arm-linux b/conf/Makefile.arm-linux index 98027327bb..3efce866b2 100644 --- a/conf/Makefile.arm-linux +++ b/conf/Makefile.arm-linux @@ -39,12 +39,12 @@ else FLOAT_ABI ?= -mfloat-abi=softfp -mfpu=vfp endif -ARCH_FLAGS ?= -mtune=cortex-a8 -march=armv7-a +ARCH_CFLAGS ?= -mtune=cortex-a8 -march=armv7-a # add ARM specifc flags to CFLAGS, LDFLAGS -CFLAGS += $(FLOAT_ABI) $(ARCH_FLAGS) +CFLAGS += $(FLOAT_ABI) $(ARCH_CFLAGS) LDFLAGS += $(FLOAT_ABI) -CXXFLAGS += $(FLOAT_ABI) $(ARCH_FLAGS) +CXXFLAGS += $(FLOAT_ABI) $(ARCH_CFLAGS) # include the common linux Makefile (common CFLAGS, actual targets) include $(PAPARAZZI_SRC)/conf/Makefile.linux diff --git a/conf/boards/ardrone2_raw.makefile b/conf/boards/ardrone2_raw.makefile index a747b653af..eed9e4c415 100644 --- a/conf/boards/ardrone2_raw.makefile +++ b/conf/boards/ardrone2_raw.makefile @@ -42,6 +42,10 @@ $(TARGET).CFLAGS +=-DARDRONE2_RAW # handle linux signals by hand $(TARGET).CFLAGS += -DUSE_LINUX_SIGNAL +# Link static (Done for GLIBC) +$(TARGET).CFLAGS += -DLINUX_LINK_STATIC +$(TARGET).LDFLAGS += -static + # ----------------------------------------------------------------------- # default LED configuration diff --git a/conf/boards/bebop.makefile b/conf/boards/bebop.makefile index fbc695aac3..6f00e27cff 100644 --- a/conf/boards/bebop.makefile +++ b/conf/boards/bebop.makefile @@ -34,6 +34,10 @@ $(TARGET).CFLAGS += -DUSE_LINUX_SIGNAL # Compile the video specific parts $(TARGET).srcs += $(SRC_BOARD)/video.c +# Link static (Done for GLIBC) +$(TARGET).CFLAGS += -DLINUX_LINK_STATIC +$(TARGET).LDFLAGS += -static + # ----------------------------------------------------------------------- # default LED configuration diff --git a/sw/airborne/arch/linux/udp_socket.c b/sw/airborne/arch/linux/udp_socket.c index ac20f53bab..64be511c2b 100644 --- a/sw/airborne/arch/linux/udp_socket.c +++ b/sw/airborne/arch/linux/udp_socket.c @@ -40,7 +40,7 @@ /** * Create UDP socket and bind it. * @param[out] sock pointer to already allocated UdpSocket struct - * @param[in] host hostname/address + * @param[in] host ip address or hostname (hostname not possible if static linking) * @param[in] port_out output port * @param[in] port_in input port (set to < 0 to disable) * @param[in] broadcast if TRUE enable broadcasting @@ -52,6 +52,7 @@ int udp_socket_create(struct UdpSocket *sock, char *host, int port_out, int port return -1; } +#ifndef LINUX_LINK_STATIC /* try to convert host ipv4 address to binary format */ struct in_addr host_ip; if (!inet_aton(host, &host_ip)) { @@ -71,6 +72,7 @@ int udp_socket_create(struct UdpSocket *sock, char *host, int port_out, int port return -1; } } +#endif // Create the socket with the correct protocl sock->sockfd = socket(PF_INET, SOCK_DGRAM, 0); @@ -96,7 +98,11 @@ int udp_socket_create(struct UdpSocket *sock, char *host, int port_out, int port // set the output/destination address for use in sendto later sock->addr_out.sin_family = PF_INET; sock->addr_out.sin_port = htons(port_out); +#ifndef LINUX_LINK_STATIC sock->addr_out.sin_addr.s_addr = host_ip.s_addr; +#else + sock->addr_out.sin_addr.s_addr = inet_addr(host); +#endif return 0; }