thiagoralves / OpenPLC_v2

OpenPLC with the new IEC ST to C compiler
http://www.openplcproject.com
GNU General Public License v3.0
189 stars 108 forks source link

Build system has issues with non-interactive use #7

Open blm768 opened 6 years ago

blm768 commented 6 years ago

I've been looking into using OpenPLC as part of a student project. I was planning to build a Debian package and/or a Docker image for easy deployment, but I've found that the build system isn't very well suited to non-interactive use because it prompts interactively for a number of configuration options. I've made some modifications in my own fork that allow passing the necessary values non-interactively, but I'm curious as to whether you'd be interested in merging those changes into the main project and/or looking into other ways to make the build system more robust and distribution-agnostic.

thiagoralves commented 6 years ago

Your changes seems nice, I don't think it is a problem to incorporate them. The only issue is your last commit, where you removed the lines to install Libmodbus. This will break support for Modbus external devices.

blm768 commented 6 years ago

Yeah, I'll have to figure out how to handle that. The main issue is that to build a typical Debian package, the build scripts generally can't (or at least shouldn't) rely on sudo to install files to the host that's building the package. I'll have to think about how to handle that properly; the easiest way is probably to link libmodbus statically.

st31ny commented 6 years ago

There is actually a Debian package for libmodbus (https://packages.debian.org/stretch/libmodbus-dev), so libmodbus should definitely not be included in the Debian package.

I'd propose using a Makefile with different targets for different build steps, such as make install-dep to install dependencies. That way you could configure your build very flexibly and easily include it in the debian packaging toolchain.