{"id":1757,"date":"2015-08-29T01:49:00","date_gmt":"2015-08-28T17:49:00","guid":{"rendered":"http:\/\/learn-house.idv.tw\/?p=1757"},"modified":"2015-08-31T20:51:05","modified_gmt":"2015-08-31T12:51:05","slug":"alljoyn-build-from-source-linux","status":"publish","type":"post","link":"https:\/\/learn-house.idv.tw\/?p=1757","title":{"rendered":"[Alljoyn] Build from source &#8211; Linux"},"content":{"rendered":"<p>\u6700\u8fd1\u56e0\u70ba\u5de5\u4f5c\u9700\u8981\uff0c\u6240\u4ee5\u5728\u7814\u7a76Alljoyn<\/p>\n<p>\u81f3\u65bcAlljoyn\u662f\u4ec0\u9ebc\uff0c\u6211\u9019\u88e1\u66ab\u6642\u5c31\u5148\u4e0d\u8aaa\u660e\uff0c\u6709\u8208\u8da3\u7684\u53ef\u4ee5\u5148\u8f9c\u72d7\u627e\u627e\u8cc7\u6599<\/p>\n<p>\u4e4b\u5f8c\u5982\u679c\u6709\u7a7a\u6211\u6703\u5c07\u770b\u5b8c\u5b98\u65b9\u7684\u6587\u4ef6\u518d\u5beb\u4e00\u7bc7\u4ecb\u7d39\u8207\u5fc3\u5f97<\/p>\n<p>\u9019\u7bc7\u4e3b\u8981\u662f\u5148\u5beb\u600e\u9ebc\u6a23build code\uff0c\u7531\u65bc\u5b98\u65b9\u7684\u6587\u4ef6\u5c1a\u672a\u5b8c\u5584\uff0c\u6309\u7167\u6587\u4ef6\u4e0abuild code\u53ef\u80fd\u6703\u5931\u6557<\/p>\n<p>\u56e0\u6b64\u6211\u4fee\u6b63\u4e86\u4e00\u4e9b\u5b98\u65b9\u6587\u4ef6\u53ef\u80fd\u6709\u554f\u984c\u7684\u90e8\u5206\uff0c\u4ee5\u4e0b\u662f\u6211\u7684\u57f7\u884c\u6b65\u9a5f\uff1a<\/p>\n<p><!--more--><\/p>\n<p>OS: Ubuntu-14.04.3-desktop-i386<\/p>\n<p>Reference: <a class=\"ext-link\" href=\"http:\/\/allseenalliance.org\/developers\/develop\/building\/linux\"><span class=\"icon\">\u00a0<\/span>http:\/\/allseenalliance.org\/developers\/develop\/building\/linux<\/a><\/p>\n<ul>\n<li>Build tools and libs(<strong>need take off ia32-libs<\/strong>)<\/li>\n<\/ul>\n<pre class=\"wiki\">sudo apt-get install build-essential libgtk2.0-dev libssl-dev xsltproc libxml2-dev\r\n\r\n<\/pre>\n<ul>\n<li>Build ia32-libs by Synaptic<\/li>\n<\/ul>\n<pre class=\"wiki\">1.\u9ede\u9078\u300cUbuntu\u8edf\u9ad4\u4e2d\u5fc3\u300d\r\n2.\u641c\u5c0b\u300csynaptic\u300d\r\n3.\u9ede\u9078\u300c\u5b89\u88dd\u300d\r\n4.\u958b\u555fsynaptic\r\n5.\u641c\u5c0bia32-libs\r\n6.\u52fe\u9078ia32-libs-multiarch\r\n7.\u5b89\u88dd\r\n\r\n<\/pre>\n<ul>\n<li>Install Python v2.6\/2.7 (Python v3.0 is not compatible and will cause errors)<\/li>\n<\/ul>\n<pre class=\"wiki\">sudo apt-get install python\r\n\r\n<\/pre>\n<ul>\n<li>Install SCons v2.0<\/li>\n<\/ul>\n<pre class=\"wiki\">sudo apt-get install scons\r\n\r\n<\/pre>\n<ul>\n<li>OpenSSL<\/li>\n<\/ul>\n<pre class=\"wiki\">sudo apt-get install libssl-dev\r\n\r\n<\/pre>\n<ul>\n<li>Download Using Git<\/li>\n<\/ul>\n<pre class=\"wiki\">mkdir WORKING_DIRECTORY\r\ncd WORKING_DIRECTORY\r\n\r\ngit clone https:\/\/git.allseenalliance.org\/gerrit\/core\/alljoyn.git core\/alljoyn\r\ngit clone https:\/\/git.allseenalliance.org\/gerrit\/core\/ajtcl.git core\/ajtcl\r\ngit clone https:\/\/git.allseenalliance.org\/gerrit\/services\/base.git services\/base\r\ngit clone https:\/\/git.allseenalliance.org\/gerrit\/services\/base_tcl.git services\/base_tcl\r\ngit clone https:\/\/git.allseenalliance.org\/gerrit\/data\/datadriven_api.git data\/datadriven_api\r\ngit clone https:\/\/git.allseenalliance.org\/gerrit\/devtools\/codegen.git devtools\/codegen\r\n\r\n<\/pre>\n<ul>\n<li>The tree should look like below. Note, extra directories may exist.<\/li>\n<\/ul>\n<pre class=\"wiki\">root-source-dir\/\r\n  core\/\r\n      alljoyn\/\r\n      ajtcl\/\r\n  services\/\r\n      base\/\r\n      base_tcl\/\r\n\r\n<\/pre>\n<h2 id=\"build-samples\">Build Samples<\/h2>\n<pre class=\"wiki\">cd &lt;root dir of source&gt;\/core\/alljoyn\r\nscons BINDINGS=cpp WS=off BT=off ICE=off SERVICES=\"about,notification,controlpanel,config,onboarding,sample_apps\"\r\n\r\n<\/pre>\n<h2 id=\"build-ac-server-sample\">Build AC Server Sample<\/h2>\n<p>The AC Server Sample app uses all of the base services to simulate an AC device.<\/p>\n<pre class=\"wiki\"># Note, exclude the \"base\" dir for pre-14.06 source\r\ncd $AJ_ROOT\/services\/base\/sample_apps\r\nscons BINDINGS=cpp WS=off ALL=1\r\n\r\n<\/pre>\n<h2 id=\"add-the-alljoyn-trade-framework-to-an-existing-app\">Add the AllJoyn\u00ae framework to an existing app<\/h2>\n<ul>\n<li>Setup<\/li>\n<\/ul>\n<pre class=\"wiki\">  export AJ_ROOT=~\/alljoyn\r\n\r\n  # &lt;TARGET CPU&gt; can be either x86_64, x86, or whatever value you set for CPU= when running SCons.\r\n  export AJ_DIST=\"$AJ_ROOT\/core\/alljoyn\/build\/linux\/&lt;TARGET CPU&gt;\/debug\/dist\"\r\n\r\n<\/pre>\n<ul>\n<li>Add header include directories<\/li>\n<\/ul>\n<pre class=\"wiki\">export CXXFLAGS=\"$CXXFLAGS \\\r\n    -I$AJ_DIST\/cpp\/inc \\\r\n    -I$AJ_DIST\/about\/inc \\\r\n    -I$AJ_DIST\/services_common\/inc \\\r\n    -I$AJ_DIST\/notification\/inc \\\r\n    -I$AJ_DIST\/controlpanel\/inc \\\r\n    -I$AJ_DIST\/services_common\/inc \\\r\n    -I$AJ_DIST\/samples_common\/inc\"\r\n\r\n<\/pre>\n<ul>\n<li>Configure linker to include required libs<\/li>\n<\/ul>\n<pre class=\"wiki\">export LDFLAGS=\"$LDFLAGS \\\r\n    -L$AJ_DIST\/cpp\/lib \\\r\n    -L$AJ_DIST\/about\/lib \\\r\n    -L$AJ_DIST\/services_common\/lib \\\r\n    -L$AJ_DIST\/notification\/lib \\\r\n    -L$AJ_DIST\/controlpanel\/lib\"\r\n<\/pre>\n<h2 id=\"RunningTheACServerSample\">Running The AC Server Sample<\/h2>\n<ul>\n<li>Prerequisites<\/li>\n<\/ul>\n<p>Navigate to the AllJoyn root dir, then:<\/p>\n<pre class=\"wiki\">export AJ_ROOT=`pwd`\r\n\r\n# Set $TARGET CPU to the \"CPU=\" value used when running scons, e.g. x86_64, x86.\r\nexport TARGET_CPU=x86\r\n\r\nexport LD_LIBRARY_PATH=$AJ_ROOT\/core\/alljoyn\/build\/linux\/$TARGET_CPU\/debug\/dist\/cpp\/lib:$AJ_ROOT\/core\/alljoyn\/build\/linux\/$TARGET_CPU\/debug\/dist\/about\/lib:$AJ_ROOT\/services\/base\/sample_apps\/build\/linux\/$TARGET_CPU\/debug\/dist\/controlpanel\/lib:$AJ_ROOT\/services\/base\/sample_apps\/build\/linux\/$TARGET_CPU\/debug\/dist\/notification\/lib:$AJ_ROOT\/services\/base\/sample_apps\/build\/linux\/$TARGET_CPU\/debug\/dist\/services_common\/lib:$AJ_ROOT\/services\/base\/sample_apps\/build\/linux\/$TARGET_CPU\/debug\/dist\/config\/lib:$LD_LIBRARY_PATH\r\n<\/pre>\n<ul>\n<li>Run the AC Server Sample App<\/li>\n<\/ul>\n<pre class=\"wiki\">$AJ_ROOT\/services\/base\/sample_apps\/build\/linux\/$TARGET_CPU\/debug\/dist\/sample_apps\/bin\/ACServerSample --config-file=$AJ_ROOT\/services\/base\/sample_apps\/build\/linux\/$TARGET_CPU\/debug\/dist\/sample_apps\/bin\/ACServerSample.conf<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u56e0\u70ba\u5de5\u4f5c\u9700\u8981\uff0c\u6240\u4ee5\u5728\u7814\u7a76Alljoyn \u81f3\u65bcAlljoyn\u662f\u4ec0\u9ebc\uff0c\u6211\u9019\u88e1\u66ab\u6642\u5c31\u5148\u4e0d\u8aaa\u660e\uff0c\u6709\u8208\u8da3\u7684\u53ef\u4ee5\u5148\u8f9c\u72d7<span class=\"post-excerpt-end\">&hellip;<\/span><\/p>\n<p class=\"more-link\"><a href=\"https:\/\/learn-house.idv.tw\/?p=1757\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1757","post","type-post","status-publish","format-standard","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/1757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1757"}],"version-history":[{"count":0,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/1757\/revisions"}],"wp:attachment":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}