fi
AC_SUBST(LIBXSM)
+ ### Use XRandr (-lXrandr) if available
+ HAVE_XRANDR=no
+ if test "${HAVE_X11}" = "yes"; then
+ XRANDR_REQUIRED=1.2.2
+ XRANDR_MODULES="xrandr >= $XRANDR_REQUIRED"
+ PKG_CHECK_MODULES(XRANDR, $XRANDR_MODULES, HAVE_XRANDR=yes, HAVE_XRANDR=no)
+ if test $HAVE_XRANDR = no; then
+ # Test old way in case pkg-config doesn't have it (older machines).
+ AC_CHECK_HEADER(X11/extensions/Xrandr.h,
+ [AC_CHECK_LIB(Xrandr, XRRQueryExtension, HAVE_XRANDR=yes)])
+ if test $HAVE_XRANDR = yes; then
+ XRANDR_LIBS=-lXrandr
+ AC_SUBST(XRANDR_LIBS)
+ fi
+ fi
+ if test $HAVE_XRANDR = yes; then
+ SAVE_CFLAGS="$CFLAGS"
+ SAVE_LIBS="$LIBS"
+ CFLAGS="$XRANDR_CFLAGS $CFLAGS"
+ LIBS="$XRANDR_LIBS $LIBS"
+ AC_CHECK_FUNCS(XRRGetOutputPrimary XRRGetScreenResourcesCurrent)
+ CFLAGS="$SAVE_CFLAGS"
+ LIBS="$SAVE_LIBS"
+
+ AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have the XRandr extension.])
+ fi
+ fi
+
+ ### Use Xinerama (-lXinerama) if available
+ HAVE_XINERAMA=no
+ if test "${HAVE_X11}" = "yes"; then
+ XINERAMA_REQUIRED=1.0.2
+ XINERAMA_MODULES="xinerama >= $XINERAMA_REQUIRED"
+ PKG_CHECK_MODULES(XINERAMA, $XINERAMA_MODULES, HAVE_XINERAMA=yes,
+ HAVE_XINERAMA=no)
+ if test $HAVE_XINERAMA = no; then
+ # Test old way in case pkg-config doesn't have it (older machines).
+ AC_CHECK_HEADER(X11/extensions/Xinerama.h,
+ [AC_CHECK_LIB(Xinerama, XineramaQueryExtension, HAVE_XINERAMA=yes)])
+ if test $HAVE_XINERAMA = yes; then
+ XINERAMA_LIBS=-lXinerama
+ AC_SUBST(XINERAMA_LIBS)
+ fi
+ fi
+ if test $HAVE_XINERAMA = yes; then
+ AC_DEFINE(HAVE_XINERAMA, 1, [Define to 1 if you have the Xinerama extension.])
+ fi
+ fi
+
+
### Use libxml (-lxml2) if available
+### mingw32 doesn't use -lxml2, since it loads the library dynamically.
HAVE_LIBXML2=no
if test "${with_xml2}" != "no"; then
### I'm not sure what the version number should be, so I just guessed.
## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS.
gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;;
+ mingw32)
++ ## MinGW64 does not prepend an underscore to symbols, so we must
++ ## pass a different -entry switch to linker. FIXME: It is better
++ ## to make the entry points the same by changing unexw32.c.
+ case "$canonical" in
+ x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,_start -Wl,-Map,./temacs.map" ;;
+ *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;;
+ esac
+ ;;
+
+ openbsd) LD_SWITCH_SYSTEM_TEMACS='-nopie' ;;
+
*) LD_SWITCH_SYSTEM_TEMACS= ;;
esac