-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
147 lines (127 loc) · 4.21 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([soccerwindow2], [2023], [[email protected]])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
# ----------------------------------------------------------
#AM_INIT_AUTOMAKE([gnu check-news])
AM_INIT_AUTOMAKE([gnu])
# it is necessary to check c++ header files.
AC_LANG([C++])
# ----------------------------------------------------------
# Checks for programs.
#AC_PROG_AWK
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
# ----------------------------------------------------------
# Checks for configure options
#AC_ARG_ENABLE(static,
# [ --enable-static statically linked],
# [ enable_static=$enableval ],
# [ enable_static=no ])
#if test "$enable_static" == "yes"; then
# CFLAGS="-static $CFLAGS"
# CXXFLAGS="-static $CXXFLAGS"
#fi
# ----------------------------------------------------------
# check Qt
AX_HAVE_QT
if test "x$have_qt" != "xyes"; then
AC_MSG_ERROR([Qt not found.])
AM_CONDITIONAL(BUILD_QT, [test "1" = "0"])
else
AM_CONDITIONAL(BUILD_QT, [test "1" = "1"])
fi
# ----------------------------------------------------------
# check C++
AX_CXX_COMPILE_STDCXX_17(noext)
# ----------------------------------------------------------
# check boost
AX_BOOST_BASE([1.38.0])
AX_BOOST_SYSTEM
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
LIBS="$LIBS $BOOST_SYSTEM_LIB"
# check boost library for wx
#if test "x$enable_wx" == "xyes"; then
# AX_BOOST_SIGNALS
#fi
# check librcsc path
AC_SUBST(LIBRCSCLIB)
LIBRCSCLIB="/usr/local/lib"
librcsc_prefix=""
AC_ARG_WITH(librcsc,
[ --with-librcsc=PREFIX prefix where librcsc is installed (optional)],
librcsc_prefix="$withval",
librcsc_prefix="")
if test x$librcsc_prefix != x; then
CPPFLAGS="$CPPFLAGS -I$librcsc_prefix/include"
LDFLAGS="$LDFLAGS -L$librcsc_prefix/lib"
LIBRCSCLIB="$librcsc_prefix/lib"
else
for librcsc_path_tmp in $HOME/local $HOME/.local /opt/local /usr/local /usr; do
if test -d "$librcsc_path_tmp/include/rcsc" && test -r "$librcsc_path_tmp/include/rcsc/types.h" ; then
CPPFLAGS="$CPPFLAGS -I$librcsc_path_tmp/include"
LDFLAGS="$LDFLAGS -L$librcsc_path_tmp/lib"
LIBRCSCLIB="$librcsc_path_tmp/lib"
break;
fi
done
fi
# ----------------------------------------------------------
# Checks for libraries.
AC_CHECK_LIB([m], [cos],
[LIBS="-lm $LIBS"],
[AC_MSG_ERROR([*** -lm not found! ***])])
AC_CHECK_LIB([z], [deflate])
AC_CHECK_LIB([rcsc], [main],
[LIBS="-lrcsc $LIBS"],
[AC_MSG_ERROR([*** -lrcsc not found! ***])])
# ----------------------------------------------------------
# Checks for header files.
AC_CHECK_HEADERS([netinet/in.h],
break,
[AC_MSG_ERROR([*** netinet/in.h not found ***])])
# ----------------------------------------------------------
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_TM
# ----------------------------------------------------------
# Checks for library functions.
AC_HEADER_STDC
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
#AC_CHECK_FUNCS([atexit],
# break,
# [AC_MSG_ERROR([*** atexit function not found!])])
AC_CHECK_FUNCS([floor memset pow rint sqrt strtol])
AC_CHECK_FUNC([rint],
break,
[AC_CHECK_LIB(m, rint, break,
[AC_MSG_ERROR([*** rint function not found!])]
)
]
)
# ----------------------------------------------------------
#CFLAGS="$CFLAGS $SDL_CFLAGS"
#CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
#LIBS="$LIBS $SDL_LIBS"
# ----------------------------------------------------------
AC_CONFIG_FILES([Doxyfile
soccerwindow2.spec
Makefile
src/sswindow2
src/Makefile
src/model/Makefile
src/qt/Makefile],
[test -f src/sswindow2 && chmod +x src/sswindow2])
AC_OUTPUT