On Jun 24, 2013, at 12:24 PM, Peter Maydell wrote: > On 24 June 2013 03:03, Stacey Son <s...@freebsd.org> 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 >> >> # OS specific >> +TARGET_OS="" >> >> case $targetos in >> CYGWIN*) >> @@ -457,6 +458,7 @@ FreeBSD) >> audio_possible_drivers="oss sdl esd pa" >> # needed for kinfo_getvmmap(3) in libutil.h >> LIBS="-lutil $LIBS" >> + TARGET_OS="freebsd" >> ;; >> DragonFly) >> bsd="yes" >> @@ -470,12 +472,14 @@ NetBSD) >> audio_drv_list="oss" >> audio_possible_drivers="oss sdl esd" >> oss_lib="-lossaudio" >> + TARGET_OS="netbsd" >> ;; >> OpenBSD) >> bsd="yes" >> make="${MAKE-gmake}" >> audio_drv_list="sdl" >> audio_possible_drivers="sdl esd" >> + TARGET_OS="openbsd" >> ;; >> Darwin) >> bsd="yes" >> @@ -4267,6 +4271,9 @@ upper() { >> >> target_arch_name="`upper $TARGET_ARCH`" >> echo "TARGET_$target_arch_name=y" >> $config_target_mak >> +if [ "$TARGET_OS" != "" ]; then >> + echo "TARGET_OS=$TARGET_OS" >> $config_target_mak >> +fi >> echo "TARGET_NAME=$target_name" >> $config_target_mak >> echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak >> if [ "$TARGET_ABI_DIR" = "" ]; then > > 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.