2014-10-13 23:07:11 -07:00
|
|
|
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}"
|
|
|
|
|
2014-10-28 15:27:41 +01:00
|
|
|
LIBGEANY_LDFLAGS="-version-info ${libgeany_current}:${libgeany_revision}:${libgeany_age}"
|
2014-10-13 23:07:11 -07:00
|
|
|
|
|
|
|
AC_SUBST([LIBGEANY_CFLAGS])
|
2014-10-28 15:27:41 +01:00
|
|
|
AC_SUBST([LIBGEANY_LDFLAGS])
|
2014-10-13 23:07:11 -07:00
|
|
|
|
2014-10-19 13:49:58 -07:00
|
|
|
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?])])
|
2014-10-13 23:07:11 -07:00
|
|
|
])
|