diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2012-02-13 01:46:44 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2012-02-13 01:51:51 +0100 |
commit | 3ce4fad8f548db9edb19869ea540e3192d2123f4 (patch) | |
tree | 70881f386f8cd38fc7dbc57bd9464327813ae7ff /configure.ac | |
parent | f9941a4b94f6ee3c4f5906c32821f82aa3c6e2b1 (diff) |
always use /etc/os-release and ignore all distro-specific files
The text mode welcome message will only show the distro name stored
in /etc/os-release and no longer read any distro-specific files. If
/etc/os-release does not exist, 'Linux' will be printed.
When the source tree is is ./configure'd, only /etc-os-release is read
to guess the distro to build for. If /etc/os-release does not exist,
--with-distro= needs to be specified.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index bef2418ed7..d95f22dfcc 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,7 @@ AC_SUBST(GETTEXT_PACKAGE) AC_PROG_MKDIR_P AC_PROG_LN_S AC_PROG_SED +AC_PROG_GREP AC_PROG_AWK AC_PROG_CC @@ -394,29 +395,15 @@ AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x) AC_PATH_PROG([M4], [m4]) -AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware, altlinux or other])) +AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware, altlinuxi, mandriva, meego, mageia, angstrom or other])) if test "z$with_distro" = "z"; then if test "$cross_compiling" = yes; then AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)]) else - test -f "/etc/redhat-release" && with_distro="fedora" - test -f "/etc/SuSE-release" && with_distro="suse" - test -f "/etc/debian_version" && with_distro="debian" - test -f "/etc/arch-release" && with_distro="arch" - test -f "/etc/gentoo-release" && with_distro="gentoo" - test -f "/etc/slackware-version" && with_distro="slackware" - test -f "/etc/frugalware-release" && with_distro="frugalware" - test -f "/etc/altlinux-release" && with_distro="altlinux" - test -f "/etc/mandriva-release" && with_distro="mandriva" - test -f "/etc/meego-release" && with_distro="meego" - test -f "/etc/angstrom-version" && with_distro="angstrom" - test -f "/etc/mageia-release" && with_distro="mageia" - if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then - with_distro="ubuntu" - fi + with_distro=$($GREP '^ID=' /etc/os-release | $SED 's/ID=//'); fi if test "z$with_distro" = "z"; then - with_distro=`uname -s` + with_distro=other fi fi with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' ` @@ -436,7 +423,7 @@ case $with_distro in M4_DEFINES=-DTARGET_FEDORA=1 have_plymouth=yes ;; - suse) + opensuse|suse) SYSTEM_SYSVRCND_PATH=/etc/init.d AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE]) M4_DEFINES=-DTARGET_SUSE=1 |