-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
172 lines (128 loc) · 3.28 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
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
AC_INIT([porg],[svn],[http://porg.sourceforge.net])
#RELEASEDATE="17 May 2016"
RELEASEDATE="`date +'%d %B %Y'`"
AC_CONFIG_SRCDIR([porg/main.cc])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([build])
AM_INIT_AUTOMAKE([-Wall foreign no-installinfo no-texinfo.tex])
AM_MAINTAINER_MODE
AC_CONFIG_FILES([ \
Makefile \
config-bot.h \
lib/Makefile \
lib/porg/Makefile \
lib/porg-log/Makefile \
porg/Makefile \
grop/Makefile \
scripts/Makefile \
scripts/paco2porg \
scripts/porgball \
doc/Makefile \
doc/porgrc \
doc/porgrc.5 \
doc/porg.8 \
doc/porgball.8 \
])
AC_USE_SYSTEM_EXTENSIONS
#=======================
# Set configure options
#=======================
if echo "$PACKAGE_VERSION" | grep -q svn; then
AC_DEFINE([GTK_DISABLE_DEPRECATED], [1], [Disable gtkmm-2.4 API])
else
AC_DEFINE([NDEBUG], [1], [Disable libc assertions])
## AC_DEFINE([G_DISABLE_ASSERT], [1], [Disable glib assertions])
fi
AC_DEFINE_UNQUOTED([RELEASEDATE], ["$RELEASEDATE"], [Release date])
AC_SUBST([RELEASEDATE])
EXCLUDE="/tmp"
for dir in /dev /proc /selinux /sys /run; do
test -e "$dir" && EXCLUDE="$EXCLUDE:$dir"
done
AC_DEFINE_UNQUOTED([EXCLUDE], ["$EXCLUDE"], [List of paths to skip])
AC_SUBST([EXCLUDE])
AC_ARG_WITH([porg-logdir],
[AS_HELP_STRING([--with-porg-logdir=DIR],[porg log directory [default=/var/log/porg]])],
[LOGDIR=$withval], [LOGDIR=/var/log/porg]
)
AC_DEFINE_UNQUOTED([LOGDIR], ["$LOGDIR"], [Default porg logs directory])
AC_SUBST([LOGDIR])
AC_ARG_ENABLE([grop],
AS_HELP_STRING([--disable-grop],[do not install grop (the GUI of porg)]),
[enable_grop=$enableval], [enable_grop=yes])
AM_CONDITIONAL([ENABLE_GROP], [test "$enable_grop" = yes])
#================
# Check programs
#================
AM_PROG_AR
LT_INIT
AC_PROG_SED
AC_PROG_CC
AC_PROG_CXX
#============
# Check libs
#============
AC_SEARCH_LIBS([dlopen], [dl], [], AC_MSG_ERROR([*** dlopen not found ***]))
if test "$enable_grop" = yes; then
PKG_CHECK_MODULES([GTKMM], [gtkmm-3.0 >= 3.4.0])
fi
#===============
# Check headers
#===============
#=============
# Check types
#=============
AC_TYPE_SIZE_T
AC_CHECK_TYPE([uint], [unsigned int])
AC_CHECK_TYPE([ulong], [unsigned long])
AC_CHECK_TYPE([ino_t], [unsigned long])
#================
# Check compiler
#================
MY_CFLAGS=-W
MY_CXXFLAGS=-W
if test "$GCC" = yes; then
MY_CFLAGS="$MY_CFLAGS -ansi -Wshadow -Wmissing-declarations -Wall -Wno-nonnull-compare"
fi
if test "$GXX" = yes; then
MY_CXXFLAGS="$MY_CXXFLAGS -ansi -pedantic -Wall -fno-operator-names -std=c++11 -Wno-deprecated-declarations -Wno-nonnull-compare"
fi
if echo "$PACKAGE_VERSION" | grep -q svn; then
MY_CFLAGS="$MY_CFLAGS -Werror"
MY_CXXFLAGS="$MY_CXXFLAGS -Werror"
fi
AC_SUBST([MY_CXXFLAGS])
AC_SUBST([MY_CFLAGS])
#=============
# Check funcs
#=============
AC_CHECK_FUNCS_ONCE([ \
openat \
renameat \
linkat \
symlinkat \
open64 \
creat64 \
fopen64 \
freopen64 \
openat64
])
AC_CHECK_DECLS([__open, __open64], [], [], [[#include <fcntl.h>]])
#========
# Output
#========
AH_TOP([
#ifndef PORG_CONFIG_H
#define PORG_CONFIG_H 1
])
AH_BOTTOM([
#include "config-bot.h"
#endif
])
# for config-bot.h:
AC_SUBST([ac_includes_default])
AC_OUTPUT