1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#AC_PREREQ(2.59)
AC_INIT([Agave],
[0.4.1],
[https://gna.org/bugs/?group=colorscheme],
[agave])
AC_CONFIG_SRCDIR([src/main.cc])
AM_INIT_AUTOMAKE
dnl Custom macro that checks if the git binary exists, and if it does, it tries
dnl to check the git repository version of the working copy and uses that in
dnl the application's 'About' window
GIT_REPOSITORY_REVISION()
PACKAGE_WEBSITE=[http://home.gna.org/colorscheme/]
AC_DEFINE_UNQUOTED([PACKAGE_WEBSITE], ["$PACKAGE_WEBSITE"],
[The website of Agave])
AC_SUBST([PACKAGE_WEBSITE])
AC_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
dnl Set Language to C++ and make sure proper tools exist
AC_LANG(C++)
AC_PROG_CXX
AC_PROG_RANLIB
AC_CHECK_PROGS(SED, sed)
dnl i18n
AC_PROG_INTLTOOL([0.35.0])
GETTEXT_PACKAGE=agave
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
[The domain name to use with gettext])
AM_GLIB_GNU_GETTEXT
PKG_CHECK_MODULES(GTKMM, [
gtkmm-2.4 >= 2.8.0
])
dnl Check to see if the version of gtkmm is recent enough to support the new
dnl printing support
PKG_CHECK_MODULES(PRINTING, [gtkmm-2.4 >= 2.10.0], have_gtk_printing=yes,
have_gtk_printing=no)
if test "x$have_gtk_printing" = "xyes"; then
AC_DEFINE([HAVE_GTK_PRINTING], 1, [using at least gtkmm version 2.10.0])
else
AC_MSG_RESULT(no)
fi
dnl Determine whether to compile with support for GNOME libraries (i.e.
dnl libgnome and libgnomeui)
AC_ARG_ENABLE(gnome, [AC_HELP_STRING([--enable-gnome],
[build with libgnome support [default=yes]])],,
[enable_gnome=yes])
if test "x$enable_gnome" = "xyes"; then
PKG_CHECK_MODULES([GNOME], [libgnomeui-2.0])
AC_DEFINE([HAVE_GNOME], [1], [Compile with libgnome support])
fi
dnl Determine whether to compile with support for GConfmm
AC_ARG_ENABLE(gconf, [AC_HELP_STRING([--enable-gconf],
[build with gconfmm support [default=yes]])],,
[enable_gconf=yes])
if test "x$enable_gconf" = "xyes"; then
PKG_CHECK_MODULES([GCONFMM], [gconfmm-2.6])
AC_DEFINE([HAVE_GCONFMM], [1], [Compile with gconfmm support])
fi
dnl Determine whether to compile with debug settings. Essentially this just
dnl disables compiler optimizations for now
AC_ARG_ENABLE(debug-mode, [AC_HELP_STRING([--enable-debug-mode],
[build with debug settings (no optimization, test coverage)])],,
[enable_debug_mode=no])
AC_MSG_CHECKING(whether to compile with debug settings)
if test "x$enable_debug_mode" = "xyes"; then
AC_MSG_RESULT(yes)
dnl remove optimization settings from CFLAGS
CXXFLAGS=[`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`]
CFLAGS=[`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`]
else
AC_MSG_RESULT(no)
fi
dnl always compile with Wall
CXXFLAGS="$CXXFLAGS -Wall"
dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
AC_ARG_ENABLE(more-warnings,
[AC_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings])],
set_more_warnings="$enableval",[set_more_warnings=no])
AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GXX" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CXXFLAGS="-Wextra -Weffc++ -Wctor-dtor-privacy -Woverloaded-virtual -Wchar-subscripts -Wpointer-arith \
-Wcast-align -Wsign-compare -Werror \
$CXXFLAGS"
for option in -Wno-strict-aliasing -Wno-sign-compare; do
SAVE_CFLAGS="$CXXFLAGS"
CFLAGS="$CXXFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
if test $has_option = no; then
CXXFLAGS="$SAVE_CFLAGS"
fi
AC_MSG_RESULT($has_option)
unset has_option
unset SAVE_CFLAGS
done
unset option
else
AC_MSG_RESULT(no)
fi
dnl Get the cppunit path for doing unit tests
AC_ARG_ENABLE(cppunit, [AC_HELP_STRING([--enable-cppunit],
[build unit tests [default = yes]])],,
[enable_cppunit=yes], [enable_cppunit=no])
AM_CONDITIONAL(HAVE_CPPUNIT, test "x$enable_cppunit" = "xyes")
if test -n HAVE_CPPUNIT; then
AM_PATH_CPPUNIT(1.10.0)
fi
dnl test for boost::shared_ptr
AC_CHECK_HEADER([boost/shared_ptr.hpp], ,AC_MSG_ERROR(dnl
[Boost header shared_ptr.hpp not found]))
dnl Consolidate all libraries and flags into one variable
AGAVE_LIBS="$GTKMM_LIBS $GCONFMM_LIBS $GNOME_LIBS"
AGAVE_CFLAGS="$GTKMM_CFLAGS $GCONFMM_CFLAGS $GNOME_CFLAGS"
AC_SUBST(AGAVE_LIBS)
AC_SUBST(AGAVE_CFLAGS)
dnl Define directory locations for use in the program
AGAVE_LOCALEDIR=[${datadir}/locale]
AGAVE_COMMONDIR=[${datadir}/agave]
AGAVE_ICONDIR=[${AGAVE_COMMONDIR}/pixmaps]
AGAVE_UIDIR=[${AGAVE_COMMONDIR}/ui]
AGAVE_PALETTEDIR=[${AGAVE_COMMONDIR}/palettes]
dnl pass the variables to automake
AC_SUBST([AGAVE_LOCALEDIR])
AC_SUBST([AGAVE_ICONDIR])
AC_SUBST([AGAVE_UIDIR])
AC_SUBST([AGAVE_PALETTEDIR])
AC_CONFIG_FILES([Makefile
po/Makefile.in
src/Makefile
src/core/Makefile
src/paletteparser/Makefile
src/widgets/Makefile
src/dialogs/Makefile
pixmaps/Makefile
data/Makefile
data/agave.desktop.in
data/ui/Makefile
data/palettes/Makefile
tests/Makefile
tests/core/Makefile
tests/paletteparser/Makefile
tests/widgets/Makefile
])
AC_OUTPUT()
dnl ==================================================
echo ""
echo "======================================================================"
echo ""
echo "$PACKAGE_NAME configuration:"
echo " C compiler : $CC"
echo " C++ compiler : $CXX"
echo " Prefix : $prefix"
echo ""
echo "$PACKAGE_NAME will be compiled with the following features:"
echo " Gconfmm support : $enable_gconf"
echo " GNOME library support : $enable_gnome"
echo " Printing support : $have_gtk_printing"
echo ""
echo "The following options will be passed to the compiler:"
echo " CFLAGS: $CFLAGS"
echo " CXXFLAGS: $CXXFLAGS"
echo ""
echo " AGAVE_CFLAGS: $AGAVE_CFLAGS"
echo ""
echo " AGAVE_LIBS: $AGAVE_LIBS"
echo ""
echo "======================================================================"
echo ""
|