Received: from eggs.gnu.org ([2001:4830:134:3::10]:60967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrDAj-0002RH-Gi for qemu-devel@nongnu.org; Mon, 24 Jun 2013 16:15:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrDAf-0005Yd-KK for qemu-devel@nongnu.org; Mon, 24 Jun 2013 16:15:33 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:34475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrDAf-0005YK-GD for qemu-devel@nongnu.org; Mon, 24 Jun 2013 16:15:29 -0400 Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Stacey Son In-Reply-To: Date: Mon, 24 Jun 2013 15:15:28 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1372039435-41921-1-git-send-email-sson@FreeBSD.org> <1372039435-41921-4-git-send-email-sson@FreeBSD.org> Subject: Re: [Qemu-devel] [PATCH 03/23] bsd-user: additional seperation of OS and architecture dependent code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On Jun 24, 2013, at 12:24 PM, Peter Maydell wrote: > On 24 June 2013 03:03, Stacey Son wrote: >> diff --git a/configure b/configure >> index ad32f87..749eba8 100755 >> --- a/configure >> +++ b/configure >> @@ -432,6 +432,7 @@ if test -z "$ARCH"; then >> fi >>=20 >> # OS specific >> +TARGET_OS=3D"" >>=20 >> case $targetos in >> CYGWIN*) >> @@ -457,6 +458,7 @@ FreeBSD) >> audio_possible_drivers=3D"oss sdl esd pa" >> # needed for kinfo_getvmmap(3) in libutil.h >> LIBS=3D"-lutil $LIBS" >> + TARGET_OS=3D"freebsd" >> ;; >> DragonFly) >> bsd=3D"yes" >> @@ -470,12 +472,14 @@ NetBSD) >> audio_drv_list=3D"oss" >> audio_possible_drivers=3D"oss sdl esd" >> oss_lib=3D"-lossaudio" >> + TARGET_OS=3D"netbsd" >> ;; >> OpenBSD) >> bsd=3D"yes" >> make=3D"${MAKE-gmake}" >> audio_drv_list=3D"sdl" >> audio_possible_drivers=3D"sdl esd" >> + TARGET_OS=3D"openbsd" >> ;; >> Darwin) >> bsd=3D"yes" >> @@ -4267,6 +4271,9 @@ upper() { >>=20 >> target_arch_name=3D"`upper $TARGET_ARCH`" >> echo "TARGET_$target_arch_name=3Dy" >> $config_target_mak >> +if [ "$TARGET_OS" !=3D "" ]; then >> + echo "TARGET_OS=3D$TARGET_OS" >> $config_target_mak >> +fi >> echo "TARGET_NAME=3D$target_name" >> $config_target_mak >> echo "TARGET_BASE_ARCH=3D$TARGET_BASE_ARCH" >> $config_target_mak >> if [ "$TARGET_ABI_DIR" =3D "" ]; then >=20 > This looks kind of fishy. What do you need this for that > you can't do just by checking for relevant preprocessor defines > like __OpenBSD__ directly in the bsd-user code? Note that the OS dependent directories are "freebsd", "netbsd", and = "openbsd". This is used in the Makefiles to use the correct OS = dependent (which eliminates much of the "#if defined(__OpenBSD__)" in = the code files themselves). Regards, -stacey.