{"id":240,"date":"2011-05-20T11:57:13","date_gmt":"2011-05-20T18:57:13","guid":{"rendered":"http:\/\/..\/?p=240"},"modified":"2011-05-20T11:57:13","modified_gmt":"2011-05-20T18:57:13","slug":"x-compiling-for-the-beagleboard","status":"publish","type":"post","link":"https:\/\/blog.engine12.com\/?p=240","title":{"rendered":"X-Compiling for the Beagleboard"},"content":{"rendered":"<p><a href=\"..\/wp-content\/uploads\/2011\/05\/beagle.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignright size-medium wp-image-252\" src=\"..\/wp-content\/uploads\/2011\/05\/beagle-300x191.jpg\" alt=\"\" width=\"300\" height=\"191\" \/><\/a>These are the steps for setting up a toolchain and SDK to cross compile GNU Linux for the Beagleboard ver. C4 (OMAP 3530).\u00a0 The host is Ubuntu 10.04.\u00a0 The toolchain is then used to cross compile the Codelite package.<\/p>\n<h2>Toolchain<\/h2>\n<p>Start by making a filesystem and SDK with <a href=\"http:\/\/narcissus.angstrom-distribution.org\/\">Narcissus<\/a>.\u00a0 Be sure to include the option for the toolchain and X11 with xfce4.\u00a0 Save and extract the SDK to the root \/ of the partition.<br \/>\nmark@ubuntu:~$ <span style=\"color: #ff9900\">cd \/<\/span><br \/>\nmark@ubuntu:\/$ <span style=\"color: #ff9900\">sudo tar -xfv \/home\/mark\/Downloads\/angstrom-SDK.tar.gz<\/span><\/p>\n<p>This should create the folders:<br \/>\n\/usr\/local\/angstrom\/\u2026<br \/>\n\/var\/lib\/opkg\/\u2026<\/p>\n<p>I made the following changes to the environment-setup script located in \/usr\/local\/angstrom\/arm\/..\/environment-setup<\/p>\n<p><span style=\"color: #ff9900\">-export PKG_CONFIG_PATH=$SDK_PATH\/$TARGET_SYS${libdir}pkgconfig<\/span><br \/>\n<span style=\"color: #ff9900\">+export PKG_CONFIG_PATH=$SDK_PATH\/$TARGET_SYS\/usr\/lib\/pkgconfig<\/span><\/p>\n<p><span style=\"color: #ff9900\">alias gcc=&#8221;arm-angstrom-linux-gnueabi-gcc&#8221;<\/span><br \/>\n<span style=\"color: #ff9900\">alias g++=&#8221;arm-angstrom-linux-gnueabi-g++&#8221;<\/span><br \/>\n<span style=\"color: #ff9900\">alias as=&#8221;arm-angstrom-linux-gnueabi-as&#8221;<\/span><br \/>\n<span style=\"color: #ff9900\">alias strip=&#8221;arm-angstrom-linux-gnueabi-strip&#8221;<\/span><br \/>\n<span style=\"color: #ff9900\">alias ld=&#8221;arm-angstrom-linux-gnueabi-ld&#8221;<\/span><\/p>\n<p><span style=\"color: #ff9900\">CORE_NUM=`cat \/proc\/cpuinfo | grep processor | wc -l`<\/span><br \/>\n<span style=\"color: #ff9900\">alias make=&#8221;make -j$CORE_NUM&#8221;<\/span><\/p>\n<h2>Beagleboard rootfs install<\/h2>\n<p>Save the file system tar.gz that Narcissus generated and untar it to the SD partition.\u00a0 There are a number of ways to boot the Beagleboard and the particulars of this step are not included.\u00a0 Once Angstrom has booted, login as root and issue the following commands.<\/p>\n<p>root:~# <span style=\"color: #ff9900\">opkg install angstrom-x11-base-depends<\/span><br \/>\nroot:~# <span style=\"color: #ff9900\">startxfce4<\/span><\/p>\n<h2>Cross Compiling<\/h2>\n<p>The <a href=\"http:\/\/codelite.org\/\">Codelite<\/a> project requires the <a href=\"http:\/\/prdownloads.sourceforge.net\/wxwindows\/wxWidgets-2.8.12.tar.gz\">wxWidgets<\/a> GTK libraries.<br \/>\nGet the wxWidgets source package from <a href=\"http:\/\/www.wxwidgets.org\/downloads\/\">http:\/\/www.wxwidgets.org\/downloads\/<\/a><br \/>\nUntar and cd to the root of the wxWidgets folder<\/p>\n<p>Prepare the shell for cross compiling by running the environment-setup script.\u00a0 Don&#8217;t forget the period before \/usr\/&#8230;<\/p>\n<p>wxWidgets-2.9.1$ <span style=\"color: #ff9900\">. \/usr\/local\/angstrom\/arm\/environment-setup<\/span><br \/>\nwxWidgets-2.9.1$ <span style=\"color: #ff9900\">opkg-target update<\/span><br \/>\nwxWidgets-2.9.1$ <span style=\"color: #ff9900\">mkdir build_gtk<\/span><br \/>\nwxWidgets-2.9.1$ <span style=\"color: #ff9900\">cd build_gtk<\/span><\/p>\n<p>Build wxWidgets with the Narcissus SDK:<\/p>\n<p>build_gtk$ <span style=\"color: #ff9900\">..\/configure &#8211;enable-unicode &#8211;enable-debug &#8211;host=arm-angstrom-linux-gnueabi &#8211;with-gtk<\/span><br \/>\nbuild_gtk$ <span style=\"color: #ff9900\">make -j2<\/span><br \/>\nbuild_gtk$ <span style=\"color: #ff9900\">sudo make install<\/span><\/p>\n<p>Build <a href=\"http:\/\/codelite.org\/\">Codelite<\/a> with Narcissus SDK:<br \/>\nDownloads$ <span style=\"color: #ff9900\">svn co https:\/\/codelite.svn.sourceforge.net\/svnroot\/codelite\/trunk codelite<\/span><br \/>\nDownloads$ <span style=\"color: #ff9900\">cd codelite\/<\/span><br \/>\ncodelite$ <span style=\"color: #ff9900\">.\/configure &#8211;host=arm-angstrom-linux-gnueabi<\/span><br \/>\ncodelite$ <span style=\"color: #ff9900\">make -j2<\/span><\/p>\n<h2>Install on Beagleboard<\/h2>\n<p>Copy the wxWidgets libraries labled &#8216;libwx_xxx_xxxx.so&#8217; to \/usr\/local\/lib\/ of the Beagleboard rootfs.\u00a0 Also copy the codelite folder to a location on the Beagleboards rootfs.<\/p>\n<p>Boot the Beagleboard and issue the following commands as root user.<br \/>\nroot:~# <span style=\"color: #ff9900\">echo &#8220;\/usr\/local\/lib&#8221; &gt;&gt; \/etc\/ld.so.conf<\/span><br \/>\nroot:~# <span style=\"color: #ff9900\">ldconfig<\/span><\/p>\n<p>You can either edit the Makefile and change the paths or delete it and reconfigure a new one.\u00a0 I think it still needs to be edited even after a reconfigure iirc.<\/p>\n<p>root:~# cd codelite<\/p>\n<p>root:~\/codelite# <span style=\"color: #ff9900\">.\/configure<\/span><br \/>\nroot:~\/codelite# <span style=\"color: #ff9900\">make install<\/span><\/p>\n<p>Codelite should now be up and running on the Beagleboard.<\/p>\n<p>&nbsp;<\/p>\n<p>Links:<\/p>\n<p><a href=\"http:\/\/narcissus.angstrom-distribution.org\/\">http:\/\/narcissus.angstrom-distribution.org\/<\/a><\/p>\n<p><a href=\"http:\/\/prdownloads.sourceforge.net\/wxwindows\/wxWidgets-2.8.12.tar.gz\">http:\/\/prdownloads.sourceforge.net\/wxwindows\/wxWidgets-2.8.12.tar.gz<\/a><\/p>\n<p><a href=\"http:\/\/www.wxwidgets.org\/downloads\/\">http:\/\/www.wxwidgets.org\/downloads\/<\/a><\/p>\n<p><a href=\"http:\/\/codelite.org\/\">http:\/\/codelite.org\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These are the steps for setting up a toolchain and SDK to cross compile GNU Linux for the Beagleboard ver. C4 (OMAP 3530).\u00a0 The host is Ubuntu 10.04.\u00a0 The toolchain is then used to cross compile the Codelite package. Toolchain Start by making a filesystem and SDK with Narcissus.\u00a0 Be sure to include the option <a href='https:\/\/blog.engine12.com\/?p=240'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[3,4,8],"_links":{"self":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts\/240"}],"collection":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=240"}],"version-history":[{"count":0,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=\/wp\/v2\/posts\/240\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.engine12.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}