#include <CoreFoundation/CoreFoundation.h>
#endif
+#ifdef __sun__
+#include <sys/dkio.h>
+#endif
+
static BlockDriverState *bdrv_first;
static BlockDriver *first_drv;
}
}
-
/**************************************************************/
/* RAW block driver */
#ifdef _BSD
struct stat sb;
#endif
+#ifdef __sun__
+ struct dk_minfo minfo;
+ int rv;
+#endif
fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
if (fd < 0) {
size = lseek(fd, 0LL, SEEK_END);
#endif
} else
+#endif
+#ifdef __sun__
+ /*
+ * use the DKIOCGMEDIAINFO ioctl to read the size.
+ */
+ rv = ioctl ( fd, DKIOCGMEDIAINFO, &minfo );
+ if ( rv != -1 ) {
+ size = minfo.dki_lbsize * minfo.dki_capacity;
+ } else /* there are reports that lseek on some devices
+ fails, but irc discussion said that contingency
+ on contingency was overkill */
#endif
{
size = lseek(fd, 0, SEEK_END);
bsd="yes"
darwin="yes"
;;
+SunOS)
+solaris="yes"
+;;
*)
oss="yes"
linux="yes"
fi
fi
+if [ "$solaris" = "yes" ] ; then
+ make="gmake"
+ install="ginstall"
+ solarisrev=`uname -r | cut -f2 -d.`
+ if test $solarisrev -lt 10 ; then
+ presolaris10="yes"
+ fi
+fi
+
# find source path
source_path=`dirname "$0"`
if [ -z "$source_path" ]; then
fi
fi
+#
+# Solaris specific configure tool chain decisions
+#
+if test "$solaris" = "yes" ; then
+ #
+ # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
+ # override the check with --disable-gcc-check
+ #
+ if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
+ solgcc=`which $cc`
+ if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
+ echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
+ echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
+ echo "or get the latest patch from SunSolve for gcc"
+ exit 1
+ fi
+ fi
+ solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
+ if test -z "$solinst" ; then
+ echo "Solaris install program not found. Use --install=/usr/ucb/install or"
+ echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
+ echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
+ exit 1
+ fi
+ if test "$solinst" = "/usr/sbin/install" ; then
+ echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
+ echo "try ginstall from the GNU fileutils available from www.blastwave.org"
+ echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
+ exit 1
+ fi
+ soltexi2html=`which texi2html 2> /dev/null | /usr/bin/grep -v "no texi2html in"`
+ if test -z "$soltexi2html" ; then
+ echo "Error: No path includes texi2html."
+ if test -f /usr/sfw/bin/texi2html ; then
+ echo "Add /usr/sfw/bin to your path and rerun configure"
+ else
+ echo "Add the directory holding the texi2html to your path and rerun configure"
+ fi
+ exit 1
+ fi
+ sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
+ if test -z "$sol_ar" ; then
+ echo "Error: No path includes ar"
+ if test -f /usr/ccs/bin/ar ; then
+ echo "Add /usr/ccs/bin to your path and rerun configure"
+ fi
+ exit 1
+ fi
+fi
+
+
if test -z "$target_list" ; then
# these targets are portable
if [ "$softmmu" = "yes" ] ; then
echo "CONFIG_DARWIN=yes" >> $config_mak
echo "#define CONFIG_DARWIN 1" >> $config_h
fi
+if test "$solaris" = "yes" ; then
+ echo "CONFIG_SOLARIS=yes" >> $config_mak
+ if test "$presolaris10" = "yes" ; then
+ echo "#define _PRESOLARIS10 1" >> $config_h
+ fi
+fi
if test "$gdbstub" = "yes" ; then
echo "CONFIG_GDBSTUB=yes" >> $config_mak
echo "#define CONFIG_GDBSTUB 1" >> $config_h
mkdir -p $target_dir/slirp
fi
-ln -sf $source_path/Makefile.target $target_dir/Makefile
+#
+# don't use ln -sf as not all "ln -sf" over write the file/link
+#
+rm -f $target_dir/Makefile
+ln -s $source_path/Makefile.target $target_dir/Makefile
+
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "/* Automatically generated by configure - do not modify */" > $config_h
for dir in $DIRS ; do
mkdir -p $dir
done
+ # remove the link and recreate it, as not all "ln -sf" overwrite the link
for f in $FILES ; do
- ln -sf $source_path/$f $f
+ rm -f $f
+ ln -s $source_path/$f $f
done
fi
#if !defined(__DYNGEN_EXEC_H__)
#define __DYNGEN_EXEC_H__
+/* prevent Solaris from trying to typedef FILE in gcc's
+ include/floatingpoint.h which will conflict with the
+ definition down below */
+#ifdef __sun__
+#define _FILEDEFED
+#endif
+
/* NOTE: standard headers should be used with special care at this
point because host CPU registers are used as global variables. Some
host headers do not allow that. */
typedef unsigned long long uint64_t;
#endif
+/* if Solaris/__sun__, don't typedef int8_t, as it will be typedef'd
+ prior to this and will cause an error in compliation, conflicting
+ with /usr/include/sys/int_types.h, line 75 */
+#ifndef __sun__
typedef signed char int8_t;
+#endif
typedef signed short int16_t;
typedef signed int int32_t;
#if defined (__x86_64__) || defined(__ia64)
#ifdef __sparc__
#define EXIT_TB() asm volatile ("jmpl %i0 + 8, %g0\n" \
"nop")
+#define GOTO_LABEL_PARAM(n) asm volatile ( \
+ "set " ASM_NAME(__op_gen_label) #n ", %g1; jmp %g1; nop")
#endif
#ifdef __arm__
#define EXIT_TB() asm volatile ("b exec_loop")