libreoffice-online/loolwsd/configure.ac

93 lines
2.9 KiB
Text
Raw Normal View History

2015-03-09 04:11:15 -05:00
# -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([loolwsd], [1.0], [libreoffice@collabora.com])
AM_INIT_AUTOMAKE([1.11 silent-rules])
AC_CONFIG_SRCDIR([LOOLWSD.cpp])
2015-03-09 04:11:15 -05:00
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
# Declare options
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],
[Enable debugging, link with debugging version of Poco libraries]))
AC_ARG_WITH([lokit-path],
AS_HELP_STRING([--with-lokit-path=<path>],
[Path the "include" directory with the LibreOfficeKit headers]))
AC_ARG_WITH([poco-includes],
AS_HELP_STRING([--with-poco-includes=<path>],
[Path the "include" directory with the Poco headers]))
AC_ARG_WITH([poco-libs],
AS_HELP_STRING([--with-poco-libs=<path>],
[Path the "lib" directory with the Poco libraries]))
# Handle options
AS_IF([test "$enable_debug" = yes],
[POCO_DEBUG_SUFFIX=d],
[POCO_DEBUG_SUFFIX=])
# Test for build environment
CXXFLAGS="$CXXFLAGS -std=c++11"
2015-03-13 04:29:55 -05:00
CXXFLAGS="$CXXFLAGS -Wall -Werror"
2015-03-09 04:11:15 -05:00
AS_IF([test -n "$with_lokit_path"],
[CPPFLAGS="$CPPFLAGS -I${with_lokit_path}"])
AS_IF([test -n "$with_poco_includes"],
[CPPFLAGS="$CPPFLAGS -I${with_poco_includes}"])
AS_IF([test -n "$with_poco_libs"],
[LDFLAGS="$LDFLAGS -L${with_poco_libs} -Wl,-rpath,${with_poco_libs}"])
2015-03-09 04:11:15 -05:00
2015-03-09 06:40:27 -05:00
AS_IF([test `uname -s` != Darwin],
[AC_SEARCH_LIBS([dlopen],
[dl dld],
2015-03-09 07:11:39 -05:00
[],
2015-03-09 06:40:27 -05:00
[AC_MSG_ERROR([dlopen not found])])])
2015-03-09 04:11:15 -05:00
AC_SEARCH_LIBS([png_create_write_struct],
2015-03-09 06:40:27 -05:00
[png],
[],
[AC_MSG_ERROR([libpng not available?])])
2015-03-09 04:11:15 -05:00
LIBS="$LIBS -lPocoNet${POCO_DEBUG_SUFFIX} -lPocoUtil${POCO_DEBUG_SUFFIX} -lPocoXML${POCO_DEBUG_SUFFIX} -lPocoJSON${POCO_DEBUG_SUFFIX} -lPocoFoundation${POCO_DEBUG_SUFFIX}"
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([LibreOfficeKit/LibreOfficeKit.h],
[],
[AC_MSG_ERROR([header LibreOfficeKit/LibreOfficeKit.h not found, perhaps you want to use --with-lokit-path])])
AC_CHECK_HEADERS([Poco/Net/WebSocket.h],
[],
[AC_MSG_ERROR([header Poco/Net/WebSocket.h not found, perhaps you want to use --with-poco-includes])])
# How to check for C++ libraries? AC_CHECK_LIB works only for C. Let's
# not bother, garbage in--garbage out. We will find out when
# makeing...
AC_LANG_POP
test "$prefix" = NONE && prefix=$ac_default_prefix
LOOLWSD_CACHEDIR=${localstatedir}/cache/${PACKAGE}
while :; do
oldvalue=$LOOLWSD_CACHEDIR
LOOLWSD_CACHEDIR=`eval echo $LOOLWSD_CACHEDIR`
test $LOOLWSD_CACHEDIR = $oldvalue && break
done
AC_DEFINE_UNQUOTED([LOOLWSD_CACHEDIR],["$LOOLWSD_CACHEDIR"],[Cache folder])
AC_SUBST(LOOLWSD_CACHEDIR)
2015-03-09 10:31:47 -05:00
2015-03-09 04:11:15 -05:00
AC_CONFIG_FILES([Makefile])
AC_OUTPUT