-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
136 lines (114 loc) · 3.83 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
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_CONFIG_MACRO_DIR([m4])
AC_INIT([gdar], [1.1], [specht.tobias@gmx.de])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([src/libgdar.cpp])
AC_CONFIG_HEADERS([config.h])
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX([11], [noext], [optional])
AC_CHECK_PROG(MAKE_CHECK,make,yes)
if test x"$MAKE_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install make before installing.])
fi
# Internationalization
IT_PROG_INTLTOOL([0.35.0])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging, default: no]),
[case "${enableval}" in
yes) debug="yes" ;;
no) debug="no" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],
[debug="no"])
AM_CXXFLAGS="-Wall -Wextra -Werror"
if test "$debug" == "yes"
then
AM_CXXFLAGS="$AM_CXXFLAGS -O0 -g -fstack-protector-all -fsanitize=undefined"
else
AM_CXXFLAGS="$AM_CXXFLAGS -O2"
fi
AC_SUBST([AM_CXXFLAGS])
GETTEXT_PACKAGE=gdar
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [The domain name to use with gettext.])
ALL_LINGUAS="de"
AM_GLIB_GNU_GETTEXT
GDAR_LOCALEDIR=["${datadir}/locale"]
AC_SUBST(GDAR_LOCALEDIR)
# do not use default compiler options (-g -O2)
CXXFLAGS=""
# Checks for programs.
AC_PROG_CXX
# Checks for libraries.
#Checks for pkg moduels
libdar="libdar"
AC_ARG_ENABLE([libdar64],[ --enable-libdar64 link against libdar64],[libdar="libdar64"],[libdar="libdar"])
if test "$libdar" == "libdar64"
then
AC_DEFINE([LIBDAR_MODE],[64],[LIBDAR_MODE])
fi
PKG_CHECK_MODULES([DAR], [${libdar} >= 5.3.0])
PKG_CHECK_MODULES([GTKMM], [gtkmm-3.0])
# Checks for header files.
AC_CHECK_HEADER([gcrypt.h],[],[AC_MSG_ERROR([unable to find gcrypt header])])
AC_CHECK_HEADER([bzlib.h],[],[AC_MSG_ERROR([unable to find bzlib header])])
AC_CHECK_HEADER([lzo/lzo2a.h],[],[AC_MSG_ERROR([unable to find lzo2 header])])
AC_CHECK_HEADER([attr/libattr.h],[],[AC_MSG_ERROR([unable to find libattr header])])
AC_CHECK_HEADER([zlib.h],[],[AC_MSG_ERROR([unable to find zlib header])])
# check special libdar funtion
AS_VERSION_COMPARE([`pkg-config --modversion ${libdar}`],[5.5.0],
[libdar_with_date_as_time="no"],
[libdar_with_date_as_time="no"],
[libdar_with_date_as_time="yes"]
)
AS_VERSION_COMPARE([`pkg-config --modversion ${libdar}`],[5.4.0],
[get_children_in_table="no"],
[get_children_in_table="yes"],
[get_children_in_table="yes"]
)
AS_VERSION_COMPARE([`pkg-config --modversion ${libdar}`],[6.0.0],
[use_libdar_api5="no"],
[use_libdar_api5="yes"],
[use_libdar_api5="yes"]
)
AS_VERSION_COMPARE([`pkg-config --modversion gtkmm-3.0`],[3.6.0],
[set_always_show_image="no"],
[set_always_show_image="yes"],
[set_always_show_image="yes"]
)
if test "$libdar_with_date_as_time" = "yes"
then
AC_DEFINE([LIBDAR_WITH_DATE_AS_TIME],[1],[LIBDAR_WITH_DATE_AS_TIME])
fi
if test "$get_children_in_table" = "yes"
then
AC_DEFINE([GET_CHILDREN_IN_TABLE],[1],[GET_CHILDREN_IN_TABLE])
fi
if test "$set_always_show_image" = "yes"
then
AC_DEFINE([SET_ALWAYS_SHOW_IMAGE],[1],[SET_ALWAYS_SHOW_IMAGE])
fi
if test "$use_libdar_api5" = "yes"
then
AC_DEFINE([LIBDAR5],[1],[LIBDAR5])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
# Checks for library functions.
#AC_DEFINE([ICON_DIR],[$(datadir)/share/icons/gdar],[ICON_DOR])
AC_CONFIG_FILES([Makefile
src/Makefile
test/Makefile
po/Makefile.in
])
AC_OUTPUT
echo
echo "Enabled features:"
echo " libdar children in table: $get_children_in_table"
echo " libdar support date_s: $libdar_with_date_as_time"
echo " use libdar API v5: $use_libdar_api5"
echo " gtk always show image: $set_always_show_image"
echo " debug build: $debug"