-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
57 lines (43 loc) · 1.82 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
AC_INIT([circada], [0.5.1], [[email protected]])
AM_INIT_AUTOMAKE
LT_INIT
AC_LANG(C++)
AC_PROG_CXX
AC_CONFIG_MACRO_DIR([m4])
CXXFLAGS="${CXXFLAGS} -pedantic"
# --- check for header file ---
AC_HEADER_DIRENT
AC_HEADER_STDC
# --- silent rules ---
AM_SILENT_RULES([yes])
# --- check for libraries ---
AC_CHECK_LIB([pthread], [pthread_create], [], [missing_libraries="$missing_libraries libpthread"])
AC_CHECK_LIB([ncursesw], [refresh], [], [missing_libraries="$missing_libraries libncursesw"])
AC_CHECK_LIB([gnutls], [gnutls_global_init], [], [missing_libraries="$missing_libraries libgnutls"])
AC_CHECK_LIB([lua], [luaL_newstate], [], [missing_libraries="$missing_libraries lua"])
AC_CHECK_HEADER([gnutls/gnutls.h], [], [$missing_headers gnutls/gnutls.h])
AC_CHECK_HEADER([gnutls/gnutlsxx.h], [], [$missing_headers gnutls/gnutlsxx.h])
# --- compile args ---
AC_ARG_ENABLE([build-library], [ --enable-build-library Enable build and installing of circada shared library], [BUILD_LIBRARY="yes"], [])
AM_CONDITIONAL([BUILD_LIBRARY], [test "x$BUILD_LIBRARY" = xyes])
# --- bail out on errors ---
if test ! -z "$missing_libraries"; then
AC_MSG_ERROR([missing libraries: $missing_libraries])
fi
if test ! -z "$missing_headers"; then
AC_MSG_ERROR([missing header files: $missing_headers])
fi
# --- ready ---
AC_CONFIG_FILES([Makefile src/libcircada/Makefile src/libcircada/include/Makefile src/circada/Makefile])
AC_OUTPUT
# --- summary ---
AC_MSG_NOTICE([])
AC_MSG_NOTICE([--- SUMMARY ---])
if test "x$BUILD_LIBRARY" = "xyes"; then
AC_MSG_NOTICE([ * circada library will be installed])
AC_MSG_NOTICE([ NOTICES: - run ldconfig after installation])
AC_MSG_NOTICE([ - you will find your header files in eg. /usr/local/include])
else
AC_MSG_NOTICE([ * circada library will NOT be installed, linking statically])
fi
AC_MSG_NOTICE([])