glade/configure.in
2001-06-25 07:07:05 +00:00

176 lines
5.6 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/glade-widget.c)
AM_INIT_AUTOMAKE(glade2, 0.0.21)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AM_PROG_XML_I18N_TOOLS
dnl Pick up GNOME macros
AM_ACLOCAL_INCLUDE(macros)
AM_PROG_LIBTOOL
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CHECK_HEADERS(os2.h)
check_program_name="glade2"
dnl ========================================================
dnl Check for gtk-2.0
dnl ========================================================
check_module="gtk+-2.0"
check_version="1.3.5"
dnl ====================
check_version_num=`echo "$check_version" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
AC_MSG_CHECKING(for $check_module library => $check_version)
if pkg-config --modversion $check_module > /dev/null 2>&1; then
vers=`pkg-config --modversion $check_module`
vers_num=`echo "$vers" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test "$vers_num" -ge "$check_version_num"; then
AC_MSG_RESULT(found [$vers])
else
AC_MSG_ERROR(You need at least $check_module version $check_version to compile $check_program_name.)
fi
else
AC_MSG_ERROR(Did not find $check_module installed)
fi
modules="$modules $check_module"
dnl ========================================================
dnl Check for libxml
dnl ========================================================
check_module="libxml-2.0"
check_version="2.3.10"
dnl ====================
check_version_num=`echo "$check_version" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
AC_MSG_CHECKING(for $check_module library => $check_version)
if pkg-config --modversion $check_module > /dev/null 2>&1; then
vers=`pkg-config --modversion $check_module`
vers_num=`echo "$vers" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test "$vers_num" -ge "$check_version_num"; then
AC_MSG_RESULT(found [$vers])
else
AC_MSG_ERROR(You need at least $check_module version $check_version to compile $check_program_name.)
fi
else
AC_MSG_ERROR(Did not find $check_module installed)
fi
modules="$modules $check_module"
dnl ========================================================
dnl Check for libgnomeui
dnl ========================================================
check_module="libgnomeui-2.0"
check_version="1.96.88"
dnl ====================
if false; then
check_version_num=`echo "$check_version" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
AC_MSG_CHECKING(for $check_module library => $check_version)
if pkg-config --modversion $check_module > /dev/null 2>&1; then
vers=`pkg-config --modversion $check_module`
vers_num=`echo "$vers" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test "$vers_num" -ge "$check_version_num"; then
AC_MSG_RESULT(found [$vers])
else
AC_MSG_ERROR(You need at least $check_module version $check_version to compile $check_program_name.)
fi
else
AC_MSG_ERROR(Did not find $check_module installed)
fi
modules="$modules $check_module"
fi
dnl ================================================================
dnl Set GLADE_LIBS and GLADE_CFLAGS
dnl ================================================================
GLADE_LIBS=`pkg-config --libs $modules`
GLADE_CFLAGS=`pkg-config --cflags $modules`
AC_SUBST(GLADE_LIBS)
AC_SUBST(GLADE_CFLAGS)
dnl ================================================================
dnl Gettext stuff.
dnl ================================================================
ALL_LINGUAS="es"
AM_GNU_GETTEXT
dnl Set the location of the locale messages to be used in main.c
dnl This will substitute GLADE_LOCALE_DIR in config.h (from acconfig.h).
if test "x$prefix" = "xNONE"; then
GLADE_LOCALE_DIR=$ac_default_prefix/share/locale
else
GLADE_LOCALE_DIR=$prefix/share/locale
fi
AC_DEFINE_UNQUOTED(GLADE_LOCALE_DIR, "$GLADE_LOCALE_DIR")
dnl ================================================================
dnl GLADE_DATA_DIR - Sets the location of the data directory, where we install
dnl source files added to projects (such as all the Gnome m4 macros).
dnl This will substitute GLADE_DATA_DIR in config.h (from acconfig.h).
dnl ================================================================
if test "x${datadir}" = 'x${prefix}/share'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(GLADE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
else
AC_DEFINE_UNQUOTED(GLADE_DATA_DIR, "${prefix}/share/${PACKAGE}")
fi
else
AC_DEFINE_UNQUOTED(GLADE_DATA_DIR, "${datadir}/${PACKAGE}")
fi
dnl ================================================================
dnl PIXMAPS
dnl ================================================================
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps")
pixmapsdir="${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps"
AC_DEFINE_UNQUOTED(WIDGETS_DIR, "${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/widgets")
widgetsdir="${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/widgets"
else
AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps")
pixmapsdir="${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps"
AC_DEFINE_UNQUOTED(WIDGETS_DIR, "${prefix}/${DATADIRNAME}/${PACKAGE}/widgets")
widgetsdir="${prefix}/${DATADIRNAME}/${PACKAGE}/widgets"
fi
AC_SUBST(pixmapsdir)
AC_SUBST(widgetsdir)
AC_OUTPUT([
Makefile
src/Makefile
macros/Makefile
intl/Makefile
pixmaps/Makefile
widgets/Makefile
po/Makefile.in
])
echo "
Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
"