Skip to content

Commit

Permalink
Allow unknown operation system build
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gportay committed Jun 3, 2024
1 parent 3d310e1 commit 56b3200
Showing 1 changed file with 4 additions and 10 deletions.
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
Expand All @@ -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])
Expand Down

0 comments on commit 56b3200

Please sign in to comment.