Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unknown operation system build #7398

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Allow unknown operation system build
There are various operating systems in the world, and there are even
more if considering the embedded world.

Trying to detect all of them is hardwork and unnecessary.

If the host operating system is uncaught, the configure succeeds with
the following incomplete output:

	./configure
	(...)
	configure: Detected operating system type:
	configure: Build with  config
	---------------------^^

This enables the operating system "unknown" to remove the error raised
and to allow setting a system that is the short list.

It allows the use for options --with-os=unknown or --with-os=arch that
are a often more representative if the operating system is not in the
short list.

It turns:

	./configure --with-os=unknown
	(...)
	configure: error: Illegal value -unknown- for option --with-os

Into:

	./configure --with-os=unknown
	configure: Detected operating system type: unknown
	configure: Build with unknown config

Also, it avoids the assumption the target operating system is the same
as host if cross-compiling, and leads to errors.

For example, the commit e6ae55d passes
the downstream debian option --install-layout=deb to setup.py and raises
an error if targetting a non-debian world (such as openembedded).

Fixes:

	error: option --install-layout not recognized

Signed-off-by: Gaël PORTAY <[email protected]>
gportay committed Jun 3, 2024
commit 56b320051a10b70a3df6baf3eb9ec30087646aa8
14 changes: 4 additions & 10 deletions src/external/platform.m4
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
AC_ARG_WITH([os],
[AC_HELP_STRING([--with-os=OS_TYPE], [Type of your operation system (fedora|redhat|suse|debian|gentoo)])]
[AC_HELP_STRING([--with-os=OS_TYPE], [Type of your operation system (unknown|fedora|redhat|suse|debian|gentoo)])]
)
osname=""
if test x"$with_os" != x ; then
if test x"$with_os" = xfedora || \
test x"$with_os" = xredhat || \
test x"$with_os" = xsuse || \
test x"$with_os" = xgentoo || \
test x"$with_os" = xdebian ; then
osname=$with_os
else
AC_MSG_ERROR([Illegal value -$with_os- for option --with-os])
fi
osname=$with_os
fi

if test x"$osname" = x ; then
@@ -30,6 +22,8 @@ if test x"$osname" = x ; then
if ([[ "${ID}" = "suse" ]]) || ([[ "${ID_LIKE#*suse*}" != "${ID_LIKE}" ]]); then
osname="suse"
fi
else
osname="unknown"
fi

AC_MSG_NOTICE([Detected operating system type: $osname])