Bump API version for new plugin entry points (oops)
[geany-mirror.git] / m4 / geany-lib.m4
blobce4cf3b377bdd08a41bc1c9bf44c9b236937278a
1 dnl checks whether the compiler supports GCC4-style visibility
2 AC_DEFUN([GCC4_VISIBILITY],
4         have_gcc4_visibility=no
5         AC_MSG_CHECKING([whether compiler supports GCC4-style visibility])
6         gcc_visibility_backup_cflags=$CFLAGS
7         CFLAGS=-fvisibility=hidden
8         AC_LINK_IFELSE([AC_LANG_SOURCE([[__attribute__((visibility("default")))
9                                                                          int main(int argc, char **argv) { return 0; }]])],
10                                    [have_gcc4_visibility=yes])
11         AC_MSG_RESULT([$have_gcc4_visibility])
12         CFLAGS="${gcc_visibility_backup_cflags}"
15 dnl Checks and fills LIBGEANY_EXPORT_CFLAGS
16 AC_DEFUN([GEANY_EXPORT],
18         AC_REQUIRE([GEANY_CHECK_MINGW])
19         AC_REQUIRE([GCC4_VISIBILITY])
21         dnl FIXME: better way to detect Windows?
22         AM_COND_IF([MINGW], [win32=yes], [win32=false])
24         export_CFLAGS=
25         AS_IF([test x$win32 = xyes],
26                   [export_CFLAGS='-DGEANY_EXPORT_SYMBOL="__declspec(dllexport)"'],
27                   [test x$have_gcc4_visibility = xyes],
28                   [export_CFLAGS='-fvisibility=hidden -DGEANY_EXPORT_SYMBOL="__attribute__((visibility(\"default\")))"'],
29                   [dnl GEANY_EXPORT_SYMBOL expands to nothing
30                    export_CFLAGS='-DGEANY_EXPORT_SYMBOL'])
32         LIBGEANY_EXPORT_CFLAGS="${export_CFLAGS} -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL"
34         AC_SUBST([LIBGEANY_EXPORT_CFLAGS])
37 AC_DEFUN([GEANY_LIB_INIT],
39         AC_REQUIRE([GEANY_EXPORT])
41 dnl In the future, if we want to use libtool/library versioning, we can
42 dnl set these variables accordingly. For now its the same as if not specified (0:0:0)
43         libgeany_current=0
44         libgeany_revision=0
45         libgeany_age=0
47         LIBGEANY_CFLAGS="${LIBGEANY_EXPORT_CFLAGS}"
48         LIBGEANY_LDFLAGS="-version-info ${libgeany_current}:${libgeany_revision}:${libgeany_age}"
50         AC_SUBST([LIBGEANY_CFLAGS])
51         AC_SUBST([LIBGEANY_LDFLAGS])
53 dnl Check for utilities needed to do codegen
54         AC_PATH_PROG([SORT], [sort], [
55                 AC_MSG_ERROR([The 'sort' utility is required, is it installed?])])
56         AC_PATH_PROG([UNIQ], [uniq], [
57                 AC_MSG_ERROR([The 'uniq' utility is required, is it installed?])])