New configure facility.

This commit is contained in:
Sanel Zukan
2007-03-17 11:28:25 +00:00
parent 06438466eb
commit be29467f10
11 changed files with 350 additions and 152 deletions

44
m4/fltk.m4 Normal file
View File

@@ -0,0 +1,44 @@
dnl
dnl $Id$
dnl
dnl Part of Equinox Desktop Environment (EDE).
dnl Copyright (c) 2000-2007 EDE Authors.
dnl
dnl This program is licenced under terms of the
dnl GNU General Public Licence version 2 or newer.
dnl See COPYING for details.
AC_DEFUN([EDE_CHECK_FLTK], [
dnl AC_MSG_NOTICE(whether is fltk 2.0 present)
AC_PATH_PROG(FLTK2_CONFIG, fltk2-config)
if test -n "$FLTK2_CONFIG"; then
FLTKFLAGS=`fltk2-config --cxxflags`
dnl remove -lsupc++ so we can chose what to use
FLTKLIBS=`fltk2-config --use-images --ldflags | sed -e 's/-lsupc++//g'`
else
AC_MSG_ERROR([You don't have fltk2 installed. To compile EDE, you will need it.])
fi
])
AC_DEFUN([EDE_CHECK_EFLTK], [
dnl AC_MSG_NOTICE(whether is efltk present)
AC_PATH_PROG(EFLTK_CONFIG, efltk-config)
if test -n "$EFLTK_CONFIG"; then
EFLTKFLAGS=`efltk-config --cxxflags`
EFLTKLIBS=`efltk-config --use-images --ldflags`
else
AC_MSG_ERROR([You don't have efltk installed. To compile EDE, you will need it.])
fi
AC_MSG_CHECKING(efltk version >= 2.0.4)
EFLTK_VERSION="`efltk-config --version`"
case "$EFLTK_VERSION" in ["2.0."[56789]])
dnl Display 'yes' for efltk version check
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_ERROR([It seems that you have older efltk version. Required is >= 2.0.4])
esac
])

33
m4/jam.m4 Normal file
View File

@@ -0,0 +1,33 @@
dnl
dnl $Id$
dnl
dnl Part of Equinox Desktop Environment (EDE).
dnl Copyright (c) 2000-2007 EDE Authors.
dnl
dnl This program is licenced under terms of the
dnl GNU General Public Licence version 2 or newer.
dnl See COPYING for details.
dnl Check do we have jam installed and try to determine version
dnl where is minimal supported 2.3
AC_DEFUN([EDE_PROG_JAM], [
AC_PATH_PROG(JAM, jam)
if test -n "$JAM"; then
AC_MSG_CHECKING([for jam version])
echo "Echo \$(JAMVERSION) ;" > conftest.jam
jam_version_orig=`$JAM -f conftest.jam | head -1`
jam_version=`echo $jam_version_orig | sed -e 's/\.//g'`
rm -f conftest.jam
if test "$jam_version" -ge 23; then
msg="$jam_version_orig (ok)"
AC_MSG_RESULT($msg)
else
msg="jam version $jam_version_orig is too old. Download a newer version from our repository"
AC_MSG_ERROR($msg)
fi
else
AC_MSG_ERROR(Jam is missing! You can download it from our repository)
fi
])

18
m4/libmagic.m4 Normal file
View File

@@ -0,0 +1,18 @@
dnl
dnl $Id$
dnl
dnl Part of Equinox Desktop Environment (EDE).
dnl Copyright (c) 2000-2007 EDE Authors.
dnl
dnl This program is licenced under terms of the
dnl GNU General Public Licence version 2 or newer.
dnl See COPYING for details.
dnl Check for presence of libmagic, since is used for mime types
dnl Note that libmagic requires libz to be linked against in this test
AC_DEFUN([EDE_CHECK_LIBMAGIC], [
AC_CHECK_HEADER(magic.h, [
AC_CHECK_LIB(magic, magic_open, AC_DEFINE(HAVE_LIBMAGIC, 1, [Define to 1 if you have libmagic library]),,
-lz)
])
])

59
m4/sound.m4 Normal file
View File

@@ -0,0 +1,59 @@
dnl
dnl $Id$
dnl
dnl Part of Equinox Desktop Environment (EDE).
dnl Copyright (c) 2000-2007 EDE Authors.
dnl
dnl This program is licenced under terms of the
dnl GNU General Public Licence version 2 or newer.
dnl See COPYING for details.
dnl Enable sound param and check for facility
dnl For now only .ogg via libao
AC_DEFUN([EDE_SOUND], [
AC_ARG_ENABLE(sounds, [ --enable-sounds enable sounds (default=yes)],, enable_sounds=yes)
if eval "test $enable_sounds = yes"; then
AC_CHECK_HEADER(ao/ao.h, [have_ao_h=yes], [have_ao_h=no])
AC_CHECK_LIB(ao, ao_is_big_endian, [have_ao_lib=yes], [have_ao_lib=no])
AC_CHECK_HEADER(vorbis/codec.h, [have_codec_h=yes], [have_codec_h=no])
AC_CHECK_LIB(vorbis, vorbis_info_init, [have_vorbis_lib=yes], [have_vorbis_lib=no])
AC_CHECK_HEADER(vorbis/vorbisfile.h, [have_vorbisfile_h=yes], [have_vorbisfile_h=no])
AC_CHECK_LIB(vorbisfile, ov_clear, [have_vorbisfile_lib=yes], [have_vorbisfile_lib=no])
AC_MSG_CHECKING(sound support)
if eval "test $have_ao_h = yes" && \
eval "test $have_codec_h = yes" && \
eval "test $have_vorbisfile_h = yes"; then
AC_MSG_RESULT(ok)
SOUNDFLAGS="-DSOUND"
SOUNDLIBS="-lao -lvorbis -lvorbisfile"
else
AC_MSG_RESULT(disabled)
fi
fi
])
dnl Check if we have alsa installed since evolume rely on it
dnl Here are two parameters that are set:
dnl - HAVE_ALSA used in edeconf.h
dnl - MAKE_EVOLUME used by jam
AC_DEFUN([EDE_CHECK_ALSA], [
AC_CHECK_HEADER(linux/soundcard.h, AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if you have alsa libraries]))
if eval "test $ac_cv_header_linux_soundcard_h = yes"; then
MAKE_EVOLUME="1"
else
echo
echo "***************************************"
echo "* ALSA WAS NOT FOUND *"
echo "* *"
echo "* Sadly, evolume is ALSA-only at this *"
echo "* moment. It will be disabled. *"
echo "***************************************"
MAKE_EVOLUME="0"
fi
])

25
m4/time.m4 Normal file
View File

@@ -0,0 +1,25 @@
dnl
dnl $Id$
dnl
dnl Part of Equinox Desktop Environment (EDE).
dnl Copyright (c) 2000-2007 EDE Authors.
dnl
dnl This program is licenced under terms of the
dnl GNU General Public Licence version 2 or newer.
dnl See COPYING for details.
dnl Check for time functions since they are
dnl different between systems
AC_DEFUN([EDE_CHECK_TIME_FUNCS], [
dnl glibc extension, not present on BSD's
AC_CHECK_HEADER(time.h, [
AC_CHECK_FUNCS(stime, AC_DEFINE(HAVE_STIME, 1, [Define to 1 if you have stime() in time.h]))
])
dnl rest should have this
AC_CHECK_HEADER(sys/time.h, [
AC_CHECK_FUNCS(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Define to 1 if you have gettimeofday() in sys/time.h]))
AC_CHECK_FUNCS(settimeofday, AC_DEFINE(HAVE_SETTIMEOFDAY, 1, [Define to 1 if you have settimeofday() in sys/time.h]))
])
])

