mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 02:35:25 +00:00
2008-06-10 Dan Williams <dcbw@redhat.com>
* configure.in - Add TARGET_* define to config.h to distinguish distros * src/dhcp-manager/nm-dhcp-manager.c - (dhclient_run): use distro-specific path for dhclient config file git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3739 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
fb468f7b62
commit
976326a43d
|
@ -1,3 +1,11 @@
|
|||
2008-06-10 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* configure.in
|
||||
- Add TARGET_* define to config.h to distinguish distros
|
||||
|
||||
* src/dhcp-manager/nm-dhcp-manager.c
|
||||
- (dhclient_run): use distro-specific path for dhclient config file
|
||||
|
||||
2008-06-09 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/dnsmasq-manager/nm-dnsmasq-manager.c
|
||||
|
|
36
configure.in
36
configure.in
|
@ -105,15 +105,51 @@ else
|
|||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
|
||||
if test x"$with_distro" = xredhat; then
|
||||
AC_DEFINE(TARGET_REDHAT, 1, [Define if you have Fedora or RHEL])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
|
||||
if test x"$with_distro" = xsuse; then
|
||||
AC_DEFINE(TARGET_SUSE, 1, [Define if you have OpenSUSE or SLES])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
|
||||
if test x"$with_distro" = xgentoo; then
|
||||
AC_DEFINE(TARGET_GENTOO, 1, [Define if you have Gentoo])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
|
||||
if test x"$with_distro" = xdebian; then
|
||||
AC_DEFINE(TARGET_DEBIAN, 1, [Define if you have Debian])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
|
||||
if test x"$with_distro" = xslackware; then
|
||||
AC_DEFINE(TARGET_SLACKWARE, 1, [Define if you have Slackware])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
|
||||
if test x"$with_distro" = xarch; then
|
||||
AC_DEFINE(TARGET_ARCH, 1, [Define if you have Arch])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_PALDO, test x"$with_distro" = xpaldo)
|
||||
if test x"$with_distro" = xpaldo; then
|
||||
AC_DEFINE(TARGET_PALDO, 1, [Define if you have Paldo])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
|
||||
if test x"$with_distro" = xfrugalware; then
|
||||
AC_DEFINE(TARGET_FRUGALWARE, 1, [Define if you have Frugalware])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
|
||||
if test x"$with_distro" = xmandriva; then
|
||||
AC_DEFINE(TARGET_MANDRIVA, 1, [Define if you have Mandriva])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([Linux Wireless Extensions >= 18])
|
||||
AC_TRY_COMPILE([#ifndef __user
|
||||
|
|
|
@ -55,6 +55,15 @@
|
|||
|
||||
#define NM_DHCP_TIMEOUT 45 /* DHCP timeout, in seconds */
|
||||
|
||||
#if defined(TARGET_SUSE)
|
||||
#define DHCLIENT_CONF_PATH SYSCONFDIR "/dhclient.conf"
|
||||
#elif defined(TARGET_DEBIAN)
|
||||
#define DHCLIENT_CONF_PATH SYSCONFDIR "/dhcp3/dhclient.conf"
|
||||
#else
|
||||
#define DHCLIENT_CONF_PATH_FORMAT SYSCONFDIR "/dhclient-%s.conf"
|
||||
#endif
|
||||
|
||||
|
||||
static const char *dhclient_binary_paths[] =
|
||||
{
|
||||
"/sbin/dhclient",
|
||||
|
@ -636,7 +645,11 @@ dhclient_run (NMDHCPDevice *device)
|
|||
goto out;
|
||||
}
|
||||
|
||||
conffile = g_strdup_printf (SYSCONFDIR "/dhclient-%s.conf", device->iface);
|
||||
#ifdef DHCLIENT_CONF_PATH_FORMAT
|
||||
conffile = g_strdup_printf (DHCLIENT_CONF_PATH_FORMAT, device->iface);
|
||||
#else
|
||||
conffile = g_strdup (DHCLIENT_CONF_PATH);
|
||||
#endif
|
||||
if (!conffile) {
|
||||
nm_warning ("%s: not enough memory for dhclient options.", device->iface);
|
||||
goto out;
|
||||
|
|
Loading…
Reference in a new issue