-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathconfigure.ac
More file actions
215 lines (183 loc) · 5.54 KB
/
configure.ac
File metadata and controls
215 lines (183 loc) · 5.54 KB
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
#----------------------------------------------------------------------
# configure.ac - FINAL CUT library
#----------------------------------------------------------------------
# Process this file with autoconf to produce a configure script.
AC_INIT([finalcut], [0.9.2])
# Check for autoconf-archive
m4_ifndef([AX_PREFIX_CONFIG_H], [
m4_fatal([
-------------------------------------------------------------------------
Error: autoconf-archive is not installed. Please install the package
and run this command again.
-------------------------------------------------------------------------])
])
m4_pattern_forbid([^AX_])
# Check for pkg-config
AC_PATH_PROG([PKG_CONFIG], [pkg-config])
if test -z "$PKG_CONFIG"
then
AC_MSG_ERROR([
-------------------------------------------------------------------------
Error: pkg-config is not installed. Please install 'pkg-config'.
-------------------------------------------------------------------------])
fi
AC_CONFIG_HEADERS([config.h])
AX_PREFIX_CONFIG_H([final/fconfig.h], [F])
AC_CONFIG_SRCDIR([final/fobject.cpp])
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-zip])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CC
if test -z "$CXXFLAGS"
then
CXXFLAGS="-O3"
fi
AC_PROG_CXX
# Checks for header files.
AC_CHECK_HEADERS( \
linux/fb.h \
sys/io.h \
sys/kd.h \
sys/stat.h \
sys/time.h \
fcntl.h \
langinfo.h \
term.h \
termios.h \
ttyent.h \
unistd.h \
cmath \
csignal \
cstdlib \
list \
map \
queue \
vector )
# Checks for library functions.
AC_CHECK_FUNCS( \
geteuid \
getttynam \
getuid \
pthread_rwlock_wrlock \
select \
sigaction \
strdup \
strstr \
timer_create \
timer_settime \
vsnprintf \
wcwidth )
# Checks for 'pthread_rwlock_wrlock'
AC_SEARCH_LIBS([pthread_rwlock_wrlock], [pthread])
# Checks for 'timer_create'
AC_SEARCH_LIBS([timer_create], [rt])
# Checks for 'timer_settime'
AC_SEARCH_LIBS([timer_settime], [rt])
# Checks for 'tgetent'
AC_SEARCH_LIBS([tgetent], [terminfo mytinfo termlib termcap tinfo ncurses curses])
# Checks for 'tparm'
AC_SEARCH_LIBS([tparm], [terminfo mytinfo termlib termcap tinfo ncurses curses])
AC_SUBST([FINAL_LIBS])
AC_SUBST([TERMCAP_LIB])
TERMCAP_LIB="$LIBS"
FINAL_LIBS="$LIBS"
LIBS=""
# Checks for libtool
AC_ENABLE_SHARED
AC_ENABLE_STATIC
AC_LANG([C++])
LT_INIT([dlopen])
LT_LANG([C++])
LT_OUTPUT
### This defines the version number of the installed .so files
### Update this value for every release! (A:B:C will map to foo.so.(A-C).C.B)
### using libtool's versioning system.
AC_SUBST(SO_VERSION, ["9:2:9"])
AC_SUBST([LIBTOOL_DEPS])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_FILES([Makefile
final/Makefile
final/font/Makefile
doc/Makefile
examples/Makefile
test/Makefile
finalcut.pc])
# Check for C++14 support
m4_ifdef([AX_CXX_COMPILE_STDCXX_14],
[AX_CXX_COMPILE_STDCXX_14([noext],[mandatory])],
[AC_MSG_ERROR([Macro AX_CXX_COMPILE_STDCXX_14 not found. Please install GNU autoconf-archive])])
# Use GPM (General Purpose Mouse)
AC_ARG_WITH([gpm],
[AS_HELP_STRING([--without-gpm], [disable GPM mouse support])],
[],
[with_gpm=yes])
if test "x$with_gpm" != "xno"
then
AC_CHECK_LIB([gpm],
[Gpm_Open],
[AC_DEFINE([HAVE_LIBGPM], 1, [Define to 1 if GPM mouse is enabled])
FINAL_LIBS="$FINAL_LIBS -lgpm"])
fi
# Check for the cmake executable
AC_ARG_ENABLE([install-cmake-modules],
AS_HELP_STRING([--disable-install-cmake-modules],
[disables installing CMake modules (default is yes)]),
[install_cmake_modules=${enableval}],
[install_cmake_modules=yes])
AC_PATH_PROG([CMAKE],
[cmake])
AM_CONDITIONAL([INSTALL_CMAKE_MODULES], [test -n "$CMAKE" && test "x$install_cmake_modules" != "xno"])
if test -n "$CMAKE"
then
# Extract the module directory (e.g., /usr/share/cmake-3.25/Modules)
CMAKE_VERSION=`$CMAKE --version | sed -n 's/^cmake version \(.*\)/\1/p' | cut -d. -f1-2`
CMAKEMODULESDIR="/usr/share/cmake-$CMAKE_VERSION/Modules"
else
CMAKEMODULESDIR=""
fi
AC_SUBST([CMAKEMODULESDIR])
# Profiling
AC_ARG_WITH([profiler],
[AS_HELP_STRING([--with-profiler], [build extra google profiler binaries])],
[],
[with_profiler=no])
if test "x$with_profiler" != "xno"
then
AC_CHECK_LIB([profiler],
[ProfilerFlush],
[FINAL_LIBS="$FINAL_LIBS -lprofiler"])
fi
# Compile everything
AC_ARG_ENABLE([compile-all],
[AS_HELP_STRING([--enable-compile-all], [compiles the entire code])],
[compile_all=$enableval],
[compile_all=no])
# Unit test
AC_ARG_WITH([unit-test],
[AS_HELP_STRING([--with-unit-test], [build unit tests])],
[],
[with_unit_test=no])
if test "x$with_unit_test" != "xno"
then
AC_MSG_NOTICE(enabled cppunit test)
PKG_CHECK_MODULES(CPPUNIT,
[cppunit > 1.12.0])
AM_CONDITIONAL(CPPUNIT_TEST, [test "1" = "1"])
else
AM_CONDITIONAL(CPPUNIT_TEST, [test "1" = "0"])
fi
# Code coverage
AC_ARG_WITH([gcov],
[AS_HELP_STRING([--with-gcov], [build for code coverage testing])],
[],
[with_gcov=no])
if test "x$with_gcov" != "xno"
then
AC_CHECK_LIB([gcov],
[main],
[FINAL_LIBS="$FINAL_LIBS -lgcov"])
AM_CXXFLAGS="-fprofile-arcs -ftest-coverage $AM_CXXFLAGS"
AC_SUBST([AM_CXXFLAGS])
fi
AM_CONDITIONAL([COMPILE_EXAMPLES], [test "x$with_unit_test" = xno || test "x$compile_all" = xyes])
AC_OUTPUT