30
m4/various.m4 Normal file
View File

@@ -0,0 +1,30 @@
dnl
dnl $Id$
dnl
dnl Part of Equinox Desktop Environment (EDE).
dnl Copyright (c) 2000-2007 EDE Authors.
dnl
dnl This program is licenced under terms of the
dnl GNU General Public Licence version 2 or newer.
dnl See COPYING for details.
dnl --enable-debug and --enable-profile options
AC_DEFUN([EDE_DEVELOPMENT], [
dnl clear all optimization flags
OPTIMFLAGS=""
AC_ARG_ENABLE(debug, [ --enable-debug enable debug (default=no)],,enable_debug=no)
if eval "test $enable_debug = yes"; then
DEBUGFLAGS="$DEBUGFLAGS -g3"
fi
AC_ARG_ENABLE(profile, [ --enable-profile enable profile (default=no)],,enable_profile=no)
if eval "test $enable_profile = yes"; then
DEBUGFLAGS="$DEBUGFLAGS -pg"
fi
AC_ARG_ENABLE(pedantic, [ --enable-pedantic enable pedantic (default=no)],,enable_pedantic=no)
if eval "test $enable_pedantic = yes"; then
DEBUGFLAGS="$DEBUGFLAGS -pedantic"
fi
])

30
m4/xlib.m4 Normal file
View File

@@ -0,0 +1,30 @@
dnl
dnl $Id$
dnl
dnl Part of Equinox Desktop Environment (EDE).
dnl Copyright (c) 2000-2007 EDE Authors.
dnl
dnl This program is licenced under terms of the
dnl GNU General Public Licence version 2 or newer.
dnl See COPYING for details.
AC_DEFUN([EDE_CHECK_X11], [
dnl generic X11 checkers
AC_PATH_X
AC_PATH_XTRA
if eval "test $ac_x_libraries = no" || eval "test $ac_x_includes = no"; then
AC_MSG_ERROR([X11 libraries are not found! Please install them first])
fi
])
AC_DEFUN([EDE_X11_SHAPE], [
AC_ARG_ENABLE(shape, [ --enable-shape enable XShape extension (default=yes)],,enable_shape=yes)
dnl $X_LIBS contains path to X11 libs, since are not in path by default
if eval "test $enable_shape = yes"; then
AC_CHECK_HEADER(X11/extensions/shape.h, [
AC_CHECK_LIB(Xext, XShapeInputSelected,
AC_DEFINE(HAVE_SHAPE, 1, [Define to 1 if you have XShape extension]),,$X_LIBS)
])
fi
])