diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac index f672553..d9dd7e0 100644 --- a/configure.ac +++ b/configure.ac @@ -2,14 +2,10 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([SciTECO], [2.0.0], +AC_INIT([SciTECO], [2.1.0], [robin.haberkorn@googlemail.com], [sciteco], - [http://sciteco.sf.net/]) -PACKAGE_URL_DEV=https://github.com/rhaberkorn/sciteco -AC_SUBST(PACKAGE_URL_DEV) -AC_DEFINE_UNQUOTED(PACKAGE_URL_DEV, ["$PACKAGE_URL_DEV"], - [Package development homepage.]) + [https://github.com/rhaberkorn/sciteco]) AC_CONFIG_MACRO_DIR(m4) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE @@ -23,13 +19,19 @@ AC_CANONICAL_HOST AX_CHECK_ENABLE_DEBUG AM_CONDITIONAL(DEBUG, [test x$ax_enable_debug != xno]) +if [[ x$ax_enable_debug = xno ]]; then + # glib does not look at NDEBUG + AC_DEFINE(G_DISABLE_ASSERT, 1, [Disable g_assert()]) +fi # Use the user provided CXXFLAGS for Scintilla as well. # This makes sure that the same optimizations are applied # to SciTECO and Scintilla. # We cannot pass CXXFLAGS directly to Scintilla since # we modify it during library checking. -SCINTILLA_CXXFLAGS="$CXXFLAGS" +# Additionally, we can disable unused Scintilla features. +# See https://scintilla.org/ScintillaDoc.html#BuildingScintilla +SCINTILLA_CXXFLAGS="$CXXFLAGS -DNO_CXX11_REGEX -DSCI_DISABLE_PROVISIONAL" AC_SUBST(SCINTILLA_CXXFLAGS) # Automake build flag substitutions. @@ -45,7 +47,12 @@ canonicalize() { } # Checks for programs. -LT_INIT +# +# Disable shared libraries by default (--disable-shared). +# We don't install any library, so this __should__ not matter. +# In reality Libtool builds unnecessary wrapper binaries on win32 (MinGW) without this. +# These wrapper binaries do not handle UTF-8 properly and break the test suite. +LT_INIT([disable-shared]) # FIXME: Check for -std=gnu11? AC_PROG_CC AC_PROG_SED @@ -125,19 +132,20 @@ PKG_CHECK_MODULES(LIBGLIB, [glib-2.0 >= 2.44], [ LIBS="$LIBS $LIBGLIB_LIBS" ]) -# Required by Scintilla. -AX_PTHREAD([], [ - AC_MSG_ERROR([pthread not found!]) -]) -SCINTILLA_CXXFLAGS="$SCINTILLA_CXXFLAGS $PTHREAD_CFLAGS" -LIBS="$LIBS $PTHREAD_LIBS" - case $host in *-mingw*) AC_CHECK_HEADERS([windows.h], , [ AC_MSG_ERROR([Missing Windows headers!]) ]) ;; +*) + # Required by Scintilla. + AX_PTHREAD([], [ + AC_MSG_ERROR([pthread not found!]) + ]) + SCINTILLA_CXXFLAGS="$SCINTILLA_CXXFLAGS $PTHREAD_CFLAGS" + LIBS="$LIBS $PTHREAD_LIBS" + ;; esac # Checks for typedefs, structures, and compiler characteristics. @@ -190,8 +198,8 @@ AM_CPPFLAGS="$AM_CPPFLAGS -D'SCITECODATADIR=\"\$(scitecodatadir)\"' \ # Scintilla (some platforms ship with it). AC_ARG_WITH(scintilla, AS_HELP_STRING([--with-scintilla=PATH], - [Specify Scintilla's path [default=./contrib/scintilla]]), - [SCINTILLA_PATH=$withval], [SCINTILLA_PATH=./contrib/scintilla]) + [Specify Scintilla's path [default=SRCDIR/contrib/scintilla]]), + [SCINTILLA_PATH=$withval], [SCINTILLA_PATH=$srcdir/contrib/scintilla]) SCINTILLA_PATH=`canonicalize $SCINTILLA_PATH` AC_SUBST(SCINTILLA_PATH) @@ -199,15 +207,15 @@ CPPFLAGS="$CPPFLAGS -I$SCINTILLA_PATH/include" AC_ARG_WITH(scinterm, AS_HELP_STRING([--with-scinterm=PATH], - [Specify Scinterm's path [default=./contrib/scinterm]]), - [SCINTERM_PATH=$withval], [SCINTERM_PATH=./contrib/scinterm]) + [Specify Scinterm's path [default=SRCDIR/contrib/scinterm]]), + [SCINTERM_PATH=$withval], [SCINTERM_PATH=$srcdir/contrib/scinterm]) SCINTERM_PATH=`canonicalize $SCINTERM_PATH` AC_SUBST(SCINTERM_PATH) AC_ARG_WITH(lexilla, AS_HELP_STRING([--with-lexilla=PATH], - [Specify Lexilla's path [default=./contrib/lexilla]]), - [LEXILLA_PATH=$withval], [LEXILLA_PATH=./contrib/lexilla]) + [Specify Lexilla's path [default=SRCDIR/contrib/lexilla]]), + [LEXILLA_PATH=$withval], [LEXILLA_PATH=$srcdir/contrib/lexilla]) AM_CONDITIONAL(LEXILLA, [test x$LEXILLA_PATH != xno]) if [[ x$LEXILLA_PATH != xno ]]; then LEXILLA_PATH=`canonicalize $LEXILLA_PATH` @@ -225,11 +233,16 @@ case $INTERFACE in *curses*) case $INTERFACE in ncurses | netbsd-curses) - PKG_CHECK_MODULES(NCURSES, [ncurses], [ + # The widechar version of ncurses is necessary for Unicode + # support even when not using widechar APIs. + PKG_CHECK_MODULES(NCURSES, [ncursesw], [ CFLAGS="$CFLAGS $NCURSES_CFLAGS" CXXFLAGS="$CXXFLAGS $NCURSES_CFLAGS" LIBS="$LIBS $NCURSES_LIBS" ], [ + # This should be sufficient to detect non-widechar + # ncurses versions as well, although we could also check + # for an "ncurses" package. AC_CHECK_LIB(ncurses, initscr, , [ AC_MSG_ERROR([libncurses missing!]) ]) |