{"id":137,"date":"2008-11-18T09:12:04","date_gmt":"2008-11-17T23:42:04","guid":{"rendered":"http:\/\/www.clearchain.com\/blog\/?p=137"},"modified":"2008-11-18T09:12:04","modified_gmt":"2008-11-17T23:42:04","slug":"jhbuild-just-wont-build-aka-include-path-madness","status":"publish","type":"post","link":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness","title":{"rendered":"jhbuild just won&#8217;t build! (aka Include path madness)"},"content":{"rendered":"<p>I&#8217;ve been recently trying to work out why jhbuild fails to build xorg on my FreeBSD box. Traditionally I compile to <em>\/usr\/local\/<\/em> however after wanting to experiment with MPX I&#8217;ve set things up so that I compile to\u00a0<em>\/usr\/local\/MPX<\/em><\/p>\n<p>Sadly this kept breaking in xorg\/lib\/libX11 with the error:<\/p>\n<p><!--more--><\/p>\n<pre style=\"padding-left: 30px; \">xcb_io.c: In function 'require_socket':\r\nxcb_io.c:35: warning: implicit declaration of function 'xcb_take_socket'\r\nxcb_io.c:35: warning: nested extern declaration of 'xcb_take_socket'\r\nxcb_io.c: In function 'process_responses':\r\nxcb_io.c:188: error: 'GenericEvent' undeclared (first use in this function)\r\nxcb_io.c:188: error: (Each undeclared identifier is reported only once\r\nxcb_io.c:188: error: for each function it appears in.)\r\nxcb_io.c:189: error: 'xcb_ge_event_t' undeclared (first use in this function)\r\nxcb_io.c:189: error: expected expression before ')' token\r\nxcb_io.c:193: error: expected expression before ')' token\r\nxcb_io.c: In function '_XSend':\r\nxcb_io.c:332: warning: implicit declaration of function 'xcb_writev'\r\nxcb_io.c:332: warning: nested extern declaration of 'xcb_writev'<\/pre>\n<p>\u00a0<\/p>\n<p>For the life of me I couldn&#8217;t make sense of it. GenericEvent is defined in xcb\/xcb.h and checking the preprocessor output xcb.h was being included. Likewise the lack of xcb_ge_event_t was baffling me as it was certain in xcb\/xcb.h. It wasn&#8217;t till I looked a little closer that I realised that the wrong xcb.h was being used. Turns out that \/<em>usr\/local\/include\/xcb\/xcb.h<\/em> was being used however I wanted <em>\/usr\/local\/MPX\/include\/xcb\/xcb.h<\/em> to be used. Hence I tried adding <em>-I\/usr\/local\/MPX<\/em> to CFLAGS with no success and also tried setting <em>CC=&#8221;gcc -I\/usr\/local\/MPX&#8221;<\/em> also with no success. It just didn&#8217;t make sense!<\/p>\n<p>Looking at the gcc line, <em>\/u<\/em><em>sr\/local\/MPX<\/em> should have been used first. It wasn&#8217;t until I finally check the preprocessor what it thought the system paths were did it all make sense.<\/p>\n<p>The output from cpp is below:<\/p>\n<pre style=\"padding-left: 30px; \"><span style=\"font-family: 'Lucida Grande'; line-height: 19px; white-space: normal; \">U<\/span>sing built-in specs.\r\nTarget: amd64-undermydesk-freebsd\r\nConfigured with: FreeBSD\/amd64 system compiler\r\nThread model: posix\r\ngcc version 4.2.1 20070719 \u00a0[FreeBSD]\r\n\u00a0\/usr\/libexec\/cc1 -E -quiet -v -I. -I..\/include\/X11 -I..\/include -I..\/include\/X11\r\n-I..\/include -I..\/include\/X11 -I..\/src\/xcms -I..\/src\/xkb -I..\/src\/xlibi18n -I\/usr\/local\/include\u00a0\r\n-D_LONGLONG -DHAVE_CONFIG_H -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -D_THREAD_SAFE -D_BSD_SOURCE\r\n-DX11_t -DTRANS_CLIENT -isystem \/usr\/local\/MPX\/include xcb_io.c -o xcb_io.lo -Wall -Wpointer-arith\r\n-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -fworking-directory -O0<\/pre>\n<pre style=\"padding-left: 30px; \">ignoring duplicate directory \"\/usr\/local\/MPX\/include\"\r\nignoring duplicate directory \"\/usr\/include\"\r\nignoring duplicate directory \"..\/include\/X11\"\r\nignoring duplicate directory \"..\/include\"\r\nignoring duplicate directory \"..\/include\/X11\"\r\n#include \"...\" search starts here:\r\n#include &lt;...&gt; search starts here:\r\n\u00a0.\r\n\u00a0..\/include\/X11\r\n\u00a0..\/include\r\n\u00a0..\/src\/xcms\r\n\u00a0..\/src\/xkb\r\n\u00a0..\/src\/xlibi18n\r\n\u00a0\/usr\/local\/include\r\n\u00a0\/usr\/local\/MPX\/include\r\n\u00a0\/usr\/include\r\nEnd of search list.<\/pre>\n<p>It turns out that jhbuild sets the environment variable <em>C_INCLUDE_PATH, <\/em>in this case to <em>\/usr\/local\/MPX\/include<\/em>. This variable adds a library to the system search path. Whilst it prepends to the system search path, \u00a0-I<em>\u00a0<\/em>options prepend the system search path, hence with one -I option being <em>\/usr\/local\/include<\/em>, we get the ordering incorrect and the wrong header is used. \u00a0<\/p>\n<p>So now it was up to working out why <em>\/usr\/local\/include<\/em> was needed. Searching config.log it turns out the bigfontproto was needed by libX11, pkg_config was searching for it and finding it not in <em>\/usr\/local\/MPX\/lib\/share\/pkg_config<\/em> but in <em>\/usr\/local\/lib\/share\/pkg_config<\/em>. The reason for this is bigfontproto wasn&#8217;t listed as a dependancy in the xorg.modules file used by jhbuild (avaliable at:<a href=\"http:\/\/cgit.freedesktop.org\/xorg\/util\/modular\/tree\/xorg.modules\">http:\/\/cgit.freedesktop.org\/xorg\/util\/modular\/tree\/xorg.modules<\/a>). Because of this bigfont proto wasn&#8217;t being built by <a href=\"http:\/\/www.jamesh.id.au\/software\/jhbuild\/\">jhbuild<\/a>. Hence the only bigfontproto that existed on the box was the default system bigfont proto which WAS located under \/usr\/local\/include.\u00a0<\/p>\n<p>The fix was simple. List xf86bigfontproto as a dependency in xorg.modules and all was good. bigfontproto is now pulled in as a dependency and hence gets built before libX11. pkg_config now correctly finds bigfontproto in \/<em>usr\/local\/MPX\/lib\/share\/pkg_config<\/em> hence doesn&#8217;t need to fallback to the system version so <em>-I\/usr\/local\/include<\/em> doesn&#8217;t get added to the gcc line. Hence the compiler uses <em>\/usr\/local\/MPX\/include\/xcb\/xcb.h <\/em>rather than the one in <em>\/usr\/local\/include\/xcb\/xcb.h<\/em>\u00a0and the compiler errors vanish.<\/p>\n<p>So now things are building and I&#8217;m off for a coffee!<br \/>\n(xorg.modules has also been correctly updated so some other poor person doesn&#8217;t have the same issues).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been recently trying to work out why jhbuild fails to build xorg on my FreeBSD box. Traditionally I compile to \/usr\/local\/ however after wanting to experiment with MPX I&#8217;ve set things up so that I compile to\u00a0\/usr\/local\/MPX Sadly this kept breaking in xorg\/lib\/libX11 with the error:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,21,7,6],"tags":[103,105,102,104],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-freedesktop","category-opensource","category-programming","category-unisa","tag-c_include_path","tag-gcc","tag-jhbuild","tag-search-paths"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>jhbuild just won&#039;t build! (aka Include path madness) - ClearChain<\/title>\n<meta name=\"description\" content=\"I&#039;ve been recently trying to work out why jhbuild fails to build xorg on my FreeBSD box. Traditionally I compile to \/usr\/local\/ however after wanting to\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Close\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness\"},\"author\":{\"name\":\"Benjamin Close\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98\"},\"headline\":\"jhbuild just won&#8217;t build! (aka Include path madness)\",\"datePublished\":\"2008-11-17T23:42:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness\"},\"wordCount\":538,\"commentCount\":1,\"keywords\":[\"C_INCLUDE_PATH\",\"gcc\",\"jhbuild\",\"search paths\"],\"articleSection\":[\"FreeDesktop\",\"OpenSource\",\"Programming\",\"UniSA\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness\",\"url\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness\",\"name\":\"jhbuild just won't build! (aka Include path madness) - ClearChain\",\"isPartOf\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/#website\"},\"datePublished\":\"2008-11-17T23:42:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98\"},\"description\":\"I've been recently trying to work out why jhbuild fails to build xorg on my FreeBSD box. Traditionally I compile to \/usr\/local\/ however after wanting to\",\"breadcrumb\":{\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.clearchain.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"jhbuild just won&#8217;t build! (aka Include path madness)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#website\",\"url\":\"https:\/\/www.clearchain.com\/blog\/\",\"name\":\"ClearChain\",\"description\":\"-= Daily Happenings =-\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.clearchain.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98\",\"name\":\"Benjamin Close\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg\",\"caption\":\"Benjamin Close\"},\"sameAs\":[\"http:\/\/www.clearchain.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jhbuild just won't build! (aka Include path madness) - ClearChain","description":"I've been recently trying to work out why jhbuild fails to build xorg on my FreeBSD box. Traditionally I compile to \/usr\/local\/ however after wanting to","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness","twitter_misc":{"Written by":"Benjamin Close","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#article","isPartOf":{"@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness"},"author":{"name":"Benjamin Close","@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98"},"headline":"jhbuild just won&#8217;t build! (aka Include path madness)","datePublished":"2008-11-17T23:42:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness"},"wordCount":538,"commentCount":1,"keywords":["C_INCLUDE_PATH","gcc","jhbuild","search paths"],"articleSection":["FreeDesktop","OpenSource","Programming","UniSA"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness","url":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness","name":"jhbuild just won't build! (aka Include path madness) - ClearChain","isPartOf":{"@id":"https:\/\/www.clearchain.com\/blog\/#website"},"datePublished":"2008-11-17T23:42:04+00:00","author":{"@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98"},"description":"I've been recently trying to work out why jhbuild fails to build xorg on my FreeBSD box. Traditionally I compile to \/usr\/local\/ however after wanting to","breadcrumb":{"@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.clearchain.com\/blog\/posts\/jhbuild-just-wont-build-aka-include-path-madness#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.clearchain.com\/blog"},{"@type":"ListItem","position":2,"name":"jhbuild just won&#8217;t build! (aka Include path madness)"}]},{"@type":"WebSite","@id":"https:\/\/www.clearchain.com\/blog\/#website","url":"https:\/\/www.clearchain.com\/blog\/","name":"ClearChain","description":"-= Daily Happenings =-","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.clearchain.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/aef6faa2c32188398139db9270ca1c98","name":"Benjamin Close","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.clearchain.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19dca0aa372edfa901b93c556dfda2e78ad4434558fe4d139598e086315d714a?s=96&d=mm&r=pg","caption":"Benjamin Close"},"sameAs":["http:\/\/www.clearchain.com"]}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":4,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":141,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions\/141"}],"wp:attachment":[{"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.clearchain.com\/blog\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}