{"action":"created","issue":{"url":"https://api.github.com/repos/vsergeev/lua-periphery/issues/9","repository_url":"https://api.github.com/repos/vsergeev/lua-periphery","labels_url":"https://api.github.com/repos/vsergeev/lua-periphery/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/vsergeev/lua-periphery/issues/9/comments","events_url":"https://api.github.com/repos/vsergeev/lua-periphery/issues/9/events","html_url":"https://github.com/vsergeev/lua-periphery/pull/9","id":141320051,"number":9,"title":"Fix OpenWrt cross-compilation issues.","user":{"login":"gw0","id":803603,"avatar_url":"https://avatars.githubusercontent.com/u/803603?v=3","gravatar_id":"","url":"https://api.github.com/users/gw0","html_url":"https://github.com/gw0","followers_url":"https://api.github.com/users/gw0/followers","following_url":"https://api.github.com/users/gw0/following{/other_user}","gists_url":"https://api.github.com/users/gw0/gists{/gist_id}","starred_url":"https://api.github.com/users/gw0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gw0/subscriptions","organizations_url":"https://api.github.com/users/gw0/orgs","repos_url":"https://api.github.com/users/gw0/repos","events_url":"https://api.github.com/users/gw0/events{/privacy}","received_events_url":"https://api.github.com/users/gw0/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"vsergeev","id":524033,"avatar_url":"https://avatars.githubusercontent.com/u/524033?v=3","gravatar_id":"","url":"https://api.github.com/users/vsergeev","html_url":"https://github.com/vsergeev","followers_url":"https://api.github.com/users/vsergeev/followers","following_url":"https://api.github.com/users/vsergeev/following{/other_user}","gists_url":"https://api.github.com/users/vsergeev/gists{/gist_id}","starred_url":"https://api.github.com/users/vsergeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsergeev/subscriptions","organizations_url":"https://api.github.com/users/vsergeev/orgs","repos_url":"https://api.github.com/users/vsergeev/repos","events_url":"https://api.github.com/users/vsergeev/events{/privacy}","received_events_url":"https://api.github.com/users/vsergeev/received_events","type":"User","site_admin":false},"assignees":[{"login":"vsergeev","id":524033,"avatar_url":"https://avatars.githubusercontent.com/u/524033?v=3","gravatar_id":"","url":"https://api.github.com/users/vsergeev","html_url":"https://github.com/vsergeev","followers_url":"https://api.github.com/users/vsergeev/followers","following_url":"https://api.github.com/users/vsergeev/following{/other_user}","gists_url":"https://api.github.com/users/vsergeev/gists{/gist_id}","starred_url":"https://api.github.com/users/vsergeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsergeev/subscriptions","organizations_url":"https://api.github.com/users/vsergeev/orgs","repos_url":"https://api.github.com/users/vsergeev/repos","events_url":"https://api.github.com/users/vsergeev/events{/privacy}","received_events_url":"https://api.github.com/users/vsergeev/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-03-16T16:04:45Z","updated_at":"2016-09-29T11:48:42Z","closed_at":"2016-09-29T11:46:50Z","pull_request":{"url":"https://api.github.com/repos/vsergeev/lua-periphery/pulls/9","html_url":"https://github.com/vsergeev/lua-periphery/pull/9","diff_url":"https://github.com/vsergeev/lua-periphery/pull/9.diff","patch_url":"https://github.com/vsergeev/lua-periphery/pull/9.patch"},"body":"Attempts for cross-compiling *lib-periphery* with OpenWRT toolchain failed, because of invalid includes in `CFLAGS`:\r\n\r\n```\r\n$ export LUA_INCDIR=$TARGET_DIR/usr/include\r\n$ git clone --recursive https://github.com/vsergeev/lua-periphery.git\r\n$ cd lua-periphery/\r\n$ make clean all\r\ncd c-periphery && make clean\r\nmake[1]: Entering directory '/home/foo/lua-periphery/c-periphery'\r\nrm -rf periphery.a obj tests/test_serial tests/test_i2c tests/test_mmio tests/test_spi tests/test_gpio\r\nmake[1]: Leaving directory '/home/foo/lua-periphery/c-periphery'\r\nrm -rf periphery.so\r\ncd c-periphery; make\r\nmake[1]: Entering directory '/home/foo/lua-periphery/c-periphery'\r\nmkdir obj\r\nmipsel-openwrt-linux-musl-gcc  -std=c99 -pedantic -D_XOPEN_SOURCE=700 -Wall -Wextra -Wno-unused-parameter  -fPIC -I. -I/home/foo/openwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.14//usr/include -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/gpio.c -o obj/gpio.o\r\nmipsel-openwrt-linux-musl-gcc  -std=c99 -pedantic -D_XOPEN_SOURCE=700 -Wall -Wextra -Wno-unused-parameter  -fPIC -I. -I/home/foo/openwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.14//usr/include -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/spi.c -o obj/spi.o\r\nmipsel-openwrt-linux-musl-gcc  -std=c99 -pedantic -D_XOPEN_SOURCE=700 -Wall -Wextra -Wno-unused-parameter  -fPIC -I. -I/home/foo/openwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.14//usr/include -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/i2c.c -o obj/i2c.o\r\nmipsel-openwrt-linux-musl-gcc  -std=c99 -pedantic -D_XOPEN_SOURCE=700 -Wall -Wextra -Wno-unused-parameter  -fPIC -I. -I/home/foo/openwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.14//usr/include -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/mmio.c -o obj/mmio.o\r\nmipsel-openwrt-linux-musl-gcc  -std=c99 -pedantic -D_XOPEN_SOURCE=700 -Wall -Wextra -Wno-unused-parameter  -fPIC -I. -I/home/foo/openwrt/staging_dir/target-mipsel_24kec+dsp_musl-1.1.14//usr/include -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/serial.c -o obj/serial.o\r\nsrc/serial.c: In function 'serial_open_advanced':\r\nsrc/serial.c:182:37: error: 'CRTSCTS' undeclared (first use in this function)\r\n         termios_settings.c_cflag |= CRTSCTS;\r\n                                     ^\r\nsrc/serial.c:182:37: note: each undeclared identifier is reported only once for each function it appears in\r\nsrc/serial.c: In function 'serial_get_rtscts':\r\nsrc/serial.c:378:36: error: 'CRTSCTS' undeclared (first use in this function)\r\n     if (termios_settings.c_cflag & CRTSCTS)\r\n                                    ^\r\nsrc/serial.c: In function 'serial_set_rtscts':\r\nsrc/serial.c:488:34: error: 'CRTSCTS' undeclared (first use in this function)\r\n     termios_settings.c_cflag &= ~CRTSCTS;\r\n                                  ^\r\nsrc/serial.c: In function 'serial_tostring':\r\nsrc/serial.c:536:36: error: 'CRTSCTS' undeclared (first use in this function)\r\n     if (termios_settings.c_cflag & CRTSCTS)\r\n                                    ^\r\nMakefile:45: recipe for target 'obj/serial.o' failed\r\nmake[1]: *** [obj/serial.o] Error 1\r\nmake[1]: Leaving directory '/home/foo/lua-periphery/c-periphery'\r\nMakefile:44: recipe for target 'c-periphery/periphery.a' failed\r\nmake: *** [c-periphery/periphery.a] Error 2\r\n```\r\n\r\nBut manually compiling *c-periphery* works without errors:\r\n\r\n```bash\r\n$ cd c-periphery/\r\n$ make clean all\r\nrm -rf periphery.a obj tests/test_serial tests/test_i2c tests/test_mmio tests/test_spi tests/test_gpio\r\nmkdir obj\r\nmipsel-openwrt-linux-musl-gcc  -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/gpio.c -o obj/gpio.o\r\nmipsel-openwrt-linux-musl-gcc  -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/spi.c -o obj/spi.o\r\nmipsel-openwrt-linux-musl-gcc  -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/i2c.c -o obj/i2c.o\r\nmipsel-openwrt-linux-musl-gcc  -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/mmio.c -o obj/mmio.o\r\nmipsel-openwrt-linux-musl-gcc  -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-pointer-to-int-cast  -fPIC  -c src/serial.c -o obj/serial.o\r\nar rcs periphery.a obj/gpio.o obj/spi.o obj/i2c.o obj/mmio.o obj/serial.o\r\n```"},"comment":{"url":"https://api.github.com/repos/vsergeev/lua-periphery/issues/comments/250444348","html_url":"https://github.com/vsergeev/lua-periphery/pull/9#issuecomment-250444348","issue_url":"https://api.github.com/repos/vsergeev/lua-periphery/issues/9","id":250444348,"user":{"login":"vsergeev","id":524033,"avatar_url":"https://avatars.githubusercontent.com/u/524033?v=3","gravatar_id":"","url":"https://api.github.com/users/vsergeev","html_url":"https://github.com/vsergeev","followers_url":"https://api.github.com/users/vsergeev/followers","following_url":"https://api.github.com/users/vsergeev/following{/other_user}","gists_url":"https://api.github.com/users/vsergeev/gists{/gist_id}","starred_url":"https://api.github.com/users/vsergeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsergeev/subscriptions","organizations_url":"https://api.github.com/users/vsergeev/orgs","repos_url":"https://api.github.com/users/vsergeev/repos","events_url":"https://api.github.com/users/vsergeev/events{/privacy}","received_events_url":"https://api.github.com/users/vsergeev/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T11:48:42Z","updated_at":"2016-09-29T11:48:42Z","body":"Thanks! Cherry-picked in 9c3fe77bf19ec1657ba561862dc5a2211a04d938."}}
{"actor":{"display_login":"vsergeev"}}