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
|
AC_INIT([bibledit],[5.1.023],[http://bibledit.org])
AM_INIT_AUTOMAKE([tar-ustar subdir-objects])
AC_CANONICAL_BUILD
ac_default_prefix=/usr
AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX(17,[noext],[mandatory])
AC_PROG_RANLIB
AC_CONFIG_HEADERS([config.h])
AC_PATH_PROG(GZIP_PATH, gzip, no)
if test x$GZIP_PATH = xno; then
AC_MSG_ERROR(Program "gzip" is needed. Install this first.)
fi
AC_PATH_PROG(GUNZIP_PATH, gunzip, no)
if test x$GUNZIP_PATH = xno; then
AC_MSG_ERROR(Program "gunzip" is needed. Install this first.)
fi
AC_PATH_PROG(FIND_TAR, tar, no)
if test x$FIND_TAR = xno; then
AC_MSG_ERROR(Program "tar" is needed. Install this first.)
fi
AC_PATH_PROG(ZIP_PATH, zip, no)
if test x$ZIP_PATH = xno; then
AC_MSG_ERROR(Program "zip" is needed. Install this first.)
fi
AC_PATH_PROG(UNZIP_PATH, unzip, no)
if test x$UNZIP_PATH = xno; then
AC_MSG_ERROR(Program "unzip" is needed. Install this first.)
fi
AC_PATH_PROG(INSTALLMGR_PATH, installmgr, no)
AC_PATH_PROG(DIATHEKE_PATH, diatheke, no)
PKG_PROG_PKG_CONFIG
# https://lintian.debian.org/tags/autotools-pkg-config-macro-not-cross-compilation-safe.html
if test x$PKG_CONFIG = x; then
AC_MSG_ERROR(Program "pkg-config" is needed. Install this first.)
fi
PKG_CHECK_MODULES(XML2, libxml-2.0 >= 2.9.0,,AC_MSG_ERROR(GNOME XML2 library development version >= 2.9.0 is needed.))
AC_SUBST(XML2_CFLAGS)
AC_SUBST(XML2_LIBS)
PKG_CHECK_MODULES(GTK, gtk+-3.0,,AC_MSG_ERROR(Gtk3 development version is needed.))
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
PKG_CHECK_MODULES([WEBKIT2GTK], [webkit2gtk-4.1],, [
PKG_CHECK_MODULES([WEBKIT2GTK], [webkit2gtk-4.0],, [
PKG_CHECK_MODULES([WEBKIT2GTK], [webkit2gtk-3.0],,AC_MSG_ERROR(Webkit2Gtk development version is needed.))
])
])
AC_SUBST(WEBKIT2GTK_LIBS)
AC_SUBST(WEBKIT2GTK_CFLAGS)
AC_CHECK_LIB([mbedtls], [mbedtls_ssl_init])
AM_CONDITIONAL([HAVE_LIBMBEDTLS], [test "$ac_cv_lib_mbedtls_ssl_init" = yes])
# Tag1 (leave in place)
# Tag2 (leave in place)
# Tag3 (leave in place)
# Tag4 (leave in place)
# Tag5 (leave in place)
# Tag6 (leave in place)
# Tag7 (leave in place)
AC_DEFINE([HAVE_LINUX], [1], [Enable installation on Linux])
# Tag9 (leave in place)
# TagA (leave in place)
# TagB (leave in place)
# TagC (leave in place)
# TagD (leave in place)
# TagE (leave in place)
# TagF (leave in place)
# TagG (leave in place)
AC_CHECK_HEADER(pthread.h,AC_DEFINE([HAVE_PTHREAD],[1],[Define whether pthread.h is present]),)
AC_CHECK_HEADER(libproc.h,AC_DEFINE([HAVE_LIBPROC],[1],[Define whether libproc.h is present]),)
AC_CHECK_HEADER(execinfo.h,AC_DEFINE([HAVE_EXECINFO],[1],[Define whether execinfo.h is present]),)
AC_CHECK_HEADER(sys/sysctl.h,AC_DEFINE([HAVE_SYS_SYSCTL],[1],[Define whether sys/sysctl.h is present]),)
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/bibledit", [Package data directory])
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/bibledit", [Package data directory])
fi
AC_DEFINE_UNQUOTED(PACKAGE_PREFIX_DIR, "${prefix}", [Package prefix directory])
# Check ICU Unicode library whether available.
PKG_CHECK_MODULES(ICU, icu-i18n >= 60.0, AC_DEFINE(HAVE_ICU, 1, Define whether ICU is available), AC_MSG_NOTICE(libicui18n development version >= 60.0 is needed for the Cloud.))
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_LIBS)
# Check UTF8 proc library whether available.
PKG_CHECK_MODULES(UTF8PROC, libutf8proc >= 2.3.0, AC_DEFINE(HAVE_UTF8PROC, 1, Define whether utf8proc is available), AC_MSG_NOTICE(libutf8proc development version >= 2.3.0 is beneficial to have.))
AC_SUBST(UTF8PROC_CFLAGS)
AC_SUBST(UTF8PROC_LIBS)
# Check the gumbo library whether available.
# Check the tidy library whether available.
# Check the pugixml library whether available.
PKG_CHECK_MODULES(PUGIXML, pugixml >= 1.10, AC_DEFINE(HAVE_PUGIXML, 1, Define whether pugixml is available), AC_MSG_NOTICE(pugixml development version >= 1.10 is beneficial to have.))
AC_SUBST(PUGIXML_CFLAGS)
AC_SUBST(PUGIXML_LIBS)
# Check whether the GTest library is available.
PKG_CHECK_MODULES(GTEST, gtest >= 1.10.0, AC_DEFINE(HAVE_GTEST, 1, Define whether GTest is available), AC_MSG_NOTICE(Install gtest to also build the unit tests.))
AC_SUBST(GTEST_CFLAGS)
AC_SUBST(GTEST_LIBS)
AC_MSG_CHECKING([C++ compiler])
GPPVERSION=`${CXX} --version | grep clang`
if test "$GPPVERSION" = ""; then
AC_MSG_RESULT([GCC])
else
AC_MSG_RESULT([clang])
fi
AM_CONDITIONAL([COMPILERGCC],[test "$GPPVERSION" = ""])
AM_CONDITIONAL([COMPILERCLANG],[test "$GPPVERSION" != ""])
# Windows.
ENABLEWINDOWS=no
AC_ARG_ENABLE(windows,
[ --enable-windows Compile for Windows],
[
AC_DEFINE([WIN32], [1], [Define whether to compile on Windows])
AC_DEFINE([HAVE_WINDOWS], [1], [Define whether to compile on Windows])
ENABLEWINDOWS=yes
]
)
# Android.
ENABLEANDROID=no
AC_ARG_ENABLE(android,
[ --enable-android Compile for Android],
[
AC_DEFINE([HAVE_ANDROID], [1], [Define whether to compile for Android])
ENABLEANDROID=yes
]
)
# macOS.
ENABLEMAC=no
AC_ARG_ENABLE(mac,
[ --enable-mac Compile for Mac],
[
AC_DEFINE([HAVE_MACOS], [1], [Define whether to compile for macOS])
ENABLEMAC=yes
]
)
AM_CONDITIONAL([MACFLAGS],[test $ENABLEMAC = yes])
# Linux.
ENABLELINUX=yes
AC_ARG_ENABLE(linux,
[ --enable-linux Compile for Linux],
[
AC_DEFINE([HAVE_LINUX], [1], [Define whether to compile for Linux])
ENABLELINUX=yes
]
)
# iOS.
ENABLEIOS=no
AC_ARG_ENABLE(ios,
[ --enable-ios Compile for iOS],
[
AC_DEFINE([HAVE_IOS], [1], [Define whether to compile for iOS])
ENABLEIOS=yes
]
)
# Whether to enable compiler warnings.
ENABLEWARNINGS=no
AC_ARG_ENABLE(warnings,
[ --enable-warnings Enable compiler warnings],[ENABLEWARNINGS=yes])
AM_CONDITIONAL([COMPILERWARNINGS],[test $ENABLEWARNINGS = yes])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo "
Bibledit $VERSION configuration summary:
Installation prefix : ${prefix}
Windows (--enable-windows) : ${ENABLEWINDOWS}
Android (--enable-android) : ${ENABLEANDROID}
macOS (--enable-mac) : ${ENABLEMAC}
Linux (--enable-linux) : ${ENABLELINUX}
iOS (--enable-ios) : ${ENABLEIOS}
Enable GCC warnings (--enable-warnings) : ${ENABLEWARNINGS}
"
|