/
geany-lib.m4
37 lines (32 loc) · 1.15 KB
/
geany-lib.m4
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
AC_DEFUN([GEANY_LIB_INIT],
[
dnl In the future, if we want to use libtool/library versioning, we can
dnl set these variables accordingly. For now its the same as if not specified (0:0:0)
libgeany_current=0
libgeany_revision=0
libgeany_age=0
dnl Try and see if we can use -fvisibility compiler option and GCC`s
dnl `__attribute__((visibility(...)))` extension and use it if so.
AC_MSG_CHECKING([whether compiler supports -fvisibility])
libgeany_backup_cflags=$CFLAGS
CFLAGS=-fvisibility=hidden
AC_TRY_COMPILE([], [
__attribute__ ((visibility ("default")))
int main(int argc, char **argv) { return 0; }
], [
LIBGEANY_CFLAGS="${CFLAGS}"
AC_MSG_RESULT([yes])
], [
LIBGEANY_CFLAGS=""
AC_MSG_RESULT([no])
])
CFLAGS="${libgeany_backup_cflags}"
LIBGEANY_LDFLAGS="-version-info ${libgeany_current}:${libgeany_revision}:${libgeany_age}"
AC_SUBST([LIBGEANY_CFLAGS])
AC_SUBST([LIBGEANY_LDFLAGS])
dnl Check for utilities needed to do codegen
AC_PATH_PROG([SORT], [sort], [
AC_MSG_ERROR([The 'sort' utility is required, is it installed?])])
AC_PATH_PROG([UNIQ], [uniq], [
AC_MSG_ERROR([The 'uniq' utility is required, is it installed?])])
])