After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663602 - Generic distro option in configure script
Generic distro option in configure script
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Pavel Simerda
NetworkManager maintainer(s)
Depends on:
Blocks: nm-0.9.8
 
 
Reported: 2011-11-08 08:00 UTC by Gou LF
Modified: 2013-03-14 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gou LF 2011-11-08 08:00:24 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.
Comment 1 André Klapper 2011-11-08 10:54:37 UTC
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.
Comment 2 Gou LF 2011-11-08 11:50:40 UTC
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.
Comment 3 André Klapper 2011-11-08 11:58:21 UTC
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.
Comment 4 Gou LF 2011-11-08 12:09:33 UTC
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.
Comment 5 André Klapper 2011-11-08 14:38:56 UTC
(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...?
Comment 6 Gou LF 2011-11-08 18:52:45 UTC
(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".
Comment 7 Pavel Simerda 2012-07-26 12:26:44 UTC
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.
Comment 8 Pavel Simerda 2012-08-16 20:39:46 UTC
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.
Comment 9 Pavel Simerda 2012-09-01 22:49:40 UTC
Patches are now available in 'pavlix/platform' branch.
Comment 10 Pavel Simerda 2012-09-03 00:46:49 UTC
Patches are now available in 'pavlix/next' branch together with a bunch of other stuff.
Comment 11 Pavel Simerda 2012-09-25 06:50:58 UTC
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.
Comment 12 Pavel Simerda 2012-10-31 17:49:30 UTC
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.
Comment 13 Pavel Simerda 2013-03-14 13:39:26 UTC
Available in 0.9.8.0, if anyone cares.