From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L4upX-0004Jr-AM for qemu-devel@nongnu.org; Tue, 25 Nov 2008 05:07:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L4upV-0004IU-7g for qemu-devel@nongnu.org; Tue, 25 Nov 2008 05:07:38 -0500 Received: from [199.232.76.173] (port=49495 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4upU-0004IJ-SG for qemu-devel@nongnu.org; Tue, 25 Nov 2008 05:07:37 -0500 Received: from relay01.mx.bawue.net ([193.7.176.67]:34890) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L4upU-0002Ud-HY for qemu-devel@nongnu.org; Tue, 25 Nov 2008 05:07:36 -0500 Date: Tue, 25 Nov 2008 11:07:32 +0100 From: Thiemo Seufer Subject: Re: [Qemu-devel] [5780] Native BSD host USB support (Juergen Lock, Lonnie Mendez) Message-ID: <20081125100732.GA15592@networkno.de> References: <492B10B1.1050409@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <492B10B1.1050409@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: [snip] >> +usb="linux" >> if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then >> kqemu="yes" >> audio_possible_drivers="$audio_possible_drivers fmod" >> @@ -231,6 +232,7 @@ >> if [ "$bsd" = "yes" ] ; then >> if [ "$darwin" != "yes" ] ; then >> make="gmake" >> + usb="bsd" >> fi >> bsd_user="yes" >> fi >> > > This whole set of checks is horribly broken because it relies on uname > -s. Such a thing doesn't exist on Windows but more importantly, when > cross compiling, uname is meaningless. > > What we really should do, is compile a small test program that checks for: > > #ifndef __linux__ > #error Not linux > #endif > > And then try compiling that to see if we're on Linux or not. The same > with FreeBSD et al. It shouldn't try to compile, for the sake of cross portability. Rather something like gcc -E -dM -xc /dev/null |grep __linux__ This checks if the compiler in use is a Linux compiler. Thiemo