summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-09-13 18:37:35 +0000
committerEric Anholt <anholt@freebsd.org>2005-09-13 18:37:35 +0000
commit12fbcfefe672ec226bdbc7597bf2fd2cb0ee1e19 (patch)
tree3556cc76d8607a4a857df92153ac508b2dd75e6a
parent51eb6c83a3b2721703ca50758853bbf9f99fc4d2 (diff)
Add some initial BSD support for the xorg server. Incomplete on NetBSD,
OpenBSD, and non-i386/amd64 FreeBSD for sure. Plus I haven't actually run it yet.
-rw-r--r--ChangeLog12
-rw-r--r--configure.ac102
-rw-r--r--hw/xfree86/Makefile.am3
-rw-r--r--hw/xfree86/os-support/bsd/Makefile.am76
-rw-r--r--include/dix-config.h.in3
-rw-r--r--include/xorg-config.h.in33
-rw-r--r--include/xorg-server.h.in15
7 files changed, 234 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 9df5e252d..fa95db9bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-09-13 Eric Anholt <anholt@FreeBSD.org>
+
+ * configure.ac:
+ * hw/xfree86/Makefile.am:
+ * hw/xfree86/os-support/bsd/Makefile.am:
+ * include/dix-config.h.in:
+ * include/xorg-config.h.in:
+ * include/xorg-server.h.in:
+ Add some initial BSD support for the xorg server. Incomplete on NetBSD,
+ OpenBSD, and non-i386/amd64 FreeBSD for sure. Plus I haven't actually
+ run it yet.
+
2005-09-12 Eric Anholt <anholt@FreeBSD.org>
* configure.ac:
diff --git a/configure.ac b/configure.ac
index 6c6a02bd2..a8b37878a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,7 +96,8 @@ AC_CHECK_LIB(m, sqrt)
AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
dnl AGPGART headers
-AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h])
+AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h], AGP=yes)
+AM_CONDITIONAL(AGP, [test "x$AGP" == xyes])
dnl APM header
AC_CHECK_HEADERS([linux/apm_bios.h])
@@ -108,6 +109,31 @@ AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes])
dnl MTRR header
AC_CHECK_HEADERS([asm/mtrr.h])
+dnl BSD MTRR header
+AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes)
+if test "x$ac_cv_memrange_h" == xyes; then
+ AC_DEFINE(HAS_MTRR_SUPPORT, 1, [Define to 1 if BSD MTRR support is
+ available])
+fi
+
+dnl A NetBSD MTRR header
+AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_mtrr_h=yes)
+if test "x$ac_cv_mtrr_h" == xyes; then
+ AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR
+ support is available])
+fi
+
+dnl FreeBSD kldload support (sys/linker.h)
+AC_CACHE_CHECK([for sys/linker.h],
+ ac_cv_sys_linker_h,
+ [AC_TRY_RUN([
+#include <sys/param.h>
+#include <sys/linker.h>
+],
+ [ac_cv_sys_linker_h=yes],
+ [ac_cv_sys_linker_h=no])])
+AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" == xyes])
+
AC_CACHE_CHECK([for SYSV IPC],
ac_cv_sysv_ipc,
[AC_TRY_RUN([
@@ -136,21 +162,78 @@ use_x86_asm="no"
dnl Override defaults as needed for specific platforms:
case $host_cpu in
- sparc*)
- xorg_bus_sparc="yes"
- xorg_loader_sparcmuldiv="yes"
+ alpha*)
+ ALPHA_VIDEO=yes
+ case $host_os in
+ *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
+ esac
+ ;;
+ arm*)
+ ARM_VIDEO=yes
;;
i*86)
xorg_bus_ix86pci="yes"
use_x86_asm="yes"
+ I386_VIDEO=yes
case $host_os in
*linux*) DEFAULT_INT10=vm86 ;;
- *bsd*) xorg_bus_ix86pci="no" ;;
+ *freebsd*) xorg_bus_ix86pci="no"
+ AC_DEFINE(USE_DEV_IO) ;;
+ *netbsd*) xorg_bus_ix86pci="no"
+ AC_DEFINE(USE_I386_IOPL) ;;
+ *openbsd*) xorg_bus_ix86pci="no"
+ AC_DEFINE(USE_I386_IOPL) ;;
esac
;;
- x86_64*)
- use_x86_asm="yes"
+ powerpc*)
+ PPC_VIDEO=yes
+ case $host_os in
+ *freebsd*) DEFAULT_INT10=stub ;;
+ esac
+ ;;
+ sparc*)
+ xorg_bus_sparc="yes"
+ xorg_loader_sparcmuldiv="yes"
+ SPARC64_VIDEO=yes
+ BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
+ ;;
+ x86_64*|amd64*)
xorg_bus_ix86pci="yes"
+ use_x86_asm="yes"
+ I386_VIDEO=yes
+ case $host_os in
+ *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
+ *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) ;;
+ *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl]) ;;
+ esac
+ ;;
+esac
+
+
+dnl BSD *_video.c selection
+AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" == xyes])
+AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" == xyes])
+AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" == xyes])
+AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" == xyes])
+AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" == xyes])
+
+dnl it would be nice to autodetect these *CONS_SUPPORTs
+case $host_os in
+ *freebsd*)
+ AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
+ AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
+ AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
+ AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console])
+ ;;
+ *netbsd*)
+ AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
+ AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
+ AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
+ ;;
+ *openbsd*)
+ AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
+ AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
+ AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
;;
esac
@@ -585,7 +668,9 @@ if test "x$XORG" = xyes; then
XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
XORG_CORE_LIBS="$DIX_LIB"
XORG_LIBS="$MI_LIB $FIXES_LIB $XEXT_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
-
+
+ AC_CHECK_LIB([dl], [dlopen], XORG_LIBS="$XORG_LIBS -ldl")
+
case $host_os in
linux*)
XORG_OS="linux"
@@ -940,6 +1025,7 @@ hw/xfree86/i2c/Makefile
hw/xfree86/int10/Makefile
hw/xfree86/loader/Makefile
hw/xfree86/os-support/Makefile
+hw/xfree86/os-support/bsd/Makefile
hw/xfree86/os-support/bus/Makefile
hw/xfree86/os-support/drm/Makefile
hw/xfree86/os-support/misc/Makefile
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 3dd5adceb..e1177a7e1 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -49,8 +49,7 @@ XORG_LIBS = \
Xorg_LDADD = $(XORG_LIBS) \
@XSERVER_LIBS@ \
- dixmods/libxorgxkb.la \
- -ldl
+ dixmods/libxorgxkb.la
Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am
new file mode 100644
index 000000000..7ec0932dc
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/Makefile.am
@@ -0,0 +1,76 @@
+noinst_LTLIBRARIES = libbsd.la
+
+# FIXME: Add USB mouse support?
+
+# FIXME: APM support.
+APM_SOURCES = $(srcdir)/../shared/pm_noop.c
+
+if FREEBSD_KLDLOAD
+KMOD_SOURCES = bsd_kmod.c
+else
+KMOD_SOURCES = $(srcdir)/../shared/kmod_noop.c
+endif
+
+# FIXME: Non-i386/ia64 resource support.
+RES_SOURCES = $(srcdir)/../shared/stdResource.c
+
+if AGP
+AGP_SOURCES = $(srcdir)/../linux/lnx_agp.c
+else
+AGP_SOURCES = $(srcdir)/../shared/agp_noop.c
+endif
+
+if ALPHA_VIDEO
+# Cheat here and piggyback other alpha bits on ALPHA_VIDEO.
+ARCH_SOURCES = \
+ alpha_video.c \
+ bsd_ev56.c \
+ bsd_axp.c \
+ $(srcdir)/../shared/xf86Axp.c
+endif
+
+if ARM_VIDEO
+ARCH_SOURCES = arm_video.c
+endif
+
+if I386_VIDEO
+ARCH_SOURCES = i386_video.c
+endif
+
+if PPC_VIDEO
+ARCH_SOURCES = ppc_video.c
+endif
+
+if SPARC64_VIDEO
+# Cheat here and piggyback other sparc64 bits on SPARC64_VIDEO.
+ARCH_SOURCES = \
+ sparc64_video.c \
+ $(srcdir)/../shared/ioperm_noop.c
+endif
+
+# FIXME: NetBSD Aperture defines (configure.ac)
+AM_CFLAGS = -DUSESTDRES -DUSE_DEV_IO $(XORG_CFLAGS)
+
+INCLUDES = $(XORG_INCS)
+
+libbsd_la_SOURCES = \
+ $(srcdir)/../shared/at_scancode.c \
+ $(srcdir)/../shared/libc_wrapper.c \
+ $(srcdir)/../shared/posix_tty.c \
+ $(srcdir)/../shared/sigio.c \
+ $(srcdir)/../shared/std_kbdEv.c \
+ $(srcdir)/../shared/stdPci.c \
+ $(srcdir)/../shared/vidmem.c \
+ bsd_VTsw.c \
+ bsd_init.c \
+ bsd_io.c \
+ bsd_kbd.c \
+ bsd_KbdMap.c \
+ bsd_mouse.c \
+ $(ARCH_SOURCES) \
+ $(AGP_SOURCES) \
+ $(APM_SOURCES) \
+ $(AXP_SOURCES) \
+ $(DRI_SOURCES) \
+ $(KMOD_SOURCES) \
+ $(RES_SOURCES)
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index fd681be53..62884a889 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -391,4 +391,7 @@
/* Define to location of RGB database */
#undef RGB_PATH
+/* System is BSD-like */
+#undef CSRG_BASED
+
#endif /* _DIX_CONFIG_H_ */
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 241279588..08d6e8cb6 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -79,4 +79,37 @@
/* Building vgahw module */
#undef WITH_VGAHW
+/* Define to 1 if NetBSD built-in MTRR support is available */
+#undef HAS_MTRR_BUILTIN
+
+/* Define to 1 if BSD MTRR support is available */
+#undef HAS_MTRR_SUPPORT
+
+/* NetBSD PIO alpha IO */
+#undef USE_ALPHA_PIO
+
+/* BSD AMD64 iopl */
+#undef USE_AMD64_IOPL
+
+/* BSD /dev/io */
+#undef USE_DEV_IO
+
+/* BSD i386 iopl */
+#undef USE_I386_IOPL
+
+/* System is BSD-like */
+#undef CSRG_BASED
+
+/* System has PC console */
+#undef PCCONS_SUPPORT
+
+/* System has PCVT console */
+#undef PCVT_SUPPORT
+
+/* System has syscons console */
+#undef SYSCONS_SUPPORT
+
+/* System has wscons console */
+#undef WSCONS_SUPPORT
+
#endif /* _XORG_CONFIG_H_ */
diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in
index 713047f0b..332186875 100644
--- a/include/xorg-server.h.in
+++ b/include/xorg-server.h.in
@@ -226,4 +226,19 @@
/* Building vgahw module */
#undef WITH_VGAHW
+/* System is BSD-like */
+#undef CSRG_BASED
+
+/* System has PC console */
+#undef PCCONS_SUPPORT
+
+/* System has PCVT console */
+#undef PCVT_SUPPORT
+
+/* System has syscons console */
+#undef SYSCONS_SUPPORT
+
+/* System has wscons console */
+#undef WSCONS_SUPPORT
+
#endif /* _XORG_SERVER_H_ */