Branch: refs/heads/master Author: Matthew Brush matt@geany.org Committer: Thomas Martitz kugel@rockbox.org Date: Tue, 10 Mar 2015 22:10:06 UTC Commit: eb36500ac425c2b4f038bbcb1d3e38f353f0402c https://github.com/geany/geany/commit/eb36500ac425c2b4f038bbcb1d3e38f353f040...
Log Message: ----------- Improve Autotools build system for libgeany
Checks if the compiler supports -fvisibility and the linker supports -dynamic-list arguments and use them instead of hardcoding. The new geany-lib.m4 also accomodates future use of Libtool versioning.
Modified Paths: -------------- configure.ac m4/geany-lib.m4 scintilla/Makefile.am src/Makefile.am tagmanager/ctags/Makefile.am tagmanager/mio/Makefile.am tagmanager/src/Makefile.am
Modified: configure.ac 3 lines changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -122,6 +122,9 @@ AC_SUBST([pkgdatadir]) GEANY_CHECK_DOCUTILS GEANY_CHECK_DOXYGEN
+# libgeany +GEANY_LIB_INIT + # Output AC_CONFIG_FILES([ Makefile
Modified: m4/geany-lib.m4 48 lines changed, 48 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,48 @@ +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}" + +dnl Try and see if we can use our list of dynamically exported symbols with +dnl the linker and use it if so. + AC_MSG_CHECKING([whether linker supports --dynamic-list]) + libgeany_backup_ldflags=$LDFLAGS + LDFLAGS=-Wl,--dynamic-list="${srcdir}/src/dynamicsymbols.list" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([], []) + ], [ + LIBGEANY_LIBS="-Wl,--dynamic-list="$(top_srcdir)/src/dynamicsymbols.list"" + AC_MSG_RESULT([yes]) + ], [ + LIBGEANY_LIBS="" + AC_MSG_RESULT([no]) + ]) + LDFLAGS="${libgeany_backup_ldflags}" + + LIBGEANY_LIBS="${LIBGEANY_LIBS} -version-info ${libgeany_current}:${libgeany_revision}:${libgeany_age}" + + AC_SUBST([LIBGEANY_CFLAGS]) + AC_SUBST([LIBGEANY_LIBS]) + +])
Modified: scintilla/Makefile.am 5 lines changed, 3 insertions(+), 2 deletions(-) =================================================================== @@ -140,9 +140,10 @@ src/XPM.h \ $(LEXER_SRCS)
libscintilla_la_SOURCES = $(SRCS) +libscintilla_la_LDFLAGS = @LIBGEANY_LIBS@
-AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/include -I$(srcdir)/src -I$(srcdir)/lexlib @GTK_CFLAGS@ \ - -fvisibility=hidden +AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir)/include -I$(srcdir)/src -I$(srcdir)/lexlib \ + @GTK_CFLAGS@ @LIBGEANY_CFLAGS@
marshallers: gtk/scintilla-marshal.list glib-genmarshal --prefix scintilla_marshal gtk/scintilla-marshal.list --header > gtk/scintilla-marshal.h
Modified: src/Makefile.am 21 lines changed, 10 insertions(+), 11 deletions(-) =================================================================== @@ -102,11 +102,11 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/scintilla/include \ -I$(top_srcdir)/tagmanager/src \ - @GTK_CFLAGS@ @GTHREAD_CFLAGS@ $(MAC_INTEGRATION_CFLAGS) + @GTK_CFLAGS@ @GTHREAD_CFLAGS@ $(MAC_INTEGRATION_CFLAGS) @LIBGEANY_CFLAGS@
# tell automake we have a C++ file so it uses the C++ linker we need for Scintilla nodist_EXTRA_geany_SOURCES = dummy.cxx - +nodist_EXTRA_libgeany_la_SOURCES = dummy1.cxx
if MINGW # build Geany for Windows on non-Windows systems (cross-compile) @@ -121,8 +121,10 @@ libgeany_la_LIBADD = \ @GTK_LIBS@ \ @GTHREAD_LIBS@ \ $(INTLLIBS) \ - -lole32 -luuid -lwsock32 -lcomdlg32 + @LIBGEANY_LIBS@ \ + -lole32 -lwsock32 -lcomdlg32
+libgeany_la_LDFLAGS = -Wl,-luuid $(AM_LDFLAGS) geany_LDADD += geany_private.res -lcomdlg32
AM_CFLAGS = -DGEANY_DATADIR="data" \ @@ -132,10 +134,9 @@ AM_CFLAGS = -DGEANY_DATADIR="data" \ -DGEANY_PREFIX="" \ -DGEANY_PRIVATE \ -DGTK \ - -DG_LOG_DOMAIN=""Geany"" \ - -fvisibility=hidden + -DG_LOG_DOMAIN=""Geany""
-libgeany_la_LDFLAGS = -mwindows -mms-bitfields -no-undefined +libgeany_la_LDFLAGS += -mwindows -mms-bitfields -no-undefined
WINDRES = $(host_alias)-windres
@@ -158,9 +159,8 @@ libgeany_la_LIBADD = \ @GTK_LIBS@ \ @GTHREAD_LIBS@ \ $(MAC_INTEGRATION_LIBS) \ - $(INTLLIBS) - -libgeany_la_LDFLAGS = -Wl,--dynamic-list="$(srcdir)/dynamicsymbols.list" + $(INTLLIBS) \ + @LIBGEANY_LIBS@
AM_CFLAGS = -DGEANY_DATADIR=""$(datadir)"" \ -DGEANY_DOCDIR=""$(docdir)"" \ @@ -169,8 +169,7 @@ AM_CFLAGS = -DGEANY_DATADIR=""$(datadir)"" \ -DGEANY_PREFIX=""$(prefix)"" \ -DGEANY_PRIVATE \ -DGTK \ - -DG_LOG_DOMAIN=""Geany"" \ - -fvisibility=hidden + -DG_LOG_DOMAIN=""Geany""
clean-local:
Modified: tagmanager/ctags/Makefile.am 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ -DG_LOG_DOMAIN="CTags" AM_CFLAGS = \ $(GTK_CFLAGS) \ - -fvisibility=hidden + @LIBGEANY_CFLAGS@
EXTRA_DIST = \ makefile.win32 @@ -84,3 +84,4 @@ libctags_la_SOURCES = \ vstring.h \ $(parsers)
+libctags_la_LDFLAGS = @LIBGEANY_LIBS@
Modified: tagmanager/mio/Makefile.am 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -1,9 +1,10 @@ noinst_LTLIBRARIES = libmio.la
AM_CPPFLAGS = -DG_LOG_DOMAIN="MIO" #-DMIO_DEBUG -AM_CFLAGS = $(GTK_CFLAGS) -fvisibility=hidden +AM_CFLAGS = $(GTK_CFLAGS) @LIBGEANY_CFLAGS@
libmio_la_SOURCES = mio.c +libmio_la_LDFLAGS = @LIBGEANY_LIBS@
EXTRA_DIST = \ mio.h \
Modified: tagmanager/src/Makefile.am 4 lines changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -6,7 +6,7 @@ AM_CPPFLAGS = \ -DG_LOG_DOMAIN="Tagmanager" AM_CFLAGS = \ $(GTK_CFLAGS) \ - -fvisibility=hidden + @LIBGEANY_CFLAGS@
EXTRA_DIST = \ makefile.win32 @@ -30,3 +30,5 @@ libtagmanager_la_SOURCES =\ tm_tag.c \ tm_workspace.h \ tm_workspace.c + +libtagmanager_la_LDFLAGS = @LIBGEANY_LIBS@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).