Bump version to 4.0.1.
[terminatorX.git] / configure.ac
index 2796e6ca333e6e13d7b0c1ef71851f3b65f9b084..8c99afbe10b47abd3d4c23d86254df3af3999d34 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([terminatorX], [3.90], [https://terminatorx.org/bugs/], [terminatorX])
+AC_INIT([terminatorX], [4.0.1], [https://terminatorX.org/bugs/], [terminatorX], [https://terminatorX.org])
 
 AC_CONFIG_SRCDIR([src/tX_global.h])
 AM_INIT_AUTOMAKE
@@ -12,11 +12,11 @@ AC_ARG_ENABLE(scheduler,    [  --enable-scheduler      enable rt-scheduling (defaul
 AC_ARG_ENABLE(debug,           [  --enable-debug          enable debug output. (default=no) ])
 dnl AC_ARG_ENABLE(benchmark    [  --enable-benchmark      creates a non-functional test version (default=no) ])
 AC_ARG_ENABLE(wav,             [  --enable-wav            enables the built-in wav-loader (default=yes) ])
-AC_ARG_ENABLE(xsetpointer,     [  --enable-xsetpointer    enables executing of xsetpointer (default=auto) ])
 AC_ARG_ENABLE(alsa,            [  --enable-alsa           use ALSA for sound output (default=auto) ])
 AC_ARG_ENABLE(jack,            [  --enable-jack           use JACK for sound output (default=auto) ])
 AC_ARG_ENABLE(oss,             [  --enable-oss            use OSS for sound output (default=auto) ])
-dnl AC_ARG_ENABLE(dga2,                [  --enable-dga2           use DGA2 instead of DGA1. (experimental) (default=no) ])
+AC_ARG_ENABLE(pulse,           [  --enable-pulse          use PulseAudio for sound output (default=auto) ])
+AC_ARG_ENABLE(x11,    [  --enable-x11            include X11 specific code (default=auto) ])
 AC_ARG_ENABLE(libxml2,         [  --disable-libxml2       use libxml even if verion 2 detected (default=auto) ])
 AC_ARG_ENABLE(mad,             [  --disable-mad           disable mad for mp3 support (default=auto) ])
 AC_ARG_ENABLE(vorbis,          [  --disable-vorbis        disable libvorbis support (default=auto) ])
@@ -27,6 +27,7 @@ AC_ARG_ENABLE(alsamidi,               [  --disable-alsamidi      disable support  ALSA MIDI i
 AC_ARG_ENABLE(lrdf,            [  --disable-lrdf          disable support for liblrdf (default=auto) ])
 AC_ARG_ENABLE(capabilities,    [  --enable-capabilities   to use rt-scheduling (default=auto) ])
 AC_ARG_ENABLE(deprecated,      [  --disable-deprecated    compile without deprecated G*-headers (default=no) ])
+AC_ARG_ENABLE(suidroot,   [  --enable-suidroot      install terminatorX setuid root (default=no) ])
 AC_ARG_WITH(docdir,            [  --with-docdir=/some/dir the final location the docs will be installed to. ])
 
 dnl Checks for programs.
@@ -40,6 +41,8 @@ AC_PROG_RANLIB
 OPTION_OSS="no"
 OPTION_ALSA="no"
 OPTION_JACK="no"
+OPTION_PULSE="no"
+OPTION_X11="no"
 OPTION_SOX="no"
 OPTION_MPG123="no"
 OPTION_MAD="no"
@@ -52,6 +55,7 @@ OPTION_ALSAMIDI="no"
 OPTION_LEGACY="no"
 OPTION_LRDF="no"
 OPTION_CAP="no"
+OPTION_SUIDROOT="no"
 
 dnl Checks for libraries.
 AC_CHECK_LIB(m, floor,, AC_MSG_ERROR([** math-lib not installed or broken **]))
@@ -135,6 +139,11 @@ else
        AC_MSG_ERROR([** couldn't find gtk+ > Version 3. Please upgrade (http://www.gtk.org). **])
 fi
 
+AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources])
+AS_IF([test "$GLIB_COMPILE_RESOURCES" == ""],[
+               AC_MSG_ERROR([glib-compile-resources not found])
+               ])
+
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h unistd.h)
@@ -210,16 +219,6 @@ if test "$enable_mad" != "no"; then
        fi
 fi
 
-AC_CHECK_HEADERS(X11/extensions/Xxf86dga.h,newDgaHeader=yes,newDgaHeader=no, [#include <X11/Xlib.h>])
-
-if test "$newDgaHeader" = "no"; then
-       AC_CHECK_HEADERS(X11/extensions/xf86dga.h,oldDgaHeader=yes,oldDgaHeader=no, [#include <X11/Xlib.h>])
-       
-       if test "$oldDgaHeader" = "no"; then
-               AC_MSG_ERROR([** couldn't find xf86dga.h header - Install X11 headers first. **])
-       fi
-fi
-
 if test "$enable_vorbis" != "no"; then
        AC_CHECK_HEADERS(vorbis/codec.h vorbis/vorbisfile.h,vorbis_headers=yes,vorbis_headers="no")
        if test "$vorbis_headers" = "yes"; then
@@ -289,24 +288,14 @@ if test "$enable_ogg123" != "no"; then
        fi
 fi
 
-if test "$enable_xsetpointer" != "no"; then
-       AC_CHECK_PROG(XSETPOINTER_PROG, xsetpointer, yes)
-       if test "$XSETPOINTER_PROG" = "yes"; then
-               AC_DEFINE_UNQUOTED([USE_XSETPOINTER], 1, [Exec xsetpointer instead of using Xlib-calls.])
-       else
-               if test "$enable_xsetpointer" = "yes"; then
-                       AC_MSG_ERROR([** xsetpointer not found. **])
-               fi
-       fi
-fi
-
 if test "$enable_movqfix" = "no"; then
-       AC_DEFINE_UNQUOTED([OVERRIDE_MOVQ_AUTODETECT], 1, [Don't use movqfix])
+       AC_DEFINE_UNQUOTED([OVERRIDE_MOVQ_AUTODETECT], 1, [Do nott use movqfix])
 fi
 
 using_alsa=no
 using_oss=no
 using_jack=no
+using_pulse=no
 
 if test "$enable_alsa" != "no"; then
     AC_CHECK_LIB(asound, snd_pcm_writei,alsalib=yes,alsalib=no)
@@ -320,12 +309,12 @@ if test "$enable_alsa" != "no"; then
                    OPTION_ALSA=yes
            else 
                    if test "$enable_alsa" = "yes"; then
-                           AC_MSG_ERROR([** Coulnd't find ALSA header file sys/asoundlib.h **])
+                           AC_MSG_ERROR([** Could not find ALSA header file sys/asoundlib.h **])
                    fi
            fi
     else
            if test "$enable_alsa" = "yes"; then
-                   AC_MSG_ERROR([** Coulnd'f find ALSA library libasound. **])
+                   AC_MSG_ERROR([** Could not find ALSA library libasound. **])
            fi
     fi
 fi
@@ -342,16 +331,39 @@ if test "$enable_jack" != "no"; then
                    OPTION_JACK=yes
            else 
                    if test "$enable_jack" = "yes"; then
-                           AC_MSG_ERROR([** Coulnd't find JACK header file jack/jack.h **])
+                           AC_MSG_ERROR([** Could not find JACK header file jack/jack.h **])
                    fi
            fi
     else
            if test "$enable_jack" = "yes"; then
-                   AC_MSG_ERROR([** Coulnd'f find JACK library libjack. **])
+                   AC_MSG_ERROR([** Could not find JACK library libjack. **])
            fi
     fi
 fi
 
+if test "$enable_pulse" != "no"; then
+    AC_CHECK_LIB(pulse-simple,pa_simple_new,pulselib=yes,pulselib=no)
+    AC_CHECK_HEADERS(pulse/pulseaudio.h,pulseheader=yes,pulseheader=no)
+
+    if test "$pulselib" = "yes"; then
+           if test "$pulseheader" = "yes"; then
+                   AC_DEFINE_UNQUOTED([USE_PULSE], 1, [ Define to enable PULSE audio backend.])
+                   LIBS="$LIBS -lpulse-simple -lpulse"
+                   using_pulse=yes
+                   OPTION_PULSE=yes
+           else 
+                   if test "$enable_pulse" = "yes"; then
+                           AC_MSG_ERROR([** Could not find PULSE header file pulse/pulseaudio.h **])
+                   fi
+           fi
+    else
+           if test "$enable_pulse" = "yes"; then
+                   AC_MSG_ERROR([** Could not find PULSE library libpulse. **])
+           fi
+    fi
+
+fi
+
 
 if test "$enable_oss" != "no"; then
        AC_CHECK_HEADERS(sys/ioctl.h sys/soundcard.h,oss=yes,oss=no)
@@ -362,7 +374,7 @@ if test "$enable_oss" != "no"; then
                using_oss=yes;
        else
                if test "$enable_oss" = "yes"; then
-                       AC_MSG_ERROR([** Couldn't find OSS header files. ***])
+                       AC_MSG_ERROR([** Could not find OSS header files. ***])
                fi
        fi
 fi
@@ -396,10 +408,34 @@ fi
 if test "$using_alsa" != "yes"; then
        if test "$using_oss" != "yes"; then
                if test "$using_jack" != "yes"; then
-                       AC_MSG_ERROR([** Found neither OSS, ALSA nor JACK - no output device! **])
+                       if test "$using_pulse" != "yes"; then
+                               AC_MSG_ERROR([** Found neither OSS, ALSA, JACK nor PULSE - no output device! **])
+                       fi
                fi
        fi
 fi     
+
+if test "$enable_x11" != "no"; then
+               AC_CHECK_LIB(X11, XOpenDisplay, x11lib=yes, x11lib=no)
+               AC_CHECK_HEADERS(X11/Xlib.h, x11header=yes, x11header=no)
+
+    if test "$x11lib" = "yes"; then
+           if test "$x11header" = "yes"; then
+                   AC_DEFINE_UNQUOTED([USE_X11], 1, [ Define to enable X11 specific code (e.g. fullscreen mode ).])
+                                               LIBS="$LIBS -lX11"
+                   using_x11=yes
+                                               OPTION_X11=yes
+           else 
+                   if test "$enable_x11" = "yes"; then
+                           AC_MSG_ERROR([** X11 headers not installed or broken **])
+                   fi
+           fi
+    else
+           if test "$enable_x11" = "yes"; then
+                   AC_MSG_ERROR([** X11 libs not installed or broken **])
+           fi
+    fi
+fi
        
 if test "$enable_wav" != "no";
 then
@@ -446,8 +482,6 @@ if test "$enable_capabilities" = "yes"; then
        fi
 fi
 
-
-
 if test "$enable_deprecated" = "no"; then
        DEPRECATED_FLAGS="-DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED"
 else 
@@ -456,6 +490,14 @@ fi
 
 AC_SUBST(DEPRECATED_FLAGS)
 
+if test "$enable_suidroot" = "yes"; then
+       OPTION_SUIDROOT="yes"
+else
+       OPTION_SUIDROOT="no"
+fi
+
+AM_CONDITIONAL([SUIDROOT], [ test x$OPTION_SUIDROOT = xyes])
+
 AC_MSG_CHECKING(for necessary scratching skillz)
 AC_MSG_RESULT(yes)
 
@@ -471,10 +513,6 @@ if test "$enable_legacy" = yes; then
        OPTION_LEGACY="yes"
 fi
 
-dnl if test "$enable_dga2" = yes; then
-dnl    AC_DEFINE(USE_DGA2)
-dnl fi
-
 dnl Detecting libxml. Based on dia's test.
 found_libxml=false
 
@@ -549,23 +587,6 @@ GNOME_DOC_INIT
 
 xml_man="\\\"${datadir}/gnome/help/terminatorX-manual/C/terminatorX-manual.xml\\\""
 
-dnl Now Check for Xlibs - I do this here as other tests fail if these run earlier
-AC_PATH_XTRA
-
-AC_SUBST(X_CFLAGS)
-AC_SUBST(X_PRE_LIBS)
-AC_SUBST(X_EXTRA_LIBS)
-AC_SUBST(X_LIBS)
-AC_SUBST(x_libraries)
-
-GTK_LIBS="$GTK_LIBS $X_LIBS"
-AC_CHECK_LIB(X11, XOpenDisplay,, AC_MSG_ERROR([** X11-libs not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
-AC_CHECK_LIB(Xext, XShmQueryExtension,, AC_MSG_ERROR([** Xext-libs not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
-AC_CHECK_LIB(Xi, XOpenDevice,, AC_MSG_ERROR([** XInput not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
-AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,, AC_MSG_ERROR([** DGA not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
-if test "$enable_dga2" = yes; then
-       AC_CHECK_LIB(Xxf86dga, XDGASelectInput,, AC_MSG_ERROR([** DGA2 not installed. Try using dga1 instead. **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
-fi
 
 CFLAGS="$XML_CFLAGS $CFLAGS -DXML_MANUAL=$xml_man"
 LIBS="$XML_LIBS $LIBS"
@@ -614,6 +635,9 @@ option_info;
 option=jack; option_val=$OPTION_JACK; option_url=http://jackit.sourceforge.net
 option_info;
 
+option=pulse; option_val=$OPTION_PULSE; option_url=http://www.freedesktop.org/wiki/Software/PulseAudio/
+option_info;
+
 option=mad; option_val=$OPTION_MAD; option_url=http://www.mars.org/home/rob/proj/mpeg/
 option_info;
 
@@ -632,9 +656,16 @@ option_info;
 option=lrdf; option_val=$OPTION_LRDF; option_url=http://plugin.org.uk/releases/lrdf/
 option_info;
 
+echo "x11 support: $OPTION_X11"
 echo "legacy files support: $OPTION_LEGACY"
 echo "builtin-wav support: $OPTION_WAV"
 echo "enhanced scheduling support: $OPTION_SCHEDULER"
 echo "capabilities support: $OPTION_CAP"
+echo "install setuid-root: $OPTION_SUIDROOT"
 echo
 echo You can now run \'make\' to compile terminatorX
+
+if test "$OPTION_SUIDROOT" = "yes"; then
+    echo As setuid-root is enabled, \'make install\' must be run with root privileges.
+fi