File configure.ac changed (mode: 100644) (index d20ee51..bbd33e3) |
1 |
1 |
# configure.ac Autoconf configuration file |
# configure.ac Autoconf configuration file |
2 |
2 |
# process this file with autoconf to produce a configure script |
# process this file with autoconf to produce a configure script |
3 |
3 |
# |
# |
4 |
|
# Copyright (C) 2014 Martin Dvorak <martin.dvorak@mindforger.com> |
|
|
4 |
|
# Copyright (C) 2014-2017 Martin Dvorak <martin.dvorak@mindforger.com> |
5 |
5 |
# |
# |
6 |
6 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
# Licensed under the Apache License, Version 2.0 (the "License"); |
7 |
7 |
# you may not use this file except in compliance with the License. |
# you may not use this file except in compliance with the License. |
|
... |
... |
AM_INIT_AUTOMAKE |
29 |
29 |
# Checks for programs. |
# Checks for programs. |
30 |
30 |
AC_PROG_CC |
AC_PROG_CC |
31 |
31 |
|
|
32 |
|
# Determine OS for NCURSES check |
|
|
32 |
|
# NCURSES check w/o PKG_CHECK_MODULES macro |
|
33 |
|
# Determine OS |
33 |
34 |
AC_CANONICAL_HOST |
AC_CANONICAL_HOST |
34 |
|
# Platform specific ncurses check: if NCURSES not found, then look for ncurses |
|
35 |
|
AC_MSG_NOTICE([IMPORTANT: Make sure you have pkg-tools installed - it's needed to run this script]) |
|
36 |
|
PKG_CHECK_MODULES([NCURSES], [ncursesw], |
|
37 |
|
[AC_MSG_NOTICE([Module ncursesw found])], |
|
38 |
|
[PKG_CHECK_MODULES([NCURSES], [ncurses], |
|
39 |
|
[AC_MSG_NOTICE([Module ncurses found])], |
|
40 |
|
[AS_CASE([$host_os], |
|
41 |
|
[darwin*], |
|
42 |
|
[ |
|
43 |
|
AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])]) |
|
44 |
|
AC_CHECK_HEADER(curses.h) |
|
45 |
|
], |
|
46 |
|
[ |
|
47 |
|
AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])]) |
|
48 |
|
AC_CHECK_HEADER(ncursesw/curses.h) |
|
49 |
|
]) |
|
50 |
|
] |
|
51 |
|
) |
|
52 |
|
] |
|
53 |
|
) |
|
|
35 |
|
# Notify user that pkg-tools are required |
|
36 |
|
AC_MSG_NOTICE([===================================================================================]) |
|
37 |
|
AC_MSG_NOTICE([IMPORTANT: Make sure you have pkg-config installed - it's needed to run this script]) |
|
38 |
|
AC_MSG_NOTICE([===================================================================================]) |
|
39 |
|
# PKG_CHECK_MODULES macro is NOT used to avoid confusing syntax errors in case that pkg-config is NOT installed |
|
40 |
|
AC_SUBST([NCURSESW_CFLAGS]) |
|
41 |
|
AC_SUBST([NCURSESW_LIBS]) |
|
42 |
|
if pkg-config --exists ncursesw |
|
43 |
|
then |
|
44 |
|
AC_MSG_NOTICE([Module ncursesw found]) |
|
45 |
|
NCURSESW_CFLAGS=`pkg-config --cflags ncursesw` |
|
46 |
|
NCURSESW_LIBS=`pkg-config --libs ncursesw` |
|
47 |
|
else |
|
48 |
|
if pkg-config --exists ncurses |
|
49 |
|
then |
|
50 |
|
AC_MSG_NOTICE([Module ncurses found]) |
|
51 |
|
NCURSESW_CFLAGS=`pkg-config --cflags ncursesw` |
|
52 |
|
NCURSESW_LIBS=`pkg-config --libs ncurses` |
|
53 |
|
else |
|
54 |
|
AS_CASE([$host_os], |
|
55 |
|
[darwin*], |
|
56 |
|
[ |
|
57 |
|
AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])]) |
|
58 |
|
AC_CHECK_HEADER(curses.h) |
|
59 |
|
], |
|
60 |
|
[ |
|
61 |
|
AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])]) |
|
62 |
|
AC_CHECK_HEADER(ncursesw/curses.h) |
|
63 |
|
] |
|
64 |
|
) |
|
65 |
|
fi |
|
66 |
|
fi |
54 |
67 |
|
|
55 |
68 |
# Checks for libraries. |
# Checks for libraries. |
56 |
69 |
AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])]) |
AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])]) |