automake-patches
[Top][All Lists]
Advanced

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

Re: 1-gary-strip-target-suffix-from-default-source.patch


From: Gary V. Vaughan
Subject: Re: 1-gary-strip-target-suffix-from-default-source.patch
Date: Mon, 24 Nov 2003 17:22:32 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3

Alexandre Duret-Lutz wrote:
"Gary" == Gary V Vaughan <address@hidden> writes:


[...]

 Gary> I dusted off my copy of Programming Perl and came up with
Gary> the attached patch.
Hi Gary, this looks good.  Could you update the manual and supply a
test case for this new feature?

Sure. I don't have access to CVS from this machine... but here is a snippet for automake.texi (Program Sources), and maybe similar treatment for the Libtool Modules node, with s/lib_LIBRARIES = foo/lib_LTLIBRARIES = mymodule/ and s/foo.c/mymodule.c:

If @samp{hello_SOURCES} is not specified, then it defaults to the single
file @file{hello.c}; that is, the default is to compile a single C file
whose base name is the name of the program itself.  In this context,
the base name is always the name that would have gone to the left of
the @samp{_SOURCES} primary, before canonicalization and with any
suffixes replaced with @samp{.c} (This is a terrible default but we
are stuck with it for historical reasons.)
@vindex _SOURCES
@vindex SOURCES

For example if you have the following somewhere in your
@file{Makefile.am} with no corresponding @samp{libfoo_a_SOURCES}:

@example
lib_LIBRARIES = libfoo.a
@end example

@noindent
@file{libfoo.a} will be built using a default source file named
@file{libfoo.c}.

And a new test is attached.

Cheers,
        Gary.
--
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://www.oranda.demon.co.uk
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
#! /bin/sh
# Copyright (C) 2003  Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# GNU Automake is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU Automake is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Automake; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

# Test to make sure a sensible default source for libraries is used.

required='libtool gcc'
. ./defs || exit 1

cat > configure.in << 'END'
AC_INIT([foo], [0.1])
AC_CONFIG_SRCDIR([foo.c])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_LIBTOOL
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
END

cat > Makefile.am << 'END'
pkglib_LTLIBRARIES = foo.la
foo_la_LDFLAGS = -module
END

cat > foo.c << 'END'
int foo (void) { return 0; }
END

libtoolize
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a

mkdir sub
cd sub

../configure
$MAKE || exit 1

test -f foo.la || exit 1
:

exit 0

Attachment: pgp_VSnX7hAfH.pgp
Description: PGP signature


reply via email to

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