automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get .o not .lo files in foo_LINK command?


From: Grzegorz Jakacki
Subject: How to get .o not .lo files in foo_LINK command?
Date: Tue, 16 Jul 2002 11:42:41 +0800 (CST)

Hi,

I am using Automake 1.6 / Autoconf 2.53 / Libtool 1.4.2.

I have a bunch of source files. I want to compile them and

  * link into executable,
  * link into library,
  * link into another executable with external linker, which
    does not understand libtool objects.

With

    $ cat Makefile.am
    SRCS = foo.cc
    bin_PROGRAMS = foo foo.pure
    lib_LTLIBRARIES = libfoo.la

    foo_SOURCES = $(SRCS)
    foo_pure_SOURCES = $(SRCS)
    libfoo_la_SOURCES = $(SRCS)

    # :GOTCHA: workaround, so that we can
    #     build targets from the same sources
    foo_CXXFLAGS = $(AM_CXXFLAGS)
    foo_pure_CXXFLAGS = $(AM_CXXFLAGS)
    libfoo_la_CXXFLAGS = $(AM_CXXFLAGS)

    foo_pure_LINK = purify g++ -o $@

the external link command is

    purify g++ -o foo.pure  libfoo_la-foo.lo

and the linker chokes on *.lo

Question: how can I get *.o files in the external linker command line?

And yet one funny thing. When in the example above I replace $(SRCS) with
explicit "foo.cc", the external link command becomes

    purify g++ -o foo.pure  foo_pure-foo.o

I do not understand why. Is this a bug? Unfortunately, this is not a viable
solution to my problem, since in my real project SRCS contains much more
than just "foo.cc", so I would rather not triplicate its whole content.

Help appreciated.

Best regards
Grzegorz

PS: $ cat configure.in
    AC_INIT(foo,1.0)
    AC_CONFIG_SRCDIR([foo.cc])

    AM_INIT_AUTOMAKE
    AC_DISABLE_SHARED
    AC_LIBLTDL_CONVENIENCE
    AM_PROG_LIBTOOL

    AC_PROG_CXX

    AC_CONFIG_SUBDIRS(libltdl)
    AC_OUTPUT(Makefile)

###################################################################
# Grzegorz Jakacki                         China IC Design Center #
# Senior Engineer, CAD Dept.               1 Gaojiayuan, Chaoyang #
# tel. +86-10-64365577 x2009               Beijing 100015, China  #
# Copyright (C) 2002 Grzegorz Jakacki, CIDC. All Rights Reserved. #
###################################################################




reply via email to

[Prev in Thread] Current Thread [Next in Thread]