GNOME Bugzilla – Bug 663602
Generic distro option in configure script
Last modified: 2013-03-14 13:39:26 UTC
Why not a Generic distro option in configure script? So that I don't need to modify sources to install it in a non-popular distribution.
Please describe EXACTLY what you have to modify, for which distribution, and why this is needed, plus what your proposal is (what kind of options you want to add). Currently this report is way too generic to be of any use.
Codes like configure.ac, some Makefile.am's, some .c files. Basically duplicate everything there for RedHat or Ubuntu, and customize. For a "generic" distribution. NetworkManager's configure script can not cover all distributions out there. But it's important to build without modifying codes on systems with needed dependencies, not just saying: Linux distribution autodetection failed, you must specify the distribution to target using --with-distro=DISTRO. Systemd also ask for distro information in configure script. But it's smart to provide a --with-distro=other option, and get information needed with some other configure options. I suggest NetworkManager do similarly.
That sounds quite unmaintainable plus a lot of code duplication, or lots of #ifdef areas. You still don't explain what *concrete* problem you try to solve, which made you propose this.
No. That's not quite complex. All you need by this --with-distro option are: where init script goes? is it needed? enable ifcfg-rh or not? is nscd running? how to enable loopback? Just some more configure options. And packagers for other distros would be happy. >> You still don't explain what *concrete* problem you try to solve, which made you propose this. I'm not an end-user. I'm a packager. And NetworkManager won't directly compile on other distros.
(In reply to comment #4) > And NetworkManager won't directly compile on other distros. And your distro is...? And it does not directly compile on your distro because...?
(In reply to comment #5) > (In reply to comment #4) > > And NetworkManager won't directly compile on other distros. > > And your distro is...? My customized distro, named "blahblah", not publicly known... All the necessary dependencies of NetworkManager are met here. I just don't want to name my distro "fedora", "ubuntu"... > And it does not directly compile on your distro because...? Because the configure script just says "Your distribution (blahblah) is not yet supported!" and quits. So the only choice for me is to make some modifications. Just look into the configure code in systemd. It also tries to simplify configuration in popular distros. But when configured in non-popular distros, it can gracefully provide alternatives (by specifying several more options), not just saying "blahblah not supported".
I also believe NetworkManager should build on any linux distribution. What we now have is an ugly hack and we're actually doing the packager's work in NetworkManager. I'm for changing all distro-based checks into feature-based checks if possible. If not, I'd default to --with-distro=none (or --with-distro=generic or whatever) in case a distro is not detected and to build in a more generic way. This will probably be best done in small steps.
Working on this... I'm going to make --with-distro=generic the default and remove as much distro dependencies as I can with reasonable effort. For those who are interested, follow the pavlix/distros branch in Git.
Patches are now available in 'pavlix/platform' branch.
Patches are now available in 'pavlix/next' branch together with a bunch of other stuff.
I changed the solution in 'pavlix/next' from --with-distro=generic to feature-based configuration. commit 71483ca53d8aac12a9217b3d0a3925a51b670bd9 Author: Pavel Šimerda <psimerda@redhat.com> Date: Wed Aug 1 20:01:33 2012 +0200 distro: replace --with-distro with feature-based options (bgo #663602) Distribution-specific builds are now handled by feature and not by distro. This allows you to fine-tune the options to your liking and also allowed us to reduce the number of specific values. The default values of these options are still derived from *-version and *-release files in /etc. The following five distribution-specific features are now available (and default on distributions in parenthesis): --enable-ifcfg-rh (Fedora, RHEL and Mandriva) --enable-ifcfg-suse (SUSE) --enable-ifupdown (Debian and Ubuntu) --enable-ifnet (Gentoo) --with-netconfig (SUSE) Since --with-distro is now removed, there is nothing to prevent generic builds. If you build on an unknown distribution, all of the features above will be disabled by default.
The 'pavlix/distro' branch with the above generic solution has been merged to master. You can now build NetworkManager on any distribution that meets its dependencies and --with-distro has been removed entirely.
Available in 0.9.8.0, if anyone cares.