This repository has been archived by the owner on Jan 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
147 lines (129 loc) · 5.32 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
################################################################
# Process this file with autoconf to produce a configure script.
################################################################
AC_PREREQ([2.68])
AC_INIT([KISS Player], [0.7.1], [andre42m@gmail.com], [kissplayer], [https://github.com/andreldm/kissplayer])
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_MACRO_DIR(m4)
####################################
# Check platform
####################################
AC_CANONICAL_TARGET
AC_MSG_CHECKING([operating system type])
case "$target" in
*linux*)
os=linux
AC_MSG_RESULT([Linux])
;;
*mingw*|*msys*)
os=windows
AC_MSG_RESULT([Windows])
;;
*)
AC_MSG_ERROR(["Unrecognised target OS: $target"])
;;
esac
AM_CONDITIONAL(LINUX, test "x$os" = "xlinux")
AM_CONDITIONAL(WINDOWS, test "x$os" = "xwindows")
case "$target" in
*64*)
arch=64
;;
esac
AM_CONDITIONAL(IS64BIT, test "x$arch" = "x64")
####################################
# Debug compilation support
####################################
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (def=no)])],
[debugit="$enableval"],
[debugit=no])
AC_MSG_RESULT([$debugit])
if test x"$debugit" = x"yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
AM_CFLAGS="$AM_CFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0"
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
AM_CFLAGS="$AM_CFLAGS -O2"
AM_CXXFLAGS="$AM_CXXFLAGS -O2"
fi
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
####################################
# Init
####################################
AC_CONFIG_SRCDIR([src/main.cpp])
#AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11 subdir-objects foreign])
AM_SILENT_RULES([yes])
####################################
# Check for programs
####################################
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
####################################
# Check for headers
####################################
AC_CHECK_HEADERS([unistd.h])
####################################
# Check for libraries
####################################
if test "x$os" = "xlinux"; then
AC_CHECK_LIB([X11], [main], [], [echo "libX11 is required for this program"; exit -1])
AC_CHECK_LIB([Xext], [main], [], [echo "libXext is required for this program"; exit -1])
AC_CHECK_LIB([Xft], [main], [], [echo "libXft is required for this program"; exit -1])
AC_CHECK_LIB([Xtst], [main], [], [echo "libXtst is required for this program"; exit -1])
AC_CHECK_LIB([Xpm], [main], [], [echo "libXpm is required for this program"; exit -1])
AC_CHECK_LIB([Xinerama], [main], [], [echo "libXinerama is required for this program"; exit -1])
AC_CHECK_LIB([fontconfig], [main], [], [echo "libfontconfig is required for this program"; exit -1])
AC_CHECK_LIB([pthread], [main], [], [echo "libpthread is required for this program"; exit -1])
AC_CHECK_LIB([dl], [main], [], [echo "libdl is required for this program"; exit -1])
if test "x$arch" = "x64"; then
AC_CHECK_LIB([fmodex64], [main], [], [echo "libfmodex64 is required for this program"; exit -1])
else
AC_CHECK_LIB([fmodex], [main], [], [echo "libfmodex required for this program"; exit -1])
fi
elif test "x$os" = "xwindows"; then
AC_CHECK_LIB([ole32], [main], [], [echo "libole32 is required for this program"; exit -1])
AC_CHECK_LIB([uuid], [main], [], [echo "libuuid is required for this program"; exit -1])
AC_CHECK_LIB([comctl32], [main], [], [echo "libcomctl32 is required for this program"; exit -1])
AC_CHECK_LIB([wsock32], [main], [], [echo "libwsock32 is required for this program"; exit -1])
AC_CHECK_LIB([gdi32], [main], [], [echo "libgdi32 is required for this program"; exit -1])
AC_CHECK_LIB([comdlg32], [main], [], [echo "libcomdlg32 is required for this program"; exit -1])
AC_CHECK_LIB([ws2_32], [main], [], [echo "libcomdlg32 is required for this program"; exit -1])
AC_CHECK_LIB([intl], [main], [], [echo "libintl is required for this program"; exit -1])
AC_CHECK_LIB([fmodex], [main], [], [echo "libfmod required for this program"; exit -1])
fi
AC_CHECK_LIB([z], [main])
AC_CHECK_LIB([png], [png_sig_cmp], [], [echo "libpng is required for this program"; exit -1])
AC_CHECK_LIB([sqlite3], [sqlite3_close], [], [echo "libsqlite3 is required for this program"; exit -1])
AC_CHECK_LIB([tag], [read], [], [echo "TagLib is required for this program"; exit -1])
AC_CHECK_LIB([fltk], [main], [], [echo "FLTK is required for this program"; exit -1])
AC_CHECK_LIB([fltk_images], [main], [], [echo "libfltk_images is required for this program"; exit -1])
AC_CHECK_LIB([curl], [main], [], [echo "libcurl required for this program"; exit -1])
PKG_CHECK_MODULES([LIBSIGC], [sigc++-2.0])
####################################
# Support for the po directory
####################################
AM_PO_SUBDIRS
AC_CONFIG_FILES([
Makefile
data/Makefile
data/kissplayer.desktop
data/icons/Makefile
data/icons/hicolor/Makefile
data/icons/hicolor/48x48/Makefile
data/icons/hicolor/48x48/apps/Makefile
data/icons/hicolor/64x64/Makefile
data/icons/hicolor/64x64/apps/Makefile
data/icons/hicolor/scalable/Makefile
data/icons/hicolor/scalable/apps/Makefile
m4/Makefile
])
AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE])
AC_OUTPUT