Kaydet (Commit) db4bf54b authored tarafından Jiří Techet's avatar Jiří Techet

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.
üst d1a3ec18
......@@ -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])
])
......@@ -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)],
......
......@@ -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@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment