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