Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LdPsA-000188-Pe for qemu-devel@nongnu.org; Sat, 28 Feb 2009 09:08:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LdPsA-00017q-CX for qemu-devel@nongnu.org; Sat, 28 Feb 2009 09:08:58 -0500 Received: from [199.232.76.173] (port=48428 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdPsA-00017l-4f for qemu-devel@nongnu.org; Sat, 28 Feb 2009 09:08:58 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:56144) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LdPs9-000266-Fl for qemu-devel@nongnu.org; Sat, 28 Feb 2009 09:08:57 -0500 Message-Id: <3BCD83D2-D2DC-40E2-9D0D-68A7B9100DDC@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= Content-Type: multipart/mixed; boundary=Apple-Mail-57--175126080 Mime-Version: 1.0 (Apple Message framework v930.3) Date: Sat, 28 Feb 2009 15:08:31 +0100 Sender: andreas.faerber@web.de Subject: [Qemu-devel] [PATCH] [RFC] Haiku host support and general configure issues Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: HaikuPorts developers discussion list , =?ISO-8859-1?Q?Fran=E7ois_Revol?= --Apple-Mail-57--175126080 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hello, Haiku recently got an experimental GCC 4.3, so I was curious how far QEMU would get there now. This uncovered some generic issues with our configure tests that I think should be tackled before the release. We have undocumented --extra-cflags= and --extra-ldflags= options that don't work as expected. They are ignored by all the configure tests, so it seems there is no direct equivalent to autoconf's CPPFLAGS to pass in additional header include paths. The OS_CFLAGS come closest, but they are ignored for some of the tests, too. Any preferences how to fix this? On Haiku, zlib and ncurses headers are not in the default include path, so the current situation does not allow to configure QEMU at all. The attached patch adds a Haiku section to configure to hardcode the path in OS_CFLAGS and adds ${OS_CFLAGS} where necessary for Haiku. It further sets OS_LDFLAGS to reference libnetwork.so, which contains the socket functions. The optional curses support relies on -lcurses but it's called libncurses.a on Haiku, so add a check for -lncurses if -lcurses fails. It is then detected. Unresolved issues include that AIO is detected, and as a consequence AIOLIBS is set to -lpthread but that is not available on Haiku. The code still does not link qemu-img due to an unresolved symbol _IO in nbd code. Not sure if that's a missing check in QEMU or an issue in Haiku? There doesn't appear to be a switch to disable NBD altogether, so this seems like a blocker for now. BTW, is it intentional that --disable-gfx-checks is not documented as part of --help, only when the checks do fail? Andreas --Apple-Mail-57--175126080 Content-Disposition: attachment; filename=qemu-haiku-01.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="qemu-haiku-01.diff" Content-Transfer-Encoding: 7bit Index: configure =================================================================== --- configure (revision 6645) +++ configure (working copy) @@ -297,6 +297,10 @@ aix="yes" make="gmake" ;; +Haiku) +OS_CFLAGS="-I/boot/develop/headers/3rdparty" +OS_LDFLAGS="-lnetwork" +;; *) audio_drv_list="oss" audio_possible_drivers="oss alsa sdl esd pa" @@ -933,8 +937,12 @@ #include int main(void) { return curses_version(); } EOF - if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then + if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lcurses > /dev/null 2> /dev/null ; then curses=yes + else + if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lncurses > /dev/null 2> /dev/null ; then + curses=yes + fi fi fi # test "$curses" --Apple-Mail-57--175126080 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit --- Haiku support for configure Add zlib include path to OS_CFLAGS and link against libnetwork. Make the curses check respect OS_CFLAGS and check for -lncurses as well. Signed-off-by: Andreas Faerber Index: configure =================================================================== --- configure (revision 6645) +++ configure (working copy) @@ -297,6 +297,10 @@ aix="yes" make="gmake" ;; +Haiku) +OS_CFLAGS="-I/boot/develop/headers/3rdparty" +OS_LDFLAGS="-lnetwork" +;; *) audio_drv_list="oss" audio_possible_drivers="oss alsa sdl esd pa" @@ -933,8 +937,12 @@ #include int main(void) { return curses_version(); } EOF - if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/ null ; then + if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lcurses > /dev/ null 2> /dev/null ; then curses=yes + else + if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lncurses > /dev/ null 2> /dev/null ; then + curses=yes + fi fi fi # test "$curses" --Apple-Mail-57--175126080--