1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mirrors-pdfedit

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
configure.in 22 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Michal Hocko Отправлено 22.01.2012 22:36 96307d6
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
dnl TODO change for devel package
define([PDFEDIT_VERSION], patsubst(esyscmd(./getversion -v),[]))
AC_INIT([PDFedit], PDFEDIT_VERSION,
[BUGTRACKER - http://pdfedit.petricek.net/bt/ ],[pdfedit])
dnl FIXME what do we use src/utils/aconf.h for? No includes according to
dnl grep. Can we remove it?
AC_CONFIG_HEADERS(src/utils/aconf.h src/xpdf/xpdf-aconf.h)
m4_include([config/env.m4])
m4_include([config/macro.m4])
m4_include([config/boost_base.m4])
m4_include([config/cppunit.m4])
m4_include([config/freetype2.m4])
m4_include([config/ax_check_zlib.m4])
m4_include([config/ax_boost_program_options.m4])
m4_include([config/xpdf.m4])
dnl Checks for programs. (c++ compiler,...)
AC_LANG_CPLUSPLUS
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl This has problems with some autoconf versions which require and test
dnl install-sh script to be present in current directory. Actually we don't
dnl depend on it and it is one of just-to-be-sure tests. Maybe we can enable
dnl later if we find it necessary.
dnl AC_PROG_MKDIR_P
AC_PROG_LN_S
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl TODO where do we use output?
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
AX_CHECK_ZLIB
dnl Checks for boost
AX_BOOST_BASE
dnl fake-install-tools can be used to installation tools (COPY, DEL_*,
dnl SYMLINK, etc) by those which are safe for testing - don't touch
dnl anything and instead logs all actions - tools/fake_install_tools.sh
dnl script with the first parameter as original operation
AC_ARG_WITH([fake-install],
AS_HELP_STRING([--with-fake-install=YES|NO],
[Only log actions that would be done during make
{un}install, instead of doing them (to the
/tmp/fake_install_tools.log). This is only
for testing purposes.]
),
[
fake_install="$withval"
],
[fake_install="NO"]
)
if test "x$fake_install" = "xYES"
then
AC_MSG_NOTICE("Using fake-install-tools.")
COPY='sh $(ROOT)/tools/fake_install_tools.sh COPY'
DEL_FILE='sh $(ROOT)/tools/fake_install_tools.sh DEL_FILE'
DEL_FORCE_DIR='sh $(ROOT)/tools/fake_install_tools.sh DEL_FORCE_DIR'
DEL_DIR='sh $(ROOT)/tools/fake_install_tools.sh DEL_DIR'
SYMLINK='sh $(ROOT)/tools/fake_install_tools.sh SYMLINK'
MKDIR='sh $(ROOT)/tools/fake_install_tools.sh MKDIR'
CHK_DIR_EXISTS='sh $(ROOT)/tools/fake_install_tools.sh CHK_DIR_EXISTS'
fi
dnl Default (and configurable) values for files/directories manipulation
dnl programs (you can overwrite them by ./configure NAME=value)
CHK_OR_DEFINE_VAR(COPY, "cp -f")
CHK_OR_DEFINE_VAR(DEL_FILE, "rm -f")
CHK_OR_DEFINE_VAR(DEL_DIR, "sh \$(ROOT)/tools/rmdir.sh")
CHK_OR_DEFINE_VAR(DEL_FORCE_DIR, "rm -rf")
CHK_OR_DEFINE_VAR(SYMLINK, "ln -s")
CHK_OR_DEFINE_VAR(MOVE, "mv -f")
CHK_OR_DEFINE_VAR(CHK_DIR_EXISTS, "test -d")
CHK_OR_DEFINE_VAR(MKDIR, "mkdir -p")
AC_SUBST(COPY)
AC_SUBST(DEL_FILE)
AC_SUBST(DEL_DIR)
AC_SUBST(DEL_FORCE_DIR)
AC_SUBST(SYMLINK)
AC_SUBST(MOVE)
AC_SUBST(CHK_DIR_EXISTS)
AC_SUBST(MKDIR)
dnl compiler options which might be set by environment viariable
dnl TODO check whether this is ok also for other platforms
CHK_OR_DEFINE_VAR(ARCH, "")
CHK_OR_DEFINE_VAR(C_EXTRA, "-fmessage-length=0 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing")
CHK_OR_DEFINE_VAR(EXTRA_UTILS_CFLAGS, "")
CHK_OR_DEFINE_VAR(EXTRA_KERNEL_CFLAGS, "")
CHK_OR_DEFINE_VAR(EXTRA_TESTS_CFLAGS, "")
CHK_OR_DEFINE_VAR(EXTRA_XPDF_CFLAGS, "")
CHK_OR_DEFINE_VAR(CXX_EXTRA, "-fmessage-length=0 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -fexceptions")
CHK_OR_DEFINE_VAR(EXTRA_UTILS_CXXFLAGS, "")
CHK_OR_DEFINE_VAR(EXTRA_KERNEL_CXXFLAGS, "")
CHK_OR_DEFINE_VAR(EXTRA_TESTS_CXXFLAGS, "")
CHK_OR_DEFINE_VAR(EXTRA_GUI_CXXFLAGS, "")
CHK_OR_DEFINE_VAR(EXTRA_XPDF_CXXFLAGS, "")
AC_SUBST(ARCH)
AC_SUBST(C_EXTRA)
AC_SUBST(EXTRA_UTILS_CFLAGS)
AC_SUBST(EXTRA_KERNEL_CFLAGS)
AC_SUBST(EXTRA_TESTS_CFLAGS)
AC_SUBST(EXTRA_XPDF_CFLAGS)
AC_SUBST(CXX_EXTRA)
AC_SUBST(EXTRA_UTILS_CXXFLAGS)
AC_SUBST(EXTRA_KERNEL_CXXFLAGS)
AC_SUBST(EXTRA_TESTS_CXXFLAGS)
AC_SUBST(EXTRA_GUI_CXXFLAGS)
AC_SUBST(EXTRA_XPDF_CXXFLAGS)
AC_ARG_ENABLE(portability-flags,
[AS_HELP_STRING([--enable-portability-flags],
[Turn on compilation flags which force the c/c++ standard constructs and proper portability (this includes -std=c99, -std=c++98, -ansi, -posix, -pedantic). Enabled by default])],
,
[enable_portability_flags=yes])
AC_MSG_CHECKING(whether c/c++ and portability flags are forced)
if test "x$enable_portability_flags" = "xyes"
then
C_PORTABILITY_FLAGS="-posix -ansi -std=c99 -pedantic -D_XOPEN_SOURCE=500"
CXX_PORTABILITY_FLAGS="-posix -ansi -std=c++98 -D_XOPEN_SOURCE=500"
AC_MSG_RESULT(yes)
else
C_PORTABILITY_FLAGS=""
CXX_PORTABILITY_FLAGS=""
AC_MSG_RESULT(no)
fi
AC_SUBST(C_PORTABILITY_FLAGS)
AC_SUBST(CXX_PORTABILITY_FLAGS)
dnl Default (and configurable) values for libraries
CHK_OR_DEFINE_VAR(AR, "ar cqs")
CHK_OR_DEFINE_VAR(LIBPREFIX, "lib")
AC_SUBST(AR)
AC_SUBST(LIBPREFIX)
AC_ARG_ENABLE(stack-protector,
[AS_HELP_STRING([--enable-stack-protector],
[Turn on stack protector (disabled by default)])],
,
[enable_stack_protector=no])
AC_MSG_CHECKING(whether we use stack protector)
if test "x$enable_stack_protector" != "xno"
then
STACK_PROTECTOR_FLAGS="-fstack-protector"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
STACK_PROTECTOR_FLAGS=""
fi
AC_SUBST(STACK_PROTECTOR_FLAGS)
AC_ARG_ENABLE(release,
[AS_HELP_STRING([--enable-release],
[Turn on compiler optimizations, turn off
debugging symbols (enabled by default, disable
with --disable-release)])],
,
[enable_release=yes])
AC_SUBST(enable_release)
dnl if we want release then optimalization is turned on and we can optionally
dnl add debug information. Otherwise we will turn off optimizations and allways
dnl get debug info
AC_ARG_ENABLE(debug-info,
[AS_HELP_STRING([--enable-debug-info],
[Adds debug information (used only for release and
it is disabled by default)])],
,
[enable_debug_info=no])
AC_MSG_CHECKING(whether we are releasing)
E_RELEASE="no"
if test "x$enable_release" = "xyes"; then
AC_MSG_RESULT(true)
OPTIM="$OPTIM -O2"
AC_MSG_CHECKING(whether debug info is included)
if test "x$enable_debug_info" = "xyes"
then
DEBUG="$DEBUG -g"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
E_RELEASE="yes"
WARN=""
else
AC_MSG_RESULT(no)
OPTIM="$OPTIM -O0"
dnl maybe asserts and stuff like that?
DEBUG="$DEBUG -g -DDEBUG"
WARN="$WARN -W -Wall -Wconversion -Wno-unused-variable \
-Wunused-function -Wno-write-strings \
-Wunused-macros"
fi
AC_SUBST(OPTIM)
AC_SUBST(DEBUG)
AC_SUBST(E_RELEASE)
AC_SUBST(WARN)
dnl Enable observer debugging (disabled by default)
AC_ARG_ENABLE(observer-debug,
[AS_HELP_STRING([--enable-observer-debug],
[Turn on observer debugging (disabled by default)])],
,
[enable_observer_debug=no])
AC_MSG_CHECKING(whether to enable observer debugging)
if test "x$enable_observer_debug" = "xyes"; then
OBSERVER_CFLAGS="$OBSERVER_CFLAGS -DOBSERVER_DEBUG"
OBSERVER_CXXFLAGS="$OBSERVER_CXXFLAGS -DOBSERVER_DEBUG"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(OBSERVER_CFLAGS)
AC_SUBST(OBSERVER_CXXFLAGS)
dnl Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([atexit floor ftruncate localtime_r memset mkdir strdup strerror strpbrk strstr])
dnl XPdf code requires >=2.0.5
dnl TODO check for version
AC_CHECK_FT2
smr_CHECK_LIB(t1, t1, [Type 1 font rasterizer],
T1_InitLib, t1lib.h,
-lm, $X_CFLAGS)
AC_SUBST(t1_LIBS)
AC_SUBST(t1_CFLAGS)
dnl We don't need to have explicit --enable-man-doc option so we keep it
dnl implicit and if some option want to include man pages, it simply sets
dnl this to true and the rest is done later in this script
enable_man_doc="no"
dnl TODO maybe be can add also generic pdfedit-dev package which will install
dnl pdfedit-core-dev and pdfedit-gui-dev (which will contain gui reusable code
dnl e.g. scripting)
dnl Sets DEV_TARGET for pdfedit-core-dev package
AC_ARG_ENABLE(pdfedit-core-dev,
AS_HELP_STRING([--enable-pdfedit-core-dev],
[Builds and prepars PDFedit-core-dev package which can be
used by 3rd party project separately from gui frontend
(this includes static libraries and header files)]),
,
[enable_pdfedit_core_dev=no])
AC_MSG_CHECKING(whether we want to prepare pdfedit-core-dev package)
if test "x$enable_pdfedit_core_dev" = "xyes"
then
AC_MSG_RESULT(yes)
INSTALL_TARGET="$INSTALL_TARGET install-core-dev"
UNINSTALL_TARGET="$UNINSTALL_TARGET uninstall-core-dev"
else
AC_MSG_RESULT(no)
fi
dnl Sets GUI_TARGET and qt specific stuff
AC_ARG_ENABLE(gui,
[AS_HELP_STRING([--enable-gui],
[Builds gui frontend (enabled by default, use
--disable-gui to disable it)])],
,
[enable_gui=yes])
AC_MSG_CHECKING(whether we want to build PDFedit gui)
dnl Check QT environment if we want GUI
dnl QSA_DIR is set to qt3 by default. Note that this is important because
dnl we need at least some qsa directory for src/Makefile and its clean target
dnl gui implies also man pages
QSA_DIR="$QSA_DIR qsa"
if test "x$enable_gui" = "xyes"; then
AC_MSG_RESULT(yes)
GUI_TARGET="$GUI_TARGET pdfedit"
INSTALL_TARGET="$INSTALL_TARGET install-gui"
UNINSTALL_TARGET="$UNINSTALL_TARGET uninstall-gui"
dnl QTDIR is mandatory
CHK_ENV_VAR([QTDIR],
[QTDIR environment variable must be set])
dnl QMAKESPEC is optional but recomended
CHK_ENV_VAR_NOTICE([QMAKESPEC],
[QMAKESPEC environment variable is not set
- default will be used.])
AC_MSG_CHECKING(for QT qmake)
CHK_EXECUTABLE([qmake],[qmake qmake-qt4],[${QTDIR}/bin /usr/bin /usr/local/bin /usr/lib/qt4/bin],[
dnl check the qmake we found is for correct QT version (4.x.x)
isqmake4=`$testbin --version 2>&1 | grep '4\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*'`
if test -z "$isqmake4"
then
testbin=""
fi
],[(only for platforms where qmake is not installed under QTDIR/bin, /usr/bin, /usr/local/bin, /usr/lib/qt4/bin or in PATH).])
if test -z "${qmake_bin}"
then
AC_MSG_ERROR(unable to find qmake for QT3)
fi
QMAKE="$QMAKE ${qmake_bin}"
AC_MSG_RESULT(Using QT4 with qmake=${qmake_bin})
AC_SUBST(QMAKE)
dnl check for lrelease
AC_MSG_CHECKING(for QT lrelease)
CHK_EXECUTABLE([lrelease],[lrelease],[${QTDIR}/bin /usr/bin /usr/local/bin /usr/lib/qt4/bin],[],
[(Only for platforms where lrelease is not installed under QTDIR/bin, /usr/bin, /usr/local/bin, /usr/lib/qt4/bin or in PATH).])
if test -z "${lrelease_bin}"
then
AC_MSG_ERROR(unable to find lrelease localization binary for QT3)
fi
LRELEASE="$LRELEASE ${lrelease_bin}"
AC_MSG_RESULT(Using lrelease=${lrelease_bin})
AC_SUBST(LRELEASE)
dnl enable man pages
enable_man_doc="yes"
else
AC_MSG_RESULT(no)
fi
AC_SUBST(GUI_TARGET)
AC_SUBST(QSA_DIR)
dnl Exports installation targets - install-no is used if no specific
dnl installation target was configured
if test "x$INSTALL_TARGET" = "x"
then
INSTALL_TARGET="$INSTALL_TARGET install-no"
fi
if test "x$UNINSTALL_TARGET" = "x"
then
UNINSTALL_TARGET="$UNINSTALL_TARGET uninstall-no"
fi
AC_SUBST(INSTALL_TARGET)
AC_SUBST(UNINSTALL_TARGET)
AC_ARG_WITH([root-dir],
AS_HELP_STRING([--with-root-dir=DIR],
[Install files under different root directory (path to prepend before
the prefix, empty by default - use if you are packager and want to create
package, or if you are installing into chrooted environment).]
),
[
root_dir="$withval/"
],
[root_dir=""]
)
AC_SUBST(root_dir)
AC_ARG_WITH([parallel-make],
AS_HELP_STRING([--with-parallel-make=auto|off|number],
[Sets MAKEFLAGS so that make will use parallel building when possible. This option
is useful when you have more CPUs/cores because each core can compile independently
and the compilation will take shorter time. You can use auto (default) which will
find out the number of CPU available and use this value, off for no parallelism
or number to specify the value explicitly.]
),
[
parallel_make_set="$withval"
],
[parallel_make_set="auto"]
)
parallel_make=""
if test "i$parallel_make_set" = "iauto"
then
{
AC_MSG_CHECKING(for /proc/cpuinfo )
if test -f /proc/cpuinfo
then
{
dnl /proc/cpuinfo is available in Linux and cygwin systems
CPU_NUM=`grep "^processor" /proc/cpuinfo | wc -l`
if test $CPU_NUM -gt 1
then
AC_MSG_RESULT($CPU_NUM CPUs/Cores available - using $CPU_NUM parallel jobs)
parallel_make="-j$CPU_NUM"
else
AC_MSG_RESULT(Only one CPU available - no parallelism)
fi
}
else
{
AC_MSG_RESULT(not available)
AC_MSG_CHECKING(for sysctl )
dnl sysctl is available on BSD systems
CPU_NUM=`/bin/sh -c 'sysctl -n hw.ncpu' 2>/dev/null`
if test -n "$CPU_NUM"
then
{
if test $CPU_NUM -gt 1
then
AC_MSG_RESULT($CPU_NUM CPUs/Cores available - using $CPU_NUM parallel jobs)
parallel_make="-j$CPU_NUM"
else
AC_MSG_RESULT(Only one CPU available - no parallelism)
fi
}
else
AC_MSG_RESULT(not available)
dnl TODO checks for other platforms
fi
}
fi
}
else
{
AC_MSG_CHECKING(--with-parallel-make value)
if test "i$parallel_make_set" = "ioff"
then
AC_MSG_RESULT(No parallelism)
else
{
if echo $parallel_make_set | grep '^ *[[0-9]][[0-9]]* *$' >/dev/null 2>&1
then
AC_MSG_RESULT(Using $parallel_make_set)
parallel_make="-j$parallel_make_set"
else
AC_MSG_ERROR($parallel_make_set is not valid)
fi
}
fi
}
fi
AC_SUBST(parallel_make)
dnl TODO handle also dev package (exclusive with gui case)
dnl Sets TESTS_TARGET and cppunit stuff, if we want to have
dnl also kernel tests
AC_ARG_ENABLE(kernel-tests,
[AS_HELP_STRING([--enable-kernel-tests],
[Compiles also kernel tests
(disabled by default)])],
,
[enable_kernel_tests=no])
AC_MSG_CHECKING(whether we want to compile kernel tests too)
if test "x$enable_kernel_tests" = "xyes"; then
AC_MSG_RESULT(yes)
KERNEL_TESTS_TARGET="$KERNEL_TESTS_TARGET kernel_tests"
dnl FIXME check the version - it is required by macro - I have used some
dnl random one
AM_PATH_CPPUNIT(1.10.0)
if test "x${no_cppunit}" != "x"
then
AC_MSG_ERROR(Unable to find CPPUnit required by --enable-kernel-tests)
fi
else
AC_MSG_RESULT(no)
fi
AC_SUBST(KERNEL_TESTS_TARGET)
dnl add man pages creation and installation target only if requiered by others
dnl options
if test "x$enable_man_doc" = "xyes"
then
MAN_TARGET="$MAN_TARGET doc_man"
MAN_INSTALL_TARGET="$MAN_INSTALL_TARGET doc_man_install"
fi
AC_SUBST(MAN_TARGET)
AC_SUBST(MAN_INSTALL_TARGET)
AC_ARG_ENABLE(doxygen-doc,
[AS_HELP_STRING([--enable-doxygen-doc],
[Creates doxygen documentation (extracted from sources)])],
,
[enable_doxygen_doc=no])
AC_MSG_CHECKING(whether we want to build doxygen documentation)
if test "x$enable_doxygen_doc" = "xyes"
then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for doxygen binary)
CHK_EXECUTABLE(doxygen,doxygen,[/usr/bin /usr/local/bin],[])
if test -z ${doxygen_bin}
then
AC_MSG_ERROR(unable to find doxygen binary)
fi
AC_MSG_RESULT(found at ${doxygen_bin})
DOXYGEN_BIN="$DOXYGEN_BIN ${doxygen_bin}"
DOXYGEN_TARGET="$DOXYGEN_TARGET doc_doxygen"
DOXYGEN_INSTALL_TARGET="$DOXYGEN_INSTALL_TARGET doc_doxygen_install"
else
AC_MSG_RESULT(no)
fi
AC_SUBST(DOXYGEN_TARGET)
AC_SUBST(DOXYGEN_INSTALL_TARGET)
AC_SUBST(DOXYGEN_BIN)
dnl Enable building advanced documentation?
AC_ARG_ENABLE(advanced-doc,
[AS_HELP_STRING([--enable-advanced-doc],
[Creates advanced documentation (advanced
programming and design description)])],
,
[enable_advanced_doc=no])
AC_MSG_CHECKING(whether we want to build advanced documentation)
if test "x$enable_advanced_doc" = "xyes"
then
AC_MSG_RESULT(yes)
ADVANCED_TARGET="$ADVANCED_TARGET doc_advanced"
ADVANCED_INSTALL_TARGET="$ADVANCED_INSTALL_TARGET doc_advanced_install"
xsl_tools_required=yes
else
AC_MSG_RESULT(no)
fi
AC_SUBST(ADVANCED_TARGET)
AC_SUBST(ADVANCED_INSTALL_TARGET)
dnl Enable building user manual?
AC_ARG_ENABLE(user-manual,
[AS_HELP_STRING([--enable-user-manual],
[Creates user manual])],
,
[enable_user_manual=no])
AC_MSG_CHECKING(whether we want to build user manual)
if test "x$enable_user_manual" = "xyes"
then
AC_MSG_RESULT(yes)
USER_MANUAL_TARGET="$USER_MANUAL_TARGET doc_user"
USER_MANUAL_INSTALL_TARGET="$USER_MANUAL_INSTALL_TARGET doc_user_install"
xsl_tools_required=yes
else
AC_MSG_RESULT(no)
fi
AC_SUBST(USER_MANUAL_TARGET)
AC_SUBST(USER_MANUAL_INSTALL_TARGET)
if test "x$xsl_tools_required" = "xyes"
then
dnl check for xsltproc
AC_MSG_CHECKING(for xsltproc binary)
CHK_EXECUTABLE(xsltproc,xsltproc,[/usr/bin /usr/local/bin],[])
if test -z ${xsltproc_bin}
then
AC_MSG_ERROR(unable to find xsltproc binary)
else
AC_MSG_RESULT(found at ${xsltproc_bin})
fi
dnl check for docbook xsl
dnl TODO create macro for detecting
AC_MSG_CHECKING(for docbook xsl)
docbook_xsl=""
for i in `cat doc/tools/docbook_xslt_paths`
do
if test -f $i/docbook.xsl
then
docbook_xsl=$i/docbook.xsl
break
fi
done
if test -z ${docbook_xsl}
then
AC_MSG_ERROR(unable to find docbook.xsl stylesheet)
else
AC_MSG_RESULT(found at ${docbook_xsl})
fi
dnl TODO: if xsltproc and stylesheet is missing, docbook2html from jade can be used
fi
dnl Enable building tools?
AC_ARG_ENABLE(tools,
[AS_HELP_STRING([--enable-tools],
[Enables tools building])],
,
[enable_tools=no])
AC_MSG_CHECKING(whether we want to build tools)
if test "x$enable_tools" = "xyes"
then
AC_MSG_RESULT(yes)
boost_program_options_required=yes
png_required=yes
if test "x$enable_pdfedit_core_dev" != "xyes"
then
AC_MSG_ERROR(--enable pdfedit-core-dev is required for tools)
fi
TOOLS_TARGET="$TOOLS_TARGET tools"
else
AC_MSG_RESULT(no)
fi
AC_SUBST(TOOLS_TARGET)
if test "x$boost_program_options_required" = "xyes"
then
AC_MSG_CHECKING(for boost-program-options library)
AX_BOOST_PROGRAM_OPTIONS
fi
png_LIBS=""
png_HEADERS=""
if test "x$png_required" = "xyes"
then
AC_MSG_CHECKING(for png library)
AC_LANG_SAVE
AC_LANG_C
AC_CHECK_LIB(png, png_check_sig, [pnglib=yes])
AC_CHECK_HEADERS(png.h, [pngheader=yes])
AC_LANG_RESTORE
if test "x$pnglib" = "x"
then
AC_MSG_ERROR(libpng is not found)
fi
if test "x$pngheader" = "x"
then
AC_MSG_ERROR(png headers is missing)
fi
AC_MSG_RESULT(yes)
dnl keep the header specific settings empty and library simply
dnl for now but let's integrate it into the rest of the building system
png_LIBS="-lpng"
fi
AC_SUBST(png_LIBS)
AC_SUBST(png_CFLAGS)
AC_CONFIG_FILES([Makefile.flags Makefile.rules])
dnl
dnl XPDF specific stuff taken from the original xpdf distribution
dnl
AC_PATH_XTRA
AC_HEADER_DIRENT
dnl ##### Switch over to C++. This will make the checks below a little
dnl ##### bit stricter (requiring function prototypes in include files).
dnl ##### (99% of xpdf is written in C++.)
AC_LANG_CPLUSPLUS
dnl ##### Look for rewinddir.
AC_CHECK_FUNCS(rewinddir)
if test $ac_cv_func_rewinddir = no; then
AC_CHECK_LIB(cposix, rewinddir)
fi
dnl ##### Checks for library functions.
AC_CHECK_FUNCS(popen)
dnl # This should use 'AC_CHECK_FUNCS(mkstemp)' but that fails if
dnl # the mkstemp exists in the library but isn't declared in the
dnl # include file (e.g., in cygwin 1.1.2).
AC_CACHE_CHECK([for mkstemp],
xpdf_cv_func_mkstemp,
[AC_TRY_LINK([#include <stdlib.h>
#include <unistd.h>],
[mkstemp("foo");],
xpdf_cv_func_mkstemp=yes, xpdf_cv_func_mkstemp=no)])
if test "$xpdf_cv_func_mkstemp" = yes; then
AC_DEFINE(HAVE_MKSTEMP)
fi
dnl # Check for mkstemps, just like mkstemp.
AC_CACHE_CHECK([for mkstemps],
xpdf_cv_func_mkstemps,
[AC_TRY_LINK([#include <stdlib.h>
#include <unistd.h>],
[mkstemps("foo", 0);],
xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)])
if test "$xpdf_cv_func_mkstemps" = yes; then
AC_DEFINE(HAVE_MKSTEMPS)
fi
dnl ##### Back to C for the library tests.
AC_LANG_C
dnl ##### Check for fseeko/ftello or fseek64/ftell64
dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode.
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
AC_DEFINE(HAVE_FSEEK64)
fi
if test "x${t1_LIBS}" != "x"
then
AC_DEFINE(HAVE_T1LIB_H)
fi
if test "x${FT2_LIBS}" != "x"
then
AC_DEFINE(HAVE_FREETYPE_FREETYPE_H)
AC_DEFINE(HAVE_SPLASH)
fi
dnl ##### Write the makefiles.
AC_OUTPUT(src/xpdf/Makefile src/xpdf/goo/Makefile src/xpdf/fofi/Makefile src/xpdf/splash/Makefile src/xpdf/xpdf/Makefile )
echo ""
echo "Configuration complete"
echo " Building in release mode : $enable_release"
if test "$enable_release" = "yes"
then
echo " Include debugging information : $enable_debug_info"
fi
echo " Enable observer debugging : $enable_observer_debug"
echo " Build man pages : $enable_man_doc"
echo " Build user manual : $enable_user_manual"
echo " Build doxygen documentation : $enable_doxygen_doc"
echo " Build advanced documentation : $enable_advanced_doc"
echo " Build kernel tests : $enable_kernel_tests"
echo " Build GUI : $enable_gui"
echo " Build pdfedit-core-dev : $enable_pdfedit_core_dev"
echo " Build tools : $enable_tools"
echo
echo "Installation summary:"
echo " Root directory : $root_dir"
echo " Install into : $prefix"
echo " Install pdfedit-core-dev : $enable_pdfedit_core_dev"
echo " Install gui : $enable_gui"
echo ""
echo "Type 'make' to build $PACKAGE_STRING"
echo ""

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mirrors-pdfedit.git
git@api.gitlife.ru:oschina-mirror/mirrors-pdfedit.git
oschina-mirror
mirrors-pdfedit
mirrors-pdfedit
gui-jm