autoconf goodness for XDarwin, courtesy of pogma

This commit is contained in:
Ben Byer 2007-02-17 02:23:11 -08:00
parent cf4994b0db
commit 81444486be
6 changed files with 162 additions and 18 deletions

View File

@ -280,6 +280,7 @@ case $host_cpu in
use_x86_asm="yes"
I386_VIDEO=yes
case $host_os in
darwin*) use_x86_asm="no" ;;
*linux*) DEFAULT_INT10=vm86 ;;
*freebsd*) AC_DEFINE(USE_DEV_IO) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL)
@ -305,6 +306,7 @@ case $host_cpu in
use_x86_asm="yes"
I386_VIDEO=yes
case $host_os in
darwin*) use_x86_asm="no" ;;
*freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
SYS_LIBS=-lx86_64
@ -473,6 +475,10 @@ AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RG
AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
[ DRI_DRIVER_PATH="$withval" ],
[ DRI_DRIVER_PATH="${libdir}/dri" ])
APPLE_APPLICATIONS_DIR="${bindir}/Applications"
AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: ${bindir}/Applications)]),
[ APPLE_APPLICATIONS_DIR="${withval}" ].
[ APPLE_APPLICATIONS_DIR="${bindir}/Applications" ])
AC_ARG_ENABLE(builddocs, AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]),
[BUILDDOCS=$enableval],
[BUILDDOCS=no])
@ -495,6 +501,7 @@ AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes exten
AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes])
AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
AC_ARG_ENABLE(quartz, AS_HELP_STRING([--enable-quartz], [Build with darwin quartz support (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto])
AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
@ -1007,6 +1014,9 @@ if test "x$GCC" = "xyes"; then
LD_EXPORT_SYMBOLS_FLAG="-rdynamic"
fi
case $host_os in
darwin*)
LD_EXPORT_SYMBOLS_FLAG=""
;;
openbsd*)
LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-dynamic"
;;
@ -1064,7 +1074,19 @@ AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
AC_DEFINE_UNQUOTED(X_BYTE_ORDER,[$ENDIAN],[Endian order])
AC_DEFINE_UNQUOTED(_X_BYTE_ORDER,[$ENDIAN],[Endian order])
AH_VERBATIM([X_BYTE_ORDER],[
/* Deal with multiple architecture compiles on Mac OS X */
#ifndef __APPLE_CC__
#define X_BYTE_ORDER _X_BYTE_ORDER
#else
#ifdef __BIG_ENDIAN__
#define X_BYTE_ORDER X_BIG_ENDIAN
#else
#define X_BYTE_ORDER X_LITTLE_ENDIAN
#endif
#endif
])
AC_SUBST([XSERVER_LIBS])
@ -1155,7 +1177,6 @@ if test "x$XORG" = xauto; then
XORG="yes"
case $host_os in
cygwin*) XORG="no" ;;
darwin*) XORG="no" ;;
esac
fi
AC_MSG_RESULT([$XORG])
@ -1269,6 +1290,60 @@ dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_LIB([dl], [dlopen], XORG_LIBS="$XORG_LIBS -ldl"))
case $host_os in
darwin*)
XORG_OS="Darwin"
build_darwin=yes
if test "X$XQUARTZ" = Xauto; then
AC_CACHE_CHECK([for Carbon framework],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework Carbon"
AC_LINK_IFELSE([char FSFindFolder();
int main() {
FSFindFolder();
return 0;}
],[xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS])
if test "X$xorg_cv_Carbon_framework" = Xyes; then
AC_DEFINE([DARWIN_WITH_QUARTZ],[1],
[Have Quartz])
XQUARTZ=yes
else
XQUARTZ=no
fi
fi
AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework AGL"
AC_LINK_IFELSE([char aglEnable();
int main() {
aglEnable();
return 0;}
],[xorg_cv_AGL_framework=yes],
[xorg_cv_AGL_framework=no])
LDFLAGS=$save_LDFLAGS
])
AC_CHECK_LIB([Xplugin],[xp_init],[:])
AC_SUBST([APPLE_APPLICATIONS_DIR])
CFLAGS="${CFLAGS} -D__DARWIN__"
PLIST_VERSION_STRING=$VENDOR_VERSION_STRING
AC_SUBST([PLIST_VERSION_STRING])
PLIST_VENDOR_WEB=$VENDOR_WEB
AC_SUBST([PLIST_VENDOR_WEB])
# Not sure that we should be disabling all these...
if test "x$XF86MISC" = xyes; then
AC_MSG_NOTICE([Disabling XF86Misc extension])
XF86MISC=no
fi
if test "x$XF86VIDMODE" = xyes; then
AC_MSG_NOTICE([Disabling XF86VidMode extension])
XF86VIDMODE=no
fi
if test "x$DGA" = xyes; then
AC_MSG_NOTICE([Disabling DGA extension])
DGA=no
fi
;;
linux*)
if test "x$LNXAPM" = xyes; then
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
@ -1391,11 +1466,14 @@ dnl has it in libc), or if libdl is needed to get it.
case $host_cpu in
i*86)
xorg_bus_ix86pci=yes
case $host_os in
darwin*) ;;
*) xorg_bus_ix86pci=yes ;;
esac
;;
powerpc*)
case $host_os in
linux*|freebsd*|netbsd*|openbsd*|kfreebsd*-gnu)
darwin*|linux*|freebsd*|netbsd*|openbsd*|kfreebsd*-gnu)
;;
*)
xorg_bus_ppcpci="yes"
@ -1408,7 +1486,7 @@ dnl has it in libc), or if libdl is needed to get it.
;;
x86_64*|amd64*)
case $host_os in
freebsd*|kfreebsd*-gnu)
darwin*|freebsd*|kfreebsd*-gnu)
# FreeBSD uses the system pci interface
;;
*)
@ -1484,6 +1562,8 @@ AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes])
AM_CONDITIONAL(MFB, [test "x$XORG" = xyes])
AM_CONDITIONAL(CFB, [test "x$XORG" = xyes])
AM_CONDITIONAL(AFB, [test "x$XORG" = xyes])
AM_CONDITIONAL([BUILD_DARWIN],[test "X$build_darwin" = Xyes])
AM_CONDITIONAL([XQUARTZ],[test "X$XQUARTZ" = Xyes])
AM_CONDITIONAL(DGA, [test "x$DGA" = xyes])
dnl Xprint DDX
@ -1494,7 +1574,7 @@ AC_MSG_RESULT([$XPRINT])
if test "x$XPRINT" = xyes; then
PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau])
XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS"
XPRINT_LIBS="$XPRINT_LIBS $DIX_LIB $CONFIG_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS"
XPRINT_LIBS="$DIX_LIB $CONFIG_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS $XPRINT_LIBS"
AC_SUBST([XPRINT_CFLAGS])
AC_SUBST([XPRINT_LIBS])
@ -1608,6 +1688,21 @@ AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes && false])
AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
dnl Darwin / OS X DDX
AM_CONDITIONAL(HAVE_X_PLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes])
AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes])
# Support for objc in autotools is minimal and not
# documented.
OBJC='$(CC)'
OBJCLD='$(CCLD)'
OBJCLINK='$(LINK)'
OBJCFLAGS='$(CFLAGS)'
AC_SUBST([OBJC])
AC_SUBST([OBJCCLD])
AC_SUBST([OBJCLINK])
AC_SUBST([OBJCFLAGS])
# internal, undocumented automake func follows :(
_AM_DEPENDENCIES([OBJC])
dnl kdrive DDX
@ -1737,12 +1832,6 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
AM_CONDITIONAL(KDRIVEVESA, [test x"$ac_cv_header_sys_vm86_h" = xyes])
AM_CONDITIONAL(KDRIVEFBDEV, [test x"$ac_cv_header_linux_fb_h" = xyes])
dnl XDarwin DDX (FIXME)
AM_CONDITIONAL(XQUARTZ, false)
AM_CONDITIONAL(HAVE_X_PLUGIN, false)
AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, false)
AM_CONDITIONAL(BUILD_DARWIN, false)
dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers)
AC_DEFINE(__XKBDEFRULES__, "xorg", [Default XKB rules])
AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
@ -1847,6 +1936,7 @@ XORG_RELEASE_VERSION
AC_OUTPUT([
Makefile
GL/Makefile
GL/apple/Makefile
GL/glx/Makefile
GL/mesa/Makefile
GL/mesa/glapi/Makefile
@ -1880,6 +1970,8 @@ miext/damage/Makefile
miext/shadow/Makefile
miext/cw/Makefile
miext/rootless/Makefile
miext/rootless/safeAlpha/Makefile
miext/rootless/accel/Makefile
os/Makefile
randr/Makefile
render/Makefile
@ -1957,6 +2049,22 @@ hw/xgl/glxext/module/Makefile
hw/xnest/Makefile
hw/xwin/Makefile
hw/darwin/Makefile
hw/darwin/bundle/Makefile
hw/darwin/bundle/Dutch.lproj/Makefile
hw/darwin/bundle/English.lproj/Makefile
hw/darwin/bundle/French.lproj/Makefile
hw/darwin/bundle/German.lproj/Makefile
hw/darwin/bundle/Japanese.lproj/Makefile
hw/darwin/bundle/Portuguese.lproj/Makefile
hw/darwin/bundle/Spanish.lproj/Makefile
hw/darwin/bundle/Swedish.lproj/Makefile
hw/darwin/bundle/ko.lproj/Makefile
hw/darwin/iokit/Makefile
hw/darwin/quartz/Makefile
hw/darwin/quartz/cr/Makefile
hw/darwin/quartz/fullscreen/Makefile
hw/darwin/quartz/xpr/Makefile
hw/darwin/utils/Makefile
hw/kdrive/Makefile
hw/kdrive/ati/Makefile
hw/kdrive/chips/Makefile

View File

@ -213,11 +213,7 @@ CoreKeyboardBell(int volume, DeviceIntPtr pDev, pointer arg, int something)
{
KeybdCtrl *ctrl = arg;
#ifdef __DARWIN__
// not yet implemented :(
#else
DDXRingBell(volume, ctrl->bell_pitch, ctrl->bell_duration);
#endif
}
static void

View File

@ -204,6 +204,12 @@ DarwinPrintBanner()
}
void DDXRingBell(int volume, int pitch, int duration)
{
// FIXME -- make some noise, yo
}
/*
* DarwinSaveScreen
* X screensaver support. Not implemented.

View File

@ -0,0 +1,11 @@
bin_PROGRAMS = dumpkeymap
dumpkeymap_SOURCES = dumpkeymap.c
dumpkeymap_LDFLAGS = -Wl,-framework,IOKit
man1_MANS = dumpkeymap.man
EXTRA_DIST = \
README.txt \
dumpkeymap.man

View File

@ -35,6 +35,9 @@
/* Support Damage extension */
#undef DAMAGE
/* Build for darwin with Quartz support */
#undef DARWIN_WITH_QUARTZ
/* Use OsVendorInit */
#undef DDXOSINIT
@ -420,7 +423,17 @@
#undef XVENDORNAME
/* Endian order */
#undef X_BYTE_ORDER
#undef _X_BYTE_ORDER
/* Deal with multiple architecture compiles on Mac OS X */
#ifndef __APPLE_CC__
#define X_BYTE_ORDER _X_BYTE_ORDER
#else
#ifdef __BIG_ENDIAN__
#define X_BYTE_ORDER X_BIG_ENDIAN
#else
#define X_BYTE_ORDER X_LITTLE_ENDIAN
#endif
#endif
/* Enable GNU and other extensions to the C environment for GLIBC */
#undef _GNU_SOURCE

View File

@ -191,7 +191,17 @@
#undef XVENDORNAME
/* Endian order */
#undef X_BYTE_ORDER
#undef _X_BYTE_ORDER
/* Deal with multiple architecture compiles on Mac OS X */
#ifndef __APPLE_CC__
#define X_BYTE_ORDER _X_BYTE_ORDER
#else
#ifdef __BIG_ENDIAN__
#define X_BYTE_ORDER X_BIG_ENDIAN
#else
#define X_BYTE_ORDER X_LITTLE_ENDIAN
#endif
#endif
/* BSD-compliant source */
#undef _BSD_SOURCE