summaryrefslogtreecommitdiff
path: root/configure.ac.in
blob: 0483c8fa183994da6cff55d5319f155134659986 (plain)
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
dnl
dnl Copyright (c) 2004-2009 os-cillation.
dnl Copyright (c) 2009-2019 Xfce Development Team <xfce4-dev@xfce.org>
dnl All rights reserved.
dnl
dnl Written by Benedikt Meurer <benny@xfce.org>.
dnl

dnl ***************************
dnl *** Version information ***
dnl ***************************
m4_define([libexo_verinfo], [1:0:1])
m4_define([libexo_version_api], [2])
m4_define([libexo_version_major], [4])
m4_define([libexo_version_minor], [16])
m4_define([libexo_version_micro], [0])
m4_define([libexo_version_nano], [])
m4_define([libexo_version_build], [@REVISION@])
m4_define([libexo_version_tag], [git])
m4_define([libexo_version], [libexo_version_major().libexo_version_minor().libexo_version_micro()ifelse(libexo_version_nano(), [], [], [.libexo_version_nano()])ifelse(libexo_version_tag(), [git], [libexo_version_tag()-libexo_version_build()], [libexo_version_tag()])])

dnl ********************************************
dnl *** Full debug support for GIT snapshots ***
dnl ********************************************
m4_define([libexo_debug_default], [ifelse(libexo_version_tag(), [git], [yes], [minimum])])

dnl ****************************
dnl *** For intltool support ***
dnl ****************************
m4_define([intltool_minimum_version], [0.35])

dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2004-2010 os-cillation.
Copyright (c) 2004-2019 Xfce Development Team])
AC_INIT([exo], [libexo_version], [https://gitlab.xfce.org/xfce/exo])
AC_PREREQ([2.60])
AC_CONFIG_MACRO_DIRS([m4])
AC_REVISION([@REVISION@])
AC_CANONICAL_TARGET()

dnl ***************************
dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([1.11 dist-bzip2 tar-ustar no-dist-gzip foreign])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE()
AM_SILENT_RULES([yes])

dnl **************************
dnl *** Libtool versioning ***
dnl **************************
LIBEXO_VERINFO=libexo_verinfo()
AC_SUBST([LIBEXO_VERINFO])

dnl ****************************
dnl *** Subst libexo version ***
dnl ****************************
LIBEXO_VERSION_API=libexo_version_api()
LIBEXO_VERSION_MAJOR=libexo_version_major()
LIBEXO_VERSION_MINOR=libexo_version_minor()
LIBEXO_VERSION_MICRO=libexo_version_micro()
AC_SUBST([LIBEXO_VERSION_API])
AC_SUBST([LIBEXO_VERSION_MAJOR])
AC_SUBST([LIBEXO_VERSION_MINOR])
AC_SUBST([LIBEXO_VERSION_MICRO])

dnl ******************************
dnl *** Set helper path prefix ***
dnl ******************************
AC_ARG_WITH([helper-path-prefix],
            [AC_HELP_STRING([--with-helper-path-prefix=PATH],
                            [Path prefix under which helper executables will be installed (default: $libdir)])],
            [HELPER_PATH_PREFIX="$withval"],
            [HELPER_PATH_PREFIX="$libdir"])
AC_SUBST([HELPER_PATH_PREFIX])

dnl *******************************
dnl *** Check for UNIX variants ***
dnl *******************************
AC_AIX()
AC_ISC_POSIX()
AC_MINIX()

dnl ********************************
dnl *** Check for Win32 variants ***
dnl ********************************
AC_MSG_CHECKING([if building for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
  ac_bm_platform_win32=yes
  ;;
*)
  ac_bm_platform_win32=no
  ;;
esac
AC_MSG_RESULT([$ac_bm_platform_win32])
AM_CONDITIONAL([PLATFORM_WIN32], [test x"$ac_bm_platform_win32" = x"yes"])

dnl **************************
dnl *** Initialize libtool ***
dnl **************************
LT_PREREQ([2.4])
LT_INIT([disable-static])

dnl ********************************
dnl *** Check for basic programs ***
dnl ********************************
AM_PROG_AS()
AC_PROG_CC()
AM_PROG_CC_C_O()
AC_PROG_INSTALL()
IT_PROG_INTLTOOL([intltool_minimum_version], [no-xml])
AC_CHECK_PROGS([PERL], [perl5 perl])

dnl ***************************************
dnl *** Check for standard header files ***
dnl ***************************************
AC_HEADER_STDC()
AC_CHECK_HEADERS([assert.h errno.h fcntl.h fnmatch.h libintl.h \
                  locale.h math.h mmintrin.h paths.h regex.h \
                  signal.h stdarg.h string.h sys/mman.h \
                  sys/stat.h sys/time.h sys/types.h sys/wait.h time.h])

dnl ************************************
dnl *** Check for standard functions ***
dnl ************************************
AC_FUNC_MMAP()

dnl ***************************************************************************
dnl *** Check for strftime() extensions                                     ***
dnl ***                                                                     ***
dnl *** AC_TRY_RUN must be able to build and execute programs natively on   ***
dnl *** the build system, so it fails when cross-compiling unless given an  ***
dnl *** action in the fourth parameter.  This sets its results in a cache   ***
dnl *** variable that users can override to specify target system behavior. ***
dnl ***************************************************************************
AC_CACHE_CHECK([for strftime %E and %O modifiers],
  [ac_cv_have_strftime_extension], [AC_TRY_RUN([
  #include <string.h>
  #include <time.h>
  int
  main (int argc, char **argv)
  {
    struct tm tm;
    char      buffer[16];
    tm.tm_year = 81;
    if (strftime (buffer, 16, "%EY", &tm) == 4 && strcmp (buffer, "1981") == 0)
      return 0;
    return 1;
  }
    ],
    [ac_cv_have_strftime_extension=yes],
    [ac_cv_have_strftime_extension=no],
    [ac_cv_have_strftime_extension=cross])])
if test x"$ac_cv_have_strftime_extension" != x"no"; then
  AC_DEFINE([HAVE_STRFTIME_EXTENSION], 1, [Define if strftime supports %E and %O modifiers.])
fi

dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
XDT_I18N([@LINGUAS@], [exo-libexo_version_api()])

dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.50.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.50.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.22.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.50.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.15.1])
XDT_CHECK_OPTIONAL_PACKAGE([GIO_UNIX], [gio-unix-2.0], [2.50.0], [gio-unix], [GIO-Unix features])

dnl *********************
dnl *** Check for X11 ***
dnl *********************
XDT_CHECK_LIBX11_REQUIRE()

dnl *************************
dnl *** Check for gtk-doc ***
dnl *************************
GTK_DOC_CHECK([1.9])

dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
XDT_FEATURE_DEBUG([libexo_debug_default])

dnl **************************************
dnl *** Check for linker optimizations ***
dnl **************************************
XDT_FEATURE_LINKER_OPTS()

dnl ****************************************
dnl *** Check for ELF visibility support ***
dnl ****************************************
AC_ARG_ENABLE([visibility], AC_HELP_STRING([--disable-visibility], [Do not use ELF visibility attributes]), [], [enable_visibility=yes])
have_gnuc_visibility=no
if test x"$enable_visibility" != x"no"; then
  dnl Check whether the compiler supports the visibility attribute
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -Wall -Werror"
  AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
  AC_COMPILE_IFELSE([AC_LANG_SOURCE(
  [
    void test_default (void);
    void test_hidden (void);

    void __attribute__ ((visibility("default"))) test_default (void) {}
    void __attribute__ ((visibility("hidden"))) test_hidden (void) {}

    int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
  ])],
  [
    have_gnuc_visibility=yes
    AC_MSG_RESULT([yes])
  ],
  [
    AC_MSG_RESULT([no])
  ])
  CFLAGS="$save_CFLAGS"
fi
if test x"$have_gnuc_visibility" = x"yes"; then
  CPPFLAGS="$CPPFLAGS -DHAVE_GNUC_VISIBILITY"
fi
AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test x"$have_gnuc_visibility" = x"yes"])

dnl *************************************
dnl *** Use GSEAL if possible         ***
dnl *************************************
XDT_SUPPORTED_FLAGS([CFLAGS], [-DGSEAL_ENABLE])

AC_OUTPUT([
Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
exo/Makefile
exo/exo-2.pc
exo/exo-config.h
exo-desktop-item-edit/Makefile
exo-open/Makefile
icons/Makefile
icons/24x24/Makefile
icons/48x48/Makefile
pixmaps/Makefile
po/Makefile.in
tests/Makefile
])

dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
echo "* Debug Support:        $enable_debug"
echo "* GNU Visibility:       $have_gnuc_visibility"
echo