Automatically paths in site prefix to PKG_CONFIG_PATH
[sxemacs] / configure.ac
index a6d48ef..a680427 100644 (file)
@@ -178,7 +178,7 @@ OG_ARG_WITH([package-prefix],
        AS_HELP_STRING([--with-package-prefix=PATH],
                [What to use as a prefix to the system-wide package
                directories.  It doesn't affect the package directories
-               under ~/.sxemacs, and is totally ignored if
+               under the user's home directory, and is totally ignored if
                --with-package-path is set.
                Normally, you would not need to set this.]),
        [none], [None], [og_any],
@@ -334,6 +334,7 @@ OG_MULTIARG_WITH([modules], [dnl
        OG_MULTIARG_ITEM([ase], [ase], [algebraic structures])
        OG_MULTIARG_ITEM([cl], [cl], [fast Common Lisp implementation])
 ])
+       dnl OG_MULTIARG_ITEM([dbus], [dbus], [D-BUS bindings])
 
 OG_MULTIARG_WITH([static-modules], [dnl
        AS_HELP_STRING([--with-static-modules], [
@@ -345,6 +346,7 @@ OG_MULTIARG_WITH([static-modules], [dnl
        OG_MULTIARG_ITEM([ase], [ase], [algebraic structures])
        OG_MULTIARG_ITEM([cl], [cl], [fast Common Lisp implementation])
 ])
+       dnl OG_MULTIARG_ITEM([dbus], [dbus], [D-BUS bindings])
 
 OG_MULTIARG_WITH([ent], [dnl
        AS_HELP_STRING([--with-ent], [
@@ -618,23 +620,16 @@ OG_MULTIARG_WITH([image], [dnl
 OG_MULTIARG_WITH([sound], [dnl
        AS_HELP_STRING([--with-sound=TYPE],
                [Compile with sound support.])],
-       [auto], [Autodetect all sound support (except Pulse)], [dnl
+       [auto], [Autodetect all sound support], [dnl
        OG_MULTIARG_ITEM([alsa], [ALSA], [kernel-based linux sound standard])
        OG_MULTIARG_ITEM([ao], [ao], [generic audio output layer])
        OG_MULTIARG_ITEM([esd], [ESD], [Enlightenment Sound Daemon])
        OG_MULTIARG_ITEM([jack], [Jack], [a low-latency audio server])
        OG_MULTIARG_ITEM([nas], [NAS], [Network Audio System])
        OG_MULTIARG_ITEM([oss], [OSS], [Open Sound System])
+       OG_MULTIARG_ITEM([pulse], [PulseAudio], [PulseAudio Sound Server])
 ])
 
-OG_ARG_WITH([pulseaudio],
-       AS_HELP_STRING([--with-pulseaudio],
-               [Compile with support for the PulseAudio audio server.
-               This has been turned off by default because of too many
-               bugs in recent versions of PA.  Use at your own risk,
-               YMMV, and all that.]),
-       [no], [NO])
-
 OG_MULTIARG_WITH([media], [dnl
        AS_HELP_STRING([--with-media=TYPE],
                [Compile with media stream support.])],
@@ -835,7 +830,7 @@ AC_MSG_CHECKING([for SXEmacs patchlevel])
 CURDIR=$(pwd)
 cd "$sxe_srcdir"
 AS_IF([test "$have_git" = "yes"], 
-           [sxemacs_git_version=`git describe | head -1`])
+           [sxemacs_git_version=`git describe 2> /dev/null | head -1`])
 AS_IF([test -z "$sxemacs_git_version"],
        sxemacs_git_version="[]SXEM4CS_GIT_VERSION[]")
 AC_MSG_RESULT([$sxemacs_git_version])
@@ -1814,8 +1809,24 @@ else
                AC_MSG_WARN([Sorry no bison means no cl module for you.])
        fi
 fi
+
 SXE_EMOD_STATMOD([cl])
 
+dnl D-Bus
+dnl SXE_CHECK_DBUS
+dnl if test "$have_dbus" = "yes"; then
+dnl    if test "$with_modules_dbus" = "yes"; then
+dnl            have_modules_dbus=yes
+dnl    fi
+dnl    if test "$with_static_modules_dbus" = "yes"; then
+dnl            have_static_modules_dbus=yes
+dnl    fi
+dnl else
+dnl    AC_MSG_WARN([I cannot believe you do not have d-bus.])
+dnl fi
+
+dnl SXE_EMOD_STATMOD([dbus])
+
 AM_CONDITIONAL([AUTARKIC], [test "0" = "1"])
 MODARCHDIR=
 MAKE_DOCFILE="$sxe_blddir/lib-src/make-docfile"
@@ -2859,11 +2870,12 @@ AS_IF([test "$with_tty" != "no" -a "$have_tty" != no], [
 
 SXE_CHECK_UI_SUFFICIENCY
 
-AS_IF([test -z "$window_system" -o "$window_system" != "none" ], [
+AS_IF([test -z "$window_system" -o "$window_system" = "none" ], [
     dnl It ought to be reasonable to have no output device at all, and only use
     dnl SXEmacs in --batch mode.
-    AS_IF([test "$with_tty" = "no"],
-       AC_MSG_WARN([No window system nor TTY support. You only can use --batch mode.]))
+    AS_IF([test "$have_tty" = "no"],
+       AC_MSG_ERROR([No window system nor TTY support. SXEmacs cannot be compiled.
+Check INSTALL and PROBLEMS files for hints on how to solve.]))
 ])
 
 ## Uncertain options
@@ -3009,6 +3021,17 @@ fi
 ## Since almost any of the below tests uses pkgconfig we make a
 ## once-for-all-times check now
 SXE_SEARCH_CONFIG_PROG([pkg-config])
+if test "$have_pkg_config" = "yes" -a -n "$with_site_prefixes"; then
+       for dir in $with_site_prefixes; do
+               pkgcfg_dir="${dir}/lib/pkgconfig"
+               if test -n "$PKG_CONFIG_PATH"; then
+                  PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$pkgcfg_dir"
+               else
+                  PKG_CONFIG_PATH="$pkgcfg_dir"
+               fi
+       done
+       export PKG_CONFIG_PATH
+fi
 
 dnl libsndfile support
 if test "$with_media_sndfile" != "no"; then
@@ -3055,7 +3078,6 @@ fi
 
 dnl sox support
 if test "$with_media_sox" != "no"; then
-       ## defines $LIBST_CONFIG
        SXE_MM_CHECK_SOX([have_media_sox=yes], [have_media_sox=no])
 
        AC_MSG_CHECKING([for sufficient SoX support])
@@ -3160,24 +3182,18 @@ if test "$with_sound_esd" != "no"; then
 fi
 
 dnl PulseAudio Sound support
-if test "$with_pulseaudio" != "no"; then
+if test "$with_sound_pulse" != "no"; then
        SXE_MM_CHECK_PULSE([have_sound_pulse=yes], [have_sound_pulse=no])
 
        AC_MSG_CHECKING([for sufficient PulseAudio support])
        if test "$have_sound_pulse" = "yes"; then
                AC_MSG_RESULT([yes])
-               PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse`
-               pulse_version=`$PKG_CONFIG --modversion libpulse`
-               pulse_major_version=0
-               pulse_minor_version=`echo $pulse_version | \
-                       sed -e "s/0\.\([[0-9]]*\).*/\1/"`
                need_internal_media=yes
                SXE_ADD_MM_OBJS([sound-pulse.o])
-               SXE_PREPEND($PULSEAUDIO_LIBS, MM_LIBS)
+               SXE_PREPEND($PULSE_LIBS, MM_LIBS)
+               SXE_PREPEND_UNDUP($PULSE_CFLAGS, MM_CPPFLAGS)
                AC_DEFINE([HAVE_PULSE_SOUND], [1],
                        [Whether to put in support for PulseAudio.])
-               AC_DEFINE_UNQUOTED([PULSE_VERSION], [$pulse_minor_version],
-                       [Version of the underlying pulse lib.])
        else
                AC_MSG_RESULT(no)
                have_sound_pulse=no
@@ -3557,19 +3573,6 @@ int main(int c, char *v[])
        [have_setitimer=$?],[have_setitimer=0])
 AM_CONDITIONAL([HAVE_SETITIMER], [test "$have_setitimer" = "1"])
 
-## whether to build with sheap.o
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-int main(int c, char *v[])
-{
-#if defined(HEAP_IN_DATA) && !defined(PDUMP)
-       return 1;
-#else
-       return 0;
-#endif
-}]])], [./conftest; build_sheap=$?],
-       [build_sheap=$?],[build_sheap=0])
-AM_CONDITIONAL([BUILD_SHEAP], [test "$build_sheap" = "1"])
-
 
 dnl There are no more compile tests; remove the core they created.
 rm -f core