Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Tue, 14 Apr 2015 20:21:34 UTC Commit: db4bf54b2f963ce2259a0422e22d7e63aa43337b https://github.com/geany/geany/commit/db4bf54b2f963ce2259a0422e22d7e63aa4333...
Log Message: ----------- Compile prefix.c and osx.c only when needed to avoid warnings
When mac integration or binary relocation are disabled, the compiled object file contains no symbols because the guards in the source files hide all code. On OS X there's a warning during compilation saying:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libgeany.a(libgeany_la-prefix.o) has no symbols
If these features are disabled, don't compile the corresponding sources to avoid the warnings.
Interestingly, waf compilation works without warnings - it appears linking is done through g++ which doesn't produce these warnings.
Modified Paths: -------------- m4/geany-binreloc.m4 m4/geany-mac-integration.m4 src/Makefile.am
Modified: m4/geany-binreloc.m4 6 lines changed, 4 insertions(+), 2 deletions(-) =================================================================== @@ -52,9 +52,11 @@ AC_DEFUN([GEANY_CHECK_BINRELOC], AC_MSG_RESULT([no (unknown value "$enable_binreloc")]) enable_binreloc=no fi - if test "$enable_binreloc" = "yes"; then + AM_CONDITIONAL(ENABLE_BINRELOC, [test "$enable_binreloc" = "yes"]) + AM_COND_IF(ENABLE_BINRELOC, + [ AC_DEFINE([ENABLE_BINRELOC],,[Use AutoPackage?]) - fi + ])
GEANY_STATUS_ADD([Enable binary relocation], [$enable_binreloc]) ])
Modified: m4/geany-mac-integration.m4 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -9,7 +9,8 @@ AC_DEFUN([GEANY_CHECK_MAC_INTEGRATION], [geany_enable_mac_integration="$enableval"], [geany_enable_mac_integration="no"])
- AS_IF([test "x$geany_enable_mac_integration" = "xyes"], + AM_CONDITIONAL(ENABLE_MAC_INTEGRATION, [test "x$geany_enable_mac_integration" = "xyes"]) + AM_COND_IF(ENABLE_MAC_INTEGRATION, [ AS_IF([test "x$enable_gtk3" = xyes], [PKG_CHECK_MODULES(MAC_INTEGRATION, gtk-mac-integration-gtk3)],
Modified: src/Makefile.am 10 lines changed, 8 insertions(+), 2 deletions(-) =================================================================== @@ -81,10 +81,8 @@ libgeany_la_SOURCES = \ msgwindow.c msgwindow.h \ navqueue.c navqueue.h \ notebook.c notebook.h \ - osx.c osx.h \ plugins.c plugins.h \ pluginutils.c pluginutils.h \ - prefix.c prefix.h \ prefs.c prefs.h \ printing.c printing.h \ project.c project.h \ @@ -101,6 +99,14 @@ libgeany_la_SOURCES = \ ui_utils.c ui_utils.h \ utils.c utils.h
+if ENABLE_BINRELOC +libgeany_la_SOURCES += prefix.c prefix.h +endif + +if ENABLE_MAC_INTEGRATION +libgeany_la_SOURCES += osx.c osx.h +endif + libgeany_la_CFLAGS = $(AM_CPPFLAGS) @LIBGEANY_CFLAGS@ libgeany_la_LDFLAGS = @LIBGEANY_LDFLAGS@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).