summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac24
-rw-r--r--src/Makefile.am1
-rw-r--r--ztv/Makefile.am2
3 files changed, 26 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 179fd28..307ffe2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,6 +81,30 @@ if test "x$ztv" != "xno" ; then
fi
AM_CONDITIONAL(BUILD_ZTV, [test "x$BUILD_ZTV" = xyes])
+# Check if GCC supports compiling in 32 bit mode for 64 bit computers
+case $host_cpu in
+ x86_64*|amd64*)
+ if test "x$GCC" = xyes ; then
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -m32"
+ AC_MSG_CHECKING([if $CC supports the -m32 Intel/AMD option])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <unistd.h>
+int
+main ()
+{
+ ;
+ return 0;
+}]])],
+ [m32_support=yes; M32_CFLAGS=-m32],
+ [m32_support=no])
+ AC_MSG_RESULT([$m32_support])
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+esac
+AC_SUBST([M32_CFLAGS])
+
# Checks for extensions
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
diff --git a/src/Makefile.am b/src/Makefile.am
index d5f57b9..86139de 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,6 +35,7 @@ AM_CFLAGS = \
$(XORG_CFLAGS) \
$(CWARNFLAGS) \
$(AMD_CFLAGS) \
+ $(M32_CFLAGS) \
-DHAVE_GX \
-DHAVE_LX \
-DOPT_ACCEL
diff --git a/ztv/Makefile.am b/ztv/Makefile.am
index 670842b..0bc133e 100644
--- a/ztv/Makefile.am
+++ b/ztv/Makefile.am
@@ -1,7 +1,7 @@
if BUILD_ZTV
-AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
+AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(M32_CFLAGS)
ztv_drv_la_LTLIBRARIES = ztv_drv.la
ztv_drv_la_LDFLAGS = -module -avoid-version