# Compile 3rd library (libcurl, etc ...) for Legato sur MangOH

**URL:** <https://mangoh.discourse.group/t/compile-3rd-library-libcurl-etc-for-legato-sur-mangoh/153>\
**Category:** Uncategorized\
**Created:** [July 12, 2016, 11:29pm UTC](https://mangoh.discourse.group/t/compile-3rd-library-libcurl-etc-for-legato-sur-mangoh/153 "2016-07-12T23:29:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trnguyen](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@trnguyen](https://mangoh.discourse.group/u/trnguyen)\
**Post date:** [July 12, 2016, 11:29pm UTC](https://mangoh.discourse.group/t/compile-3rd-library-libcurl-etc-for-legato-sur-mangoh/153/1 "2016-07-12T23:29:58Z")

</div>

Hi all,

I’m new to Legato.  
I have been working on some embedded Linux device before.  
I have an C application which linked to libcurl library on my current device and I want to make it run on Legato platform.  
So is it possible to compile libcurl (or any 3rd C/C++ library in general) as a Legato component and my application as a Legato application then install and run it on my MangOH dev board? I would really appreciate if you have any tutorial related to this subject.

I’m using Developer Studio 4.1 (Legato 16.4) on Ubuntu 16.04 64 bits.

Thank a lot for your help,

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [July 13, 2016, 8:38pm UTC](https://mangoh.discourse.group/t/compile-3rd-library-libcurl-etc-for-legato-sur-mangoh/153/2 "2016-07-13T20:38:54Z")

</div>

Follow up here for this question:  
[https://forum.sierrawireless.com/viewtopic.php?f=177&t=9821&sid=aae664744be9aa1164228f03eaec0208](https://forum.sierrawireless.com/viewtopic.php?f=177&t=9821&sid=aae664744be9aa1164228f03eaec0208)

---

<div class="post-metadata">

**Author:** ![gregnietsky](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/gregnietsky/32/66_2.png) [@gregnietsky](https://mangoh.discourse.group/u/gregnietsky)\
**Post date:** [July 14, 2016, 8:34am UTC](https://mangoh.discourse.group/t/compile-3rd-library-libcurl-etc-for-legato-sur-mangoh/153/3 "2016-07-14T08:34:54Z")

</div>

I posted this on the sierra forum coping here

## Makefile bits this is abuse of makefile but you will get some ideas how to do it

PREFIX=/usr

LEGATO\_OUTPUT = \_build\_linphone/wp85/build  
TARGET = wp85  
TOOLCHAINPRE = ${WP85\_TOOLCHAIN\_DIR}/arm-poky-linux-gnueabi

SYSROOT = $(shell $(TOOLCHAINPRE)-gcc -print-sysroot)  
PWD = $(shell pwd)

CC = $(TOOLCHAINPRE)-gcc  
CXX = $(TOOLCHAINPRE)-g++  
LD = $(TOOLCHAINPRE)-ld  
AR = $(TOOLCHAINPRE)-ar  
RANLIB = $(TOOLCHAINPRE)-ranlib

sqlite-autoconf\_OPT = CFLAGS="-DSQLITE\_SECURE\_DELETE -DSQLITE\_ENABLE\_UNLOCK\_NOTIFY"

sqlite-autoconf:  
(if [! -d build/$@];then   
mkdir build/$@;   
fi;  
cd $@;   
./$($@\_CPTH)configure --prefix=/usr --libdir=/usr/lib CC=$(CC) CXX=$(CXX) --host=arm-poky-linux-gnueabi $($@\_OPT))  
make -C $@  
make -C $@ DESTDIR=$(SYSROOT) install  
make -C $@ DESTDIR=$(PWD)/output install

install:  
mkdir -p $(LEGATO\_OUTPUT)  
(cd output && rsync -avPR --exclude=_.a --exclude=_.la usr/lib usr/bin usr/sbin …/$(LEGATO\_OUTPUT)/)  
$(TOOLCHAINPRE)-strip $(LEGATO\_OUTPUT)/usr/bin/\* || true  
$(TOOLCHAINPRE)-strip $(LEGATO\_OUTPUT)/usr/sbin/\* || true  
$(TOOLCHAINPRE)-strip $(LEGATO\_OUTPUT)/usr/lib/\* || true  
./mkadef \> linphone.adef  
mkapp -t $(TARGET) linphone.adef
