<div dir="ltr">Hello,<div><br></div><div>Thanks for the new release! It merged most of the patches I kept in order to compile for OpenWRT. However, I still faced some new and old problems:</div><div><br></div><div>a) backend/pieusb_buffer.c (most of the problems)</div><div><br></div><div>a.1) it uses mkostemp without checking its presence. uclibc might not provide it. If mkstemp is enough, it might be better as it is POSIX and not a glibc extension. I simply replaced it with mkstemp, which might not be correct.</div><div><a href="https://raw.githubusercontent.com/luizluca/openwrt-packages/hplip/utils/sane-backends/patches/031-fix_uclibc.patch">https://raw.githubusercontent.com/luizluca/openwrt-packages/hplip/utils/sane-backends/patches/031-fix_uclibc.patch</a><br></div><div><br></div><div>a.2) le16toh is always redefined, which gives me a "redefined warning". The problem is that the replacement implementation uses __bswap_16, which is not present in musl. As le16toh might be already fine, check for it before reimplementing it:</div><div><a href="https://raw.githubusercontent.com/luizluca/openwrt-packages/hplip/utils/sane-backends/patches/020-fix_pieusb.patch">https://raw.githubusercontent.com/luizluca/openwrt-packages/hplip/utils/sane-backends/patches/020-fix_pieusb.patch</a><br></div><div><br></div><div>a.3) if mmap is not found, it generates a compile error ("#error mmap(2) not available, aborting"). The problem is that mmap is checked with AC_FUNC_MMAP and it depends on a runtime check (ac_fn_c_try_run). As I'm crosscompiling, no runtime check will ever work because all generated binaries cannot run in my host system. If "<font color="#000000"><span style="line-height:normal">AC_CHECK_FUNCS(mmap)" is not good enough as a replacement, configure would need to check for other hints (SO, arch) and heuristically define if mmap is avaiable. Anyway, if ever mmap check fails, the expected result would be to disable pieusb backend and never generate a compiler error.</span></font></div><div>I have no patch for this as I <span style="color:rgb(51,51,51);font-size:13px;line-height:16px;background-color:rgb(240,240,240)">cheated the test defining </span>ac_cv_func_mmap_fixed_mapped=yes</div><div><br></div><div>b) missing includes for sys/types.h (uchar and ulong)<br></div><div><br></div><div>This is an old problem still not fixed. The list of files that need to include sys/types.h added the new backend epsonds</div><div><br></div><div><div>- include/sane/sanei_udp.h</div><div>- backend/kvs20xx_cmd.h</div><div>- backend/kvs40xx.h</div><div>- backend/hp5400.c</div><div>- backend/hp5590.c</div><div>- backend/epsonds-io.c (new)</div></div><div><br></div><div>Even these files including sane/config.h, sane/config.h only includes sys/types.h when replacing some missing functions (inet_ntop, strndup).</div><div>Each problematic file might need something like:</div><div><br></div><div><div>#if defined(HAVE_SYS_TYPES_H)</div><div># include <sys/types.h></div><div>#endif</div></div><div><br></div><div>which is already used in some files (backend/umax_pp_low.c backend/umax_pp.c backend/genesys_low.h backend/mustek_pp.c backend/mustek_pp.h backend/pixma_bjnp.c)</div><div>or it could be added to sane/config.h (bruteforce solution).<br></div><div><br></div><div>I do have a patch but before upstreaming it, we need to define where to put the include.</div><div><br></div><div>Regards,<br></div><div><br></div></div><div dir="ltr">-- <br></div><p dir="ltr">Luiz Angelo Daros de Luca</p>