{"action":"created","issue":{"url":"https://api.github.com/repos/processone/xml/issues/11","labels_url":"https://api.github.com/repos/processone/xml/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/processone/xml/issues/11/comments","events_url":"https://api.github.com/repos/processone/xml/issues/11/events","html_url":"https://github.com/processone/xml/pull/11","id":105145542,"number":11,"title":"Add OS-aware CFLAGS and LDFLAGS to rebar script","user":{"login":"hamidreza-s","id":1263067,"avatar_url":"https://avatars.githubusercontent.com/u/1263067?v=3","gravatar_id":"","url":"https://api.github.com/users/hamidreza-s","html_url":"https://github.com/hamidreza-s","followers_url":"https://api.github.com/users/hamidreza-s/followers","following_url":"https://api.github.com/users/hamidreza-s/following{/other_user}","gists_url":"https://api.github.com/users/hamidreza-s/gists{/gist_id}","starred_url":"https://api.github.com/users/hamidreza-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamidreza-s/subscriptions","organizations_url":"https://api.github.com/users/hamidreza-s/orgs","repos_url":"https://api.github.com/users/hamidreza-s/repos","events_url":"https://api.github.com/users/hamidreza-s/events{/privacy}","received_events_url":"https://api.github.com/users/hamidreza-s/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-07T04:54:13Z","updated_at":"2015-09-07T07:24:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/processone/xml/pulls/11","html_url":"https://github.com/processone/xml/pull/11","diff_url":"https://github.com/processone/xml/pull/11.diff","patch_url":"https://github.com/processone/xml/pull/11.patch"},"body":"I've added a simple case expression to rebar.config.script to find the OS type and add essential CFLAGS and LDFLAGS to compiler for building. \r\nFor example it can solve the problem of building in FreeBSD, because of the different locations of C's **include** and **lib** directory compared to Linux's paths.\r\n\r\nAlso this is the error which I encountered before the patch:\r\n```sh\r\nhamidreza@freebsd: xml % ./configure \r\nchecking for gcc... no\r\nchecking for cc... cc\r\nchecking whether the C compiler works... yes\r\nchecking for C compiler default output file name... a.out\r\nchecking for suffix of executables... \r\nchecking whether we are cross compiling... no\r\nchecking for suffix of object files... o\r\nchecking whether we are using the GNU C compiler... yes\r\nchecking whether cc accepts -g... yes\r\nchecking for cc option to accept ISO C89... none needed\r\nchecking whether make sets $(MAKE)... yes\r\nchecking for an ANSI C-conforming const... yes\r\nchecking how to run the C preprocessor... cc -E\r\nchecking for grep that handles long lines and -e... /usr/bin/grep\r\nchecking for egrep... /usr/bin/grep -E\r\nchecking for ANSI C header files... yes\r\nchecking for sys/types.h... yes\r\nchecking for sys/stat.h... yes\r\nchecking for stdlib.h... yes\r\nchecking for string.h... yes\r\nchecking for memory.h... yes\r\nchecking for strings.h... yes\r\nchecking for inttypes.h... yes\r\nchecking for stdint.h... yes\r\nchecking for unistd.h... yes\r\nchecking for stdlib.h... (cached) yes\r\nchecking for GNU libc compatible malloc... yes\r\nchecking for ANSI C header files... (cached) yes\r\nchecking for erl... /usr/local/bin/erl\r\nchecking for erlc... /usr/local/bin/erlc\r\nchecking for XML_ParserCreate in -lexpat... no\r\nchecking expat.h usability... no\r\nchecking expat.h presence... no\r\nchecking for expat.h... no\r\nconfigure: error: Expat library was not found\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/processone/xml/issues/comments/138214289","html_url":"https://github.com/processone/xml/pull/11#issuecomment-138214289","issue_url":"https://api.github.com/repos/processone/xml/issues/11","id":138214289,"user":{"login":"zinid","id":1095902,"avatar_url":"https://avatars.githubusercontent.com/u/1095902?v=3","gravatar_id":"","url":"https://api.github.com/users/zinid","html_url":"https://github.com/zinid","followers_url":"https://api.github.com/users/zinid/followers","following_url":"https://api.github.com/users/zinid/following{/other_user}","gists_url":"https://api.github.com/users/zinid/gists{/gist_id}","starred_url":"https://api.github.com/users/zinid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zinid/subscriptions","organizations_url":"https://api.github.com/users/zinid/orgs","repos_url":"https://api.github.com/users/zinid/repos","events_url":"https://api.github.com/users/zinid/events{/privacy}","received_events_url":"https://api.github.com/users/zinid/received_events","type":"User","site_admin":false},"created_at":"2015-09-07T07:24:17Z","updated_at":"2015-09-07T07:24:17Z","body":"It is better to detect expat via ax_lib_expat: http://www.gnu.org/software/autoconf-archive/ax_lib_expat.html\r\nIt will detect location and substitute flags automatically (via `AC_SUBST()`)."}}