1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
|
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
define([PDFEDIT_VERSION], patsubst(esyscmd(./getversion),[]))
AC_INIT([PDFedit], PDFEDIT_VERSION,
[BUGTRACKER - http://pdfedit.petricek.net/bt/ ],[pdfedit])
AC_CONFIG_SRCDIR([src/gui/base.cc])
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/aconf.h)
m4_include([config/env.m4])
m4_include([config/macro.m4])
m4_include([config/boost_base.m4])
m4_include([config/boost_iostreams.m4])
m4_include([config/cppunit.m4])
m4_include([config/freetype2.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
dnl Checks for boost and boost iostreams
AX_BOOST_BASE
AX_BOOST_IOSTREAMS
if test "x$ax_cv_boost_iostreams" = "xno"
then
AC_MSG_ERROR(Boost IOStreams is required by PDFedit)
fi
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 -Wwrite-strings \
-Wno-unused-variable -Wunused-function -Wwrite-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 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])
dnl TODO remove - testing for qt envoronment
AC_ARG_ENABLE(qt3,
[AS_HELP_STRING([--enable-qt3],
[Uses Qt3 infrastructure (use
--disable-qt3 to use QT4 instead)])],
,
[enable_qt3=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
QSA_DIR="$QSA_DIR qsa"
INSTALL_TARGET="$INSTALL_TARGET install-no"
UNINSTALL_TARGET="$UNINSTALL_TARGET uninstall-no"
if test "x$enable_gui" = "xyes"; then
AC_MSG_RESULT(yes)
GUI_TARGET="$GUI_TARGET pdfedit"
INSTALL_TARGET=""
INSTALL_TARGET="$INSTALL_TARGET install-gui"
UNINSTALL_TARGET=""
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)
if test "x$enable_qt3" = "xyes"
then
CHK_EXECUTABLE([qmake],[qmake qmake-qt3],[${QTDIR}/bin /usr/lib/qt3/bin],[
dnl check the qmake we found is for correct QT version (3.x.x)
isqmake3=`$testbin --version 2>&1 | grep '3\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*'`
if test -z "$isqmake3"
then
testbin=""
fi
],[(only for platforms where qmake is not installed under QTDIR tree).])
if test -z "${qmake_bin}"
then
AC_MSG_ERROR(unable to find qmake for QT3)
fi
QMAKE="$QMAKE ${qmake_bin}"
AC_MSG_RESULT(Using QT3 with qmake=${qmake_bin})
else
AC_MSG_ERROR(Using QT4 - not supported at the moment)
QSA_DIR="$QSA_DIR qsa-qt4"
fi
AC_SUBST(QMAKE)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(GUI_TARGET)
AC_SUBST(QSA_DIR)
AC_SUBST(INSTALL_TARGET)
AC_SUBST(UNINSTALL_TARGET)
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)
TESTS_TARGET="$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(TESTS_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)
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)
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)
fi
AC_MSG_RESULT(found at ${xsltproc_bin})
dnl TODO create macro for detecting
AC_MSG_CHECKING(Checking 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)
fi
AC_MSG_RESULT(found at ${docbook_xsl})
dnl TODO: if xsltproc and stylesheet is missing, docbook2html from jade can be used
ADVANCED_TARGET="$ADVANCED_TARGET doc_advanced"
ADVANCED_INSTALL_TARGET="$ADVANCED_INSTALL_TARGET doc_advanced_install"
else
AC_MSG_RESULT(no)
fi
AC_SUBST(ADVANCED_TARGET)
AC_SUBST(ADVANCED_INSTALL_TARGET)
AC_ARG_WITH([root-dir],
AS_HELP_STRING([--with-root-dir=DIR],
[Use different installation root (path to prepend before the prefix, empty by default).]
),
[
root_dir="$withval/"
],
[root_dir=""]
)
AC_SUBST(root_dir)
AC_CONFIG_FILES([Makefile Makefile.flags])
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 )
|