1 AC_DEFUN([GEANY_LIB_INIT],
4 dnl In the future, if we want to use libtool/library versioning, we can
5 dnl set these variables accordingly. For now its the same as if not specified (0:0:0)
10 dnl Try and see if we can use -fvisibility compiler option and GCC`s
11 dnl `__attribute__((visibility(...)))` extension and use it if so.
12 AC_MSG_CHECKING([whether compiler supports -fvisibility])
13 libgeany_backup_cflags=$CFLAGS
14 CFLAGS=-fvisibility=hidden
16 __attribute__ ((visibility ("default")))
17 int main(int argc, char **argv) { return 0; }
19 LIBGEANY_CFLAGS="${CFLAGS}"
25 CFLAGS="${libgeany_backup_cflags}"
27 dnl Try and see if we can use our list of dynamically exported symbols with
28 dnl the linker and use it if so.
29 AC_MSG_CHECKING([whether linker supports --dynamic-list])
30 libgeany_backup_ldflags=$LDFLAGS
31 LDFLAGS=-Wl,--dynamic-list="${srcdir}/src/dynamicsymbols.list"
33 AC_LANG_PROGRAM([], [])
35 LIBGEANY_LIBS="-Wl,--dynamic-list=\"\$(top_srcdir)/src/dynamicsymbols.list\""
41 LDFLAGS="${libgeany_backup_ldflags}"
43 LIBGEANY_LIBS="${LIBGEANY_LIBS} -version-info ${libgeany_current}:${libgeany_revision}:${libgeany_age}"
45 AC_SUBST([LIBGEANY_CFLAGS])
46 AC_SUBST([LIBGEANY_LIBS])