Am 10.11.2012 22:47, schrieb Louis Lagendijk: > On Wed, 2012-11-07 at 06:50 +0100, Wilhelm wrote: > >>> >>> A compilation with -Werror catched this for me. I have -Werror as a >>> compile flag, but it can be disabled (configure --disable-Werror). >> >> Thanks very much! (Did not look very much at that code, because it isn't >> mine in the first place). >> >> But: here the compilation succeeds without warnings and therefore >> -Werror did not abort the compilation (using gcc) ... >> > Then it was most probably the default set of compilation flags that > gcc-4.7 uses. It is handy to have the compiler check for user errors, > but it can be annying when it complains about unused function arguments > (I see some when I compile with -DNDEBUG) >>> >>> Another more interesting issue: >>> How do we pass options to the code? I have 2 options: >>> 1) Use -D / -U options on the command-line for cc. >>> 2) Let configure generate a config.h that holds the relevant options >>> (like CFG_DIR) and include that from a common header file or directly >>> from the c-files. >>> >>> Which option do you prefer? >> >> Option 1: using -D/-U for the compiler. > > Ok, I have now a working setup (although I have not been able to test > the generated binaries yet). I have attached the current results. It > compiles cleanly on my Fedora 17. > I have included the configure.ac and relevant Makefile.am files. I > recommend putting only these in svn. I also included patch that removes > the need for the OS-defines. Most OS-dependencies are simple header > files checks that I added in configure.ac. That generates > -DHAVE_LINUX_LIMITS_H style defines. I did the same for utmp.h/utmpx.h. > > The dependencies in common.h can be replaced by checks on __FreeBSD__ > etc, as these defines are set by gcc. > > A very nice featue of automake is > make dist > that generates a complete distribtion tar file for you. It takes the > version number from configure.ac > > After adding the files to your tree run > autoreconf -if > ./configure > Check ./configure --help > for the available options. > I still want to add an option to set the default group to be used in > 99-sanede.rules and in the sample configuration file (that reminds me > that I still need to check that config files do not get overwritten). > That option can wait a bit. I also will add systemd configuration files > when I have time again
Thank you very much for your excellent work! I just added the patches and the autotools-stuff to scanbd-trunk. The old makefiles are still there as Makefile.simple. If I try to configure on non-Linux-Plattforms, e.g. FreeBSD (8.2) or NetBSD (5.1) I have the problem, that there is non pkg-config for sane-backends ... Do you know how to circumvent this? Is it possible to use other checks than pkg-config? > > I am sending you what I have now, as I will be traveling most of the > coming 2 weeks. > > Any feedback you can give would be much appreciated. > > Kind regards, Louis > > > > -- Wilhelm -- Wilhelm