为什么我会获得双倍链接?

时间:2016-06-26 16:36:06

标签: autotools libtool

我正在测试一些autotools的东西,我注意到我得到了一个双重链接,这是主要文件:

configure.ac

AC_INIT([galarm], [1.0], [aullidolunar@gmail.com])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
LT_INIT([disable-static])
AC_PROG_LIBTOOL
IT_PROG_INTLTOOL([0.40.0])
AC_CONFIG_MACRO_DIR([m4])

# Checking debug or release enable
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Build with debug information [default=no]]), [], [enable_debug=no])
AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" != "xno"])

# Checking for local mode
AC_ARG_ENABLE(local, AS_HELP_STRING([--enable-local], [Build with local data resource [default=no]]), [], [enable_local=no])
AM_CONDITIONAL([ENABLE_LOCAL], [test "x$enable_local" != "xno"])

# Checking gtk+-2.0: requiered
PKG_CHECK_MODULES([gtk2], [gtk+-2.0])

GETTEXT_PACKAGE=$PACKAGE
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [package name for gettext])

AC_CONFIG_FILES([
    po/Makefile.in
    src/Makefile
    Makefile
])

AC_OUTPUT

的src / Makefile.am

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

if ENABLE_LOCAL
my_data_dir = "$(abs_top_builddir)/data"
my_locale_dir = "$(abs_top_builddir)/po"
else
my_data_dir = "$(datadir)/$(PACKAGE)"
my_locale_dir = "$(my_data_dir)/locales"
endif

if ENABLE_DEBUG
my_build_type = -g3 -O0
else
my_build_type = -O2
endif

bin_PROGRAMS = galarm
galarm_SOURCES = main.c
noinst_HEADERS = 

DEFS = -DDATA_DIR=\"$(my_data_dir)\" -DLOCALEDIR=\"$(my_locale_dir)\"
galarm_CFLAGS = $(my_build_type) $(gtk2_CFLAGS)
galarm_LDADD = $(gtk2_LIBS) $(LTLIBINTL)
galarm_LDFLAGS = -rdynamic

这是详细的输出:

  

gcc -DDATA_DIR = \"" / home / joel / Documentos / coding / autofoo / data" \"   -DLOCALEDIR = \"" /家庭/乔/文件/编码/ autofoo / PO" \" -一世。 -I .. -g3 -O0 -pthread -I / usr / include / gtk-2.0 -I / usr / lib / gtk-2.0 / include -I / usr / include / pango-1.0 -I / usr / include / atk -1.0 -I / usr / include / cairo -I / usr / include / pixman-1 -I / usr / include / libdrm -I / usr / include / gdk-pixbuf-2.0 -I / usr / include / libpng16 -I /usr/include/pango-1.0 -I / usr / include / freetype2 -I / usr / include / libpng16 -I / usr / include / harfbuzz -I / usr / include / glib-2.0 -I / usr / lib / glib -2.0 / include -I / usr / include / freetype2 -I / usr / include / libpng16 -I / usr / include / harfbuzz -I / usr / include / glib-2.0 -I / usr / lib / glib-2.0 / include -g -O2 -MT galarm-main.o -MD -MP -MF .deps / galarm-main.Tpo -c -o galarm-main.o test -f 'main.c' || echo './' main.c mv -f .deps / galarm- main.Tpo .deps / galarm-main.Po / bin / sh    ../ libtool --tag = CC --mode = link gcc -g3 -O0 -pthread   -I / usr / include / gtk-2.0 -I / usr / lib / gtk-2.0 / include -I / usr / include / pango-1.0 -I / usr / include / atk-1.0 -I / usr / include / cairo -I / usr / include / pixman-1 -I / usr / include / libdrm -I / usr / include / gdk-pixbuf-2.0 -I / usr / include / libpng16 -I / usr / include / pango-1.0 -I / usr / include / freetype2 -I / usr / include / libpng16 -I / usr / include / harfbuzz -I / usr / include / glib-2.0 -I / usr / lib / glib-2.0 / include -I / usr / include / freetype2 -I / usr / include / libpng16 -I / usr / include / harfbuzz -I / usr / include / glib-2.0 -I / usr / lib / glib-2.0 / include -g -O2 -rdynamic -o galarm galarm -main.o -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype libtool:link:gcc -g3 -O0 -pthread -I / usr / include / gtk-2.0 -I / usr / lib / gtk-2.0 / include -I / usr / include /pango-1.0 -I / usr / include / atk-1.0 -I / usr / include / cairo -I / usr / include / pixman-1 -I / usr / include / libdrm -I / usr / include / gdk-pixbuf -2.0 -I / usr / include / libpng16 -I / usr / include / pango-1.0 -I / usr / include / freetype2 -I / usr / include / libpng16 -I / usr / include / harfbuzz -I / usr / include / glib-2.0 -I / usr / lib / glib-2.0 / include -I / usr / include / freetype2 -I / usr / include / libpng16 -I / usr / include / harfbuzz -I / usr / include / glib-2.0 -I / usr / lib / glib-2.0 / include -g -O2 -rdynamic -o galarm galarm-main.o -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib -2.0 -lfontconfig -lfreetype -pthread

如您所见,有一个双重链接调用。这是正常的吗?任何方式只使用一次?感谢。

1 个答案:

答案 0 :(得分:1)

我认为你的帖子的换行符被破坏了,所以很难说出你想要点什么的人。

但总的来说,您所看到的是../libtool--mode=link的通话,然后是脚本本身报告libtool: link:(因为这就是它的问题。 )

只有一个gcc来电有效执行。