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 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
AC_COPYRIGHT([Copyright (c) 2008-14 Andrei Zavada <johnhommer@gmail.com>])
AC_INIT([Aghermann], [1.0.2], [johnhommer@gmail.com])
AC_CONFIG_SRCDIR([src/aghermann/main.cc])
AC_CONFIG_MACRO_DIR([m4])
AC_PREREQ(2.61)
AM_INIT_AUTOMAKE([-Wno-portability silent-rules subdir-objects])
dnl AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
AC_PROG_LD()
AM_DISABLE_STATIC()
LT_INIT()
AC_PROG_CXX([$CXX])
AC_LANG([C++])
AC_OPENMP()
dnl AC_CHECK_FUNCS(mremap,,)
dnl Check for c++11 features
AC_DEFUN([AC_CXX_STDCPP11_FEATURES],
[AC_CACHE_CHECK(whether $CXX has all required c++11 features,
ac_cv_cxx_cpp11_features,
[AC_LANG([C++])
old_CXX=$CXX
CXX="$CXX -std=c++0x"
AC_TRY_RUN([
#include <vector>
#include <algorithm>
using namespace std;
enum class fafa : int { ke, pi };
class C { C(int) {} C(int x, int) : C(x) {} };
int main (int , char **)
{
void* p = nullptr;
vector<vector<int>> v {{1, 2}};
for ( auto& i : v )
;
unsigned c = count_if( v.begin(), v.end(), [&] (vector<int> &i) { return i == vector<int> ({2,3}); });
return 0;
}
],
ac_cv_cxx_cpp11_features=yes, ac_cv_cxx_cpp11_features=no,
ac_cv_cxx_cpp11_features=yes)
CXX=$old_CXX
])
])
AC_CXX_STDCPP11_FEATURES()
test $ac_cv_cxx_cpp11_features = no && \
AC_MSG_ERROR([g++ >= 4.7 is required to build $PACKAGE as we must use -std=c++11 features your compiler doesn't seem to support], 1)
cxx_version=`$CXX --version | head -n1`
dnl AC_CXX_HAVE_STL # redundant: we check for STL implicitly in AC_CXX_STDCPP0X_FEATURES
dnl Check for prerequisite lib dependencies
PKG_CHECK_MODULES([LIBCONFIGXX], [libconfig++])
PKG_CHECK_MODULES([SAMPLERATE], [samplerate >= 0.1.7])
PKG_CHECK_MODULES([GSL], [gsl])
PKG_CHECK_MODULES([FFTW3], [fftw3])
PKG_CHECK_MODULES([ITPP], [itpp])
PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.4 glib-2.0 gthread-2.0 gio-unix-2.0 gmodule-export-2.0])
PKG_CHECK_MODULES([CAIRO], [cairo >= 1.8.10])
PKG_CHECK_MODULES([UNIQUE], [unique-3.0])
PKG_CHECK_MODULES([VTE], [vte-2.90])
AC_CHECK_LIB(
fftw3_omp, fftw_init_threads,
[AC_DEFINE([HAVE_LIBFFTW3_OMP], [], [we have fftw3 omp-enabled])
AC_SUBST(fftw3_ldadd, ["-lfftw3_omp -lpthread"])
LIBFFTW3_LDADD="-lfftw3_omp -lpthread"
omp_enabled_fftw3=yes
],
[AC_SUBST(fftw3_ldadd, [""])
LIBFFTW3_LDADD=""
omp_enabled_fftw3=no
],
[-lpthread -lfftw3_omp -lfftw3])
AC_SUBST(LIBFFTW3_LDADD, $LIBFFTW3_LDADD)
dnl lua!
AX_PROG_LUA([5.1])
AX_LUA_LIBS
AX_LUA_HEADERS
dnl this is needed to compile all our glade files into a nice gresource
AC_PATH_PROGS([glib_compile_resources], [glib-compile-resources], [:])
test x$glib_compile_resources = x":" && \
AC_MSG_ERROR([Huh. Isn't glib-compile-resources not part of glib?])
dnl
dnl Own package options
dnl
dnl 1. Main floating-point type
AC_ARG_WITH(
[fp-type],
[AS_HELP_STRING( [--with-fp-type=float|double], [use this as main floating-point type (default = float)])],
[case "$with_fp_type" in
float)
;;
double)
;;
*) AC_MSG_ERROR( [--with-fp-type accepts only `float' or `double' as argument],)
esac
AC_DEFINE_UNQUOTED( [TFloat], [$with_fp_type], [Main floating-point type])
main_fp_type=$with_fp_type
],
[main_fp_type=float
AC_DEFINE( [TFloat], [float], [Main floating-point type])])
dnl 2. Whether to build local documentation
AC_ARG_ENABLE(
[docs],
[AS_HELP_STRING( [--enable-docs], [build html docs from emacs org files (default = no)])],
[AS_IF([test "x$enableval" = xyes],
[AC_CACHE_CHECK([for org-mode-enabled emacs], [ac_cv_path_ORGMODE_EMACS],
[AC_PATH_PROGS_FEATURE_CHECK(
[ORGMODE_EMACS],
[emacs],
[[$ac_path_ORGMODE_EMACS --batch -Q -l org && \
ac_cv_path_ORGMODE_EMACS=$ac_path_ORGMODE_EMACS \
build_html_docs=yes \
ac_path_ORGMODE_EMACS_found=:]])])
],
[build_html_docs=no])
],
[build_html_docs=no])
dnl 3. Whether to precompile headers
AC_ARG_ENABLE(
[pch],
[AS_HELP_STRING( [--enable-pch], [precompile headers (default = no)])],
[do_pch=$enable_pch],
[do_pch=no])
dnl defaulting to no to enable make dist-check
AM_CONDITIONAL(DO_PCH, test x$do_pch = xyes)
AC_SUBST([ORGMODE_EMACS], [$ac_cv_path_ORGMODE_EMACS])
AM_CONDITIONAL(DO_EMACS_ORGMODE_CONV, test x$ac_cv_path_ORGMODE_EMACS != x)
dnl 3. Desktop and menu integration
dnl (usually nicely handled by distro-specific package builder tools (debuild))
AC_ARG_WITH(xdgdatadir,
AC_HELP_STRING([--with-xdgdatadir=path],
[Change where the theme icons and mime registrations are installed]),
[opt_xdgdatadir=$withval])
if test x$opt_xdgdatadir = x; then
XDGDATADIR=${datadir}
else
XDGDATADIR="$opt_xdgdatadir"
fi
AC_SUBST(XDGDATADIR)
AC_ARG_ENABLE(update-desktop-database,
AC_HELP_STRING([--disable-update-desktop-database],
[do not update desktop database after installation]),,
enable_update_desktop_database=no)
AM_CONDITIONAL(DO_UPDATE_DESKTOP_DB, test x$enable_update_desktop_database = xyes)
if test x$enable_update_desktop_database = xyes ; then
AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
if test $UPDATE_DESKTOP_DATABASE = no; then
AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed
and in your PATH, or configure with --disable-update-desktop-database])
fi
fi
AC_ARG_ENABLE(update-mime-database,
AC_HELP_STRING([--disable-update-mime-database],
[do not update mime database after installation]),,
enable_update_mime_database=no)
AM_CONDITIONAL(DO_UPDATE_MIME_DB, test x$enable_update_mime_database = xyes)
if test x$enable_update_mime_database = xyes ; then
AC_PATH_PROG(UPDATE_MIME_DATABASE, [update-mime-database], no)
if test $UPDATE_MIME_DATABASE = no; then
AC_MSG_ERROR([Cannot find update-mime-database, make sure it is installed
and in your PATH, or configure with --disable-update-mime-database])
fi
fi
dnl Any private defines
AC_SUBST(user, [`whoami`@`hostname`])
AC_SUBST(build_date, [`date +"%F"`])
AC_SUBST(build_datetime, [`date`])
AC_OUTPUT([
Makefile
src/Makefile
src/common/Makefile
src/libsigproc/Makefile
src/libsigfile/Makefile
src/libmetrics/Makefile
src/aghermann/Makefile
src/tools/Makefile
data/Makefile
desktop/Makefile
desktop/aghermann.desktop
desktop/edfhed-gtk.desktop
doc/Makefile
doc/org/Makefile
doc/org/aghermann.org
man/aghermann.1
man/edfhed-gtk.1
man/edfhed.1
man/edfcat.1
man/agh-profile-gen.1
])
AC_MSG_RESULT([
** Configuration summary for $PACKAGE $VERSION:
PREFIX: $prefix
CXX: $CXX (${cxx_version})
CXXFLAGS: $CXXFLAGS
LDFLAGS: $LDFLAGS
OPENMP_CXXFLAGS: $OPENMP_CXXFLAGS
main fp type: ${main_fp_type}
fftw3 omp-enabled: ${omp_enabled_fftw3}
precompile headers: $do_pch
build html docs: ${build_html_docs}
])
|