configure.ac
author J. Ali Harlow <ali@juiblex.co.uk>
Sat Jul 16 11:07:18 2016 +0100 (2016-07-16)
changeset 61 31fb35727621
parent 60 772ff096a326
child 64 b19c8e5795eb
permissions -rw-r--r--
Support parallel installations. The idea is that for CAD screener, we want
to be able to install this on the same machine as a standard AVOT setup
(most notably for John's laptop). To allow for the possibility of a second
application that might have the same requirements, we add the concept of
vendor-specific distributions. Thus we can have one distribution for CAD
screener and one for The Next Big Thing. It doesn't seem trivial to have
both CAD screener and AVOT under the same vendor tag so we'll have to have
AVOT under "City Occupational" and CAD screener under "City Occupational Ltd"
or some such kludge.

Most of this is done although we are very short of test cases (in particular
we don't test that it's actually possible to install CAD screener in parallel
with AVOT or to update either of them once installed, which is fundamental).

We also have a lot of baggage left over, including an intercept of razor_set.
The problem that this was introduced to debug has been fixed but it looks
like there are a number of memory leaks which it might be useful to help
track down so it has been left in place for now.

There is still a lot of confusion in plover between path-based and URI-based
API. We should review the API, decide what we want and have a general clear up.

There is also confusion as to the purpose of RAZOR_ROOT (and meaning; path or
URI). This is not used at all in librazor (although it is used in razor.exe).
Ideally we shouldn't use it in plover or plover-gtk either although again, we
might want to support it or an equivalent in (some of) the various executables.

Work that would still to nice to do for CAD screener:

- uninstall (ideally as an installed program that hooks into Add/Remove programs
but even re-running the installer would be acceptable).
- xz support (smaller packages).
- repomd.xml and xml:base (would be needed for an Internet installer).
- graphical installer.
     1 #                                               -*- Autoconf -*-
     2 # Process this file with autoconf to produce a configure script.
     3 
     4 AC_INIT([plover],[0.5.2.52],[ali@juiblex.co.uk])
     5 AC_PREREQ(2.59)
     6 AC_CONFIG_AUX_DIR([config])
     7 AC_CONFIG_SRCDIR([plover/plover.h])
     8 AC_CONFIG_HEADER([config.h])
     9 AC_CONFIG_MACRO_DIR([m4])
    10 AC_CONFIG_FILES([Makefile
    11 plover/Makefile
    12 plover/plover.pc
    13 plover-gtk/Makefile
    14 plover-gtk/plover-gtk.pc
    15 setup/Makefile
    16 setup/resources.rc
    17 update/Makefile
    18 update/resources.rc
    19 pre-inst/Makefile
    20 pre-inst/resources.rc
    21 app-manager/Makefile
    22 app-manager/resources.rc
    23 plover-open/Makefile
    24 plover-open/resources.rc
    25 tests/Makefile
    26 tests/plover/Makefile
    27 tests/plover-gtk/Makefile
    28 ])
    29 PLOVER_MSWIN_MANIFEST([setup/setup.exe.manifest:setup/manifest.xml.in
    30 update/update.exe.manifest:update/manifest.xml.in
    31 pre-inst/pre-inst.exe.manifest:pre-inst/manifest.xml.in
    32 app-manager/app-manager.exe.manifest:app-manager/manifest.xml.in
    33 plover-open/plover-open.exe.manifest:plover-open/manifest.xml.in
    34 ])
    35 AM_INIT_AUTOMAKE(no-define parallel-tests)
    36 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
    37 case $VERSION in
    38   *.*.*)
    39     AC_SUBST(PLOVER_MAJOR_VERSION,[[`echo $VERSION | sed 's/\..*//'`]])
    40     AC_SUBST(PLOVER_MINOR_VERSION,
    41       [[`echo $VERSION | sed 's/[^.]*\.\([^.]*\)\..*/\1/'`]])
    42     AC_SUBST(PLOVER_MICRO_VERSION,[[`echo $VERSION | sed 's/.*\.\([^.]*\)/\1/'`]])      ;;
    43   *.*)
    44     AC_SUBST(PLOVER_MAJOR_VERSION,[[`echo $VERSION | sed 's/\..*//'`]])
    45     AC_SUBST(PLOVER_MINOR_VERSION,
    46       [[`echo $VERSION | sed 's/[^.]*\.\([^.]*\)/\1/'`]])
    47     AC_SUBST(PLOVER_MICRO_VERSION,0)
    48     ;;
    49   *)
    50     AC_SUBST(PLOVER_MAJOR_VERSION,0)
    51     AC_SUBST(PLOVER_MINOR_VERSION,0)
    52     AC_SUBST(PLOVER_MICRO_VERSION,0)
    53     ;;
    54 esac
    55 AC_CANONICAL_HOST
    56 AC_SUBST(HOST_OS,$host_os)
    57 AC_SUBST(HOST_CPU,$host_cpu)
    58 case $host_os in
    59     mingw*)
    60 	host_mingw="yes"
    61 	;;
    62     *)
    63 	host_mingw=""
    64 	;;
    65 esac
    66 AM_CONDITIONAL(PLOVER_MINGW,[test -n "$host_mingw"])
    67 
    68 # libtool versioning for libplover. For a release one of the following
    69 # must apply:
    70 #
    71 # - If interfaces have been changed or added, but binary compatibility has
    72 #   been preserved, increment CURRENT and AGE and set REVISION to 0.
    73 # - If binary compatibility has been broken (eg removed or changed interfaces),
    74 #   increment CURRENT and set AGE and REVISION to 0.
    75 # - If the interface is the same as the previous version, increment REVISION.
    76 #
    77 lt_current=4
    78 lt_revision=1
    79 lt_age=1
    80 LIBPLOVER_LT_VERSION_INFO="$lt_current:$lt_revision:$lt_age"
    81 AC_SUBST(LIBPLOVER_LT_VERSION_INFO)
    82 
    83 # and likewise for plover-gtk.
    84 #
    85 lt_current=1
    86 lt_revision=1
    87 lt_age=0
    88 PLOVER_GTK_LT_VERSION_INFO="$lt_current:$lt_revision:$lt_age"
    89 AC_SUBST(PLOVER_GTK_LT_VERSION_INFO)
    90 
    91 ##################################################
    92 # Checks for programs.
    93 ##################################################
    94 AC_PROG_CC
    95 AC_PROG_CXX
    96 AC_LIBTOOL_WIN32_DLL
    97 AC_PROG_LIBTOOL
    98 PKG_PROG_PKG_CONFIG
    99 AC_CHECK_TOOL([WINDRES],[windres],[no])
   100 AM_CONDITIONAL([HAVE_WINDRES],[test x$WINDRES != xno])
   101 AC_CHECK_PROGS([RSVG],[rsvg rsvg-convert],[no])
   102 if test "$RSVG" = no; then
   103     AC_MSG_ERROR([no rsvg program found to convert SVG files to bitmaps])
   104 fi
   105 AX_VALGRIND_CHECK
   106 AS_IF([test "$enable_valgrind" != "no"],[[
   107     major=`$VALGRIND --version | \
   108       sed -e 's/^valgrind-//' -e 's/^[^.]*$/0/' -e 's/\..*//'`
   109     minor=`$VALGRIND --version | \
   110       sed -e 's/^valgrind-//' -e 's/.*/&.0.0/' -e 's/[^.]*\.\([^.]*\)\..*/\1/'`
   111 ]],[major=0; minor=0])
   112 AM_CONDITIONAL([HAVE_VALGRIND_3_9],[test 0$major -gt 3 -o 0$minor -gt 8])
   113 AX_CODE_COVERAGE
   114 AC_CHECK_TOOL([RAZOR],[razor],[no])
   115 AC_CHECK_TOOL([RPMBUILD],[rpmbuild],[no])
   116 AC_CHECK_TOOL([CREATEREPO],[createrepo],[no])
   117 AC_CHECK_TOOL([COMPILE_RESOURCES],[glib-compile-resources],[no])
   118 AM_CONDITIONAL([HAVE_CHECK_TOOLS],
   119   [test x$RAZOR != xno -a x$RPMBUILD != xno -a x$CREATEREPO != xno -a \
   120    x$COMPILE_RESOURCES != xno])
   121 
   122 ##################################################
   123 # Checks for header files.
   124 ##################################################
   125 AC_HEADER_STDC
   126 AC_CHECK_HEADERS([winhttp.h],[],[],
   127 [#include <windows.h>
   128 ])
   129 
   130 ##################################################
   131 # Checks for typedefs, structures, and compiler characteristics.
   132 ##################################################
   133 
   134 ##################################################
   135 # Checks for libraries.
   136 ##################################################
   137 PKG_CHECK_MODULES(WHELK,[whelk])
   138 PKG_CHECK_MODULES(RAZOR,[razor >= 0.5.4],[:],[RAZOR_LIBS=-lrazor])
   139 PKG_CHECK_MODULES(EXPAT,[expat >= 2.1],[:],
   140   [PKG_CHECK_MODULES(EXPAT,[expat21],[:],[EXPAT_LIBS=-lexpat])])
   141 PKG_CHECK_MODULES(ZLIB,[zlib],[:],[ZLIB_LIBS=-lz])
   142 PKG_CHECK_MODULES(LUA,[lua],[:],[LUA_LIBS=-llua])
   143 PKG_CHECK_MODULES(GIO,[gio-2.0])
   144 PKG_CHECK_MODULES(GTK,[gtk+-2.0])
   145 PKG_CHECK_MODULES(GMODULE_EXPORT,[gmodule-export-2.0])
   146 LIBPLOVER_CFLAGS="$RAZOR_CFLAGS $EXPAT_CFLAGS $ZLIB_CFLAGS $GIO_CFLAGS"
   147 LIBPLOVER_LIBS="$RAZOR_LIBS $EXPAT_LIBS $ZLIB_LIBS $GIO_LIBS"
   148 AC_SUBST(LIBPLOVER_CFLAGS)
   149 AC_SUBST(LIBPLOVER_LIBS)
   150 PLOVER_GTK_CFLAGS="$GTK_CFLAGS $RAZOR_CFLAGS"
   151 PLOVER_GTK_LIBS="$GTK_LIBS $RAZOR_LIBS"
   152 AC_SUBST(PLOVER_GTK_CFLAGS)
   153 AC_SUBST(PLOVER_GTK_LIBS)
   154 save_LIBS="$LIBS"
   155 AC_SEARCH_LIBS([crypt],[crypt])
   156 LUA_POSIX_CFLAGS="$LUA_CFLAGS"
   157 LUA_POSIX_LIBS="-llua-posix $LUA_LIBS $LIBS"
   158 LIBS="$save_LIBS"
   159 AC_SUBST(LUA_POSIX_CFLAGS)
   160 AC_SUBST(LUA_POSIX_LIBS)
   161 GUI_CFLAGS="$GMODULE_EXPORT_CFLAGS $WHELK_CFLAGS $PLOVER_GTK_CFLAGS \
   162   $LIBPLOVER_CFLAGS $LUA_POSIX_CFLAGS"
   163 GUI_LIBS="$GMODULE_EXPORT_LIBS $WHELK_LIBS $PLOVER_GTK_LIBS \
   164   $LIBPLOVER_LIBS $LUA_POSIX_LIBS"
   165 AC_SUBST(GUI_CFLAGS)
   166 AC_SUBST(GUI_LIBS)
   167 save_PKG_CONFIG="$PKG_CONFIG"
   168 PKG_CONFIG="$PKG_CONFIG --static"
   169 PKG_CHECK_MODULES(SETUP,[whelk razor >= 0.5.4 expat >= 2.1 zlib gio-2.0],[:],
   170   [PKG_CHECK_MODULES(SETUP,[whelk razor >= 0.5.4 expat21 zlib gio-2.0])])
   171 if test -n "$host_mingw"; then
   172     # Hacks:
   173     # -liconv is required for mingw. This probably stems from our use of
   174     # libiconv rather than win-iconv that Fedora uses, but should be addressed
   175     # somewhere in the stack below us.
   176     # -ldnsapi is required by gio. This probably represents a gio bug.
   177     SETUP_LIBS="$SETUP_LIBS -liconv -ldnsapi"
   178 fi
   179 PKG_CONFIG="$save_PKG_CONFIG"
   180 SETUP_CFLAGS="$SETUP_CFLAGS $LUA_POSIX_CFLAGS"
   181 SETUP_LIBS="$SETUP_LIBS $LUA_POSIX_LIBS"
   182 AC_SUBST(SETUP_LIBS)
   183 AC_SUBST(SETUP_CFLAGS)
   184 save_LIBS="$LIBS"
   185 LIBS="$LIBS -lcrypt32"
   186 AC_MSG_CHECKING([for library containing CertEnumCertificatesInStore])
   187 AC_LINK_IFELSE([AC_LANG_PROGRAM(
   188   [[#include <windows.h>]],
   189   [return !CertEnumCertificatesInStore((HCERTSTORE)0,NULL);])],
   190   [FETCH_LIBS="-lcrypt32"])
   191 if test -z "$FETCH_LIBS"; then
   192     AC_MSG_RESULT([no])
   193 else
   194     AC_MSG_RESULT([$FETCH_LIBS])
   195 fi
   196 AC_SUBST([FETCH_LIBS])
   197 LIBS="$save_LIBS"
   198 AC_ARG_WITH([breakpad],
   199   [AS_HELP_STRING([--with-breakpad],
   200     [produce minidumps on crash @<:@default=check@:>@])],
   201   [],[with_breakpad=check])
   202 if test "$with_breakpad" != no; then
   203     PKG_CHECK_MODULES([BREAKPAD],[breakpad-client],
   204       [have_breakpad="yes";REQUIREMENTS="$REQUIREMENTS x11"],[have_breakpad="no"])
   205     if test "$have_breakpad" = yes; then
   206 	AC_DEFINE([HAVE_BREAKPAD],[1],[Define if breakpad is available.])
   207     elif test "$with_breakpad" = yes; then
   208 	AC_MSG_ERROR([$BREAKPAD_PKG_ERRORS])
   209     fi
   210 else
   211     have_breakpad="no"
   212 fi
   213 AM_CONDITIONAL([HAVE_BREAKPAD],[test $have_breakpad = yes])
   214 
   215 ##################################################
   216 # Checks for library functions.
   217 ##################################################
   218 AC_CHECK_FUNCS_ONCE([fchdir fpathconf dirfd localtime_r])
   219 
   220 ##################################################
   221 # Checks for processor independent files.
   222 ##################################################
   223 
   224 ##################################################
   225 # Generate the various configured files
   226 ##################################################
   227 AC_OUTPUT