-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
95 lines (75 loc) · 2.62 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([FlaxPDF],[0.7.3],[])
AC_CONFIG_AUX_DIR([config])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2 no-dist-gzip])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([src/autoconfig.h])
AC_PREFIX_DEFAULT([/usr])
AC_LANG_CPLUSPLUS
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AM_GNU_GETTEXT([external])
dnl AM_GNU_GETTEXT_VERSION([0.17])
AX_PTHREAD
AX_OPENMP
LIBS=["$PTHREAD_LIBS $LIBS"]
CXXFLAGS=["$CXXFLAGS $OPENMP_CXXFLAGS $PTHREAD_CFLAGS"]
CFLAGS=["$CFLAGS $OPENMP_CFLAGS $PTHREAD_CFLAGS"]
# FLTK
unset fltkconfig
AC_CHECK_PROGS([fltkconfig], [fltk-config13 fltk-config])
if test "x$fltkconfig" = x; then
AC_MSG_ERROR([fltk-config not found])
fi
VER=$($fltkconfig --version)
MINOR=$(echo $VER | cut -d. -f2)
PATCH=$(echo $VER | cut -d. -f3)
if test "$MINOR" -lt 3 || test "$PATCH" -lt 3; then
AC_MSG_ERROR([FLTK >= 1.3.3 not found, got $VER])
fi
CXXFLAGS=["$CXXFLAGS $($fltkconfig --cxxflags | sed 's@-I@-isystem @g')"]
LIBS=["$LIBS $($fltkconfig --ldflags --use-images)"]
# Checks for libraries.
AC_CHECK_LIB([lzo2], [__lzo_init_v2], [], AC_MSG_ERROR([LZO not found]))
#AC_CHECK_LIB([dl], [dlopen], [], AC_MSG_ERROR([libdl not found]))
#AC_CHECK_LIB([rt], [sched_get_priority_min], [], AC_MSG_ERROR([librt not found]))
PKG_CHECK_MODULES([DEPS], [poppler >= 0.31.0 xrender])
DEPS_CFLAGS=$(echo $DEPS_CFLAGS | sed 's@-I@-isystem @g')
LIBS=["$LIBS $DEPS_LIBS"]
CXXFLAGS=["$CXXFLAGS $DEPS_CFLAGS"]
# Check for webkitfltk version
#AC_MSG_CHECKING([webkitfltk version is ok])
#AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <webkit.h>]],
# [[
#if WK_FLTK_MAJOR != 0 || WK_FLTK_MINOR < 2
#error unsupported webkitfltk version
#endif
# ]])], [AC_MSG_RESULT([yes])], [AC_MSG_FAILURE([Unsupported webkit version, 0.2 required])]
# )
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Random other things
CFLAGS=["$CFLAGS -Wall -Wextra"]
CXXFLAGS=["$CXXFLAGS -Wall -Wextra"]
LDFLAGS=["$LDFLAGS -Wl,-O1"]
AX_CHECK_COMPILE_FLAG([-ffunction-sections],
[CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
LDFLAGS="$LDFLAGS -Wl,-gc-sections"
ac_cv_sections_supported=yes],
[ac_cv_sections_supported=no],
[])
AX_CHECK_LINK_FLAG([-Wl,-as-needed], [LDFLAGS="$LDFLAGS -Wl,-as-needed"],
[], [])
AC_CONFIG_COMMANDS([atag],[
echo -e "\n\n\t\t*********\n"
echo Configure finished
echo -e "\n\t\t*********\n\n"],
[distributable=$distributable])
AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in])
AC_OUTPUT