automake-patches
[Top][All Lists]
Advanced

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

Re: [Patch] c.m4 - Add Objective C as a language


From: Ralf Wildenhues
Subject: Re: [Patch] c.m4 - Add Objective C as a language
Date: Mon, 20 Mar 2006 21:31:35 +0100
User-agent: Mutt/1.5.9i

Hi Alexandre,

* Alexandre Duret-Lutz wrote on Sat, Mar 18, 2006 at 09:01:23AM CET:
> 
> Of course.  Thanks a lot for writing this patch, the doc was long overdue.

Thanks for the review!

> If you want to be more complete, you could add a line for OBJC in 
> 
>   lib/Automake/Variables.pm (%_ac_macro_for_var)

I added one for OBJC and one for OBJCFLAGS (s/es/e/, BTW).

> and even check what happens without AC_PROG_OBJC (cxx2.test does
> such a simple test for CXX).

I added two tests, similar to cxx.test, cxx2.test.

>  RW> Index: NEWS

>  RW> +
>  RW> +  - Improved support for Objective C.
> 
> Let's be verbose!  ObjC users surely want to know how it improved :)
> I'm thinking of something like
> 
>   - Improved support for Objective C:
>     - Autoconf's new AC_PROG_OBJC will enable automatic dependency tracking
>     - A new section of the manual documents the support.

I just used that.  :)

Applied as shown below.  It should be noted that Automake won't
bootstrap without updated Autoconf now, nor will users be able to
use newer Autoconf plus Objective C without also updating Automake.

Cheers,
Ralf

        * m4/init.m4 (AM_INIT_AUTOMAKE): Add `_AM_DEPENDENCIES(OBJC)'
        to `AC_PROG_OBJC' if provided, to fix Objective C depmode
        handling.
        * lib/Automake/Variable.pm (%_ac_macro_for_var): Add entries for
        OBJC and OBJCFLAGS.
        * tests/ext.test: Adjust.
        * tests/objc.test, tests/objc2.test: New tests.
        * tests/Makefile.am: Adjust.
        * doc/automake.texi (Objective C Support): New node.
        (Support for Other Languages): Adjust.
        * NEWS: Update.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.302
diff -u -r1.302 NEWS
--- NEWS        10 Mar 2006 10:52:00 -0000      1.302
+++ NEWS        20 Mar 2006 20:22:54 -0000
@@ -97,6 +97,10 @@
     `gnits' strictness.  This means automake will complain about %-rules
     or $(GNU Make functions) unless you switch to `foreign' strictness or
     use `-Wno-portability'.
+
+  - Improved support for Objective C:
+    - Autoconf's new AC_PROG_OBJC will enable automatic dependency tracking.
+    - A new section of the manual documents the support.
 
 New in 1.9:
 
Index: doc/automake.texi
===================================================================
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.131
diff -u -r1.131 automake.texi
--- doc/automake.texi   10 Mar 2006 10:51:37 -0000      1.131
+++ doc/automake.texi   20 Mar 2006 20:23:01 -0000
@@ -171,6 +171,7 @@
 * Program variables::           Variables used when building a program
 * Yacc and Lex::                Yacc and Lex support
 * C++ Support::                 Compiling C++ sources
+* Objective C Support::         Compiling Objective C sources
 * Assembly Support::            Compiling assembly sources
 * Fortran 77 Support::          Compiling Fortran 77 sources
 * Fortran 9x Support::          Compiling Fortran 9x sources
@@ -1532,6 +1533,10 @@
 This is required if any C++ source is included.  @xref{Particular
 Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
 
address@hidden AC_PROG_OBJC
+This is required if any Objective C source is included.  @xref{Particular
+Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
+
 @item AC_PROG_F77
 This is required if any Fortran 77 source is included.  This macro is
 distributed with Autoconf version 2.13 and later.  @xref{Particular
@@ -3063,6 +3068,7 @@
 * Program variables::           Variables used when building a program
 * Yacc and Lex::                Yacc and Lex support
 * C++ Support::                 Compiling C++ sources
+* Objective C Support::         Compiling Objective C sources
 * Assembly Support::            Compiling assembly sources
 * Fortran 77 Support::          Compiling Fortran 77 sources
 * Fortran 9x Support::          Compiling Fortran 9x sources
@@ -4675,6 +4681,41 @@
 @end vtable
 
 
address@hidden Objective C Support
address@hidden Objective C Support
+
address@hidden Objective C support
address@hidden Support for Objective C
+
+Automake includes some support for Objective C.
+
+Any package including Objective C code must define the output variable
address@hidden in @file{configure.ac}; the simplest way to do this is to use
+the @code{AC_PROG_OBJC} macro (@pxref{Particular Programs, , Particular
+Program Checks, autoconf, The Autoconf Manual}).
+
+A few additional variables are defined when an Objective C source file
+is seen:
+
address@hidden @code
address@hidden OBJC
+The name of the Objective C compiler.
+
address@hidden OBJCFLAGS
+Any flags to pass to the Objective C compiler.
+
address@hidden AM_OBJCFLAGS
+The maintainer's variant of @code{OBJCFLAGS}.
+
address@hidden OBJCCOMPILE
+The command used to actually compile a Objective C source file.  The
+file name is appended to form the complete command line.
+
address@hidden OBJCLINK
+The command used to actually link a Objective C program.
address@hidden vtable
+
+
 @node Assembly Support
 @section Assembly Support
 
@@ -5040,8 +5081,8 @@
 @section Support for Other Languages
 
 Automake currently only includes full support for C, C++ (@pxref{C++
-Support}), Fortran 77 (@pxref{Fortran 77 Support}),
-Fortran 9x (@pxref{Fortran 9x Support}),
+Support}), Objective C (@pxref{Objective C Support}), Fortran 77
+(@pxref{Fortran 77 Support}), Fortran 9x (@pxref{Fortran 9x Support}),
 and Java (@pxref{Java Support}).  There is only rudimentary support for other
 languages, support for which will be improved based on user demand.
 
Index: lib/Automake/Variable.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Variable.pm,v
retrieving revision 1.41
diff -u -r1.41 Variable.pm
--- lib/Automake/Variable.pm    17 Oct 2005 20:59:29 -0000      1.41
+++ lib/Automake/Variable.pm    20 Mar 2006 20:23:02 -0000
@@ -177,6 +177,8 @@
    F77FLAGS => 'AC_PROG_F77',
    FC => 'AC_PROG_FC',
    FCFLAGS => 'AC_PROG_FC',
+   OBJC => 'AC_PROG_OBJC',
+   OBJCFLAGS => 'AC_PROG_OBJC',
    RANLIB => 'AC_PROG_RANLIB',
    YACC => 'AC_PROG_YACC',
    );
Index: m4/init.m4
===================================================================
RCS file: /cvs/automake/automake/m4/init.m4,v
retrieving revision 1.62
diff -u -r1.62 init.m4
--- m4/init.m4  30 Jun 2005 11:07:40 -0000      1.62
+++ m4/init.m4  20 Mar 2006 20:23:02 -0000
@@ -88,6 +88,10 @@
                   [_AM_DEPENDENCIES(CXX)],
                   [define([AC_PROG_CXX],
                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 ])
 ])
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.596
diff -u -r1.596 Makefile.am
--- tests/Makefile.am   19 Mar 2006 05:45:33 -0000      1.596
+++ tests/Makefile.am   20 Mar 2006 20:23:02 -0000
@@ -373,6 +373,8 @@
 nolink.test \
 nostdinc.test \
 number.test \
+objc.test \
+objc2.test \
 obsolete.test \
 order.test \
 outdir.test \
Index: tests/ext.test
===================================================================
RCS file: /cvs/automake/automake/tests/ext.test,v
retrieving revision 1.7
diff -u -r1.7 ext.test
--- tests/ext.test      14 May 2005 20:28:55 -0000      1.7
+++ tests/ext.test      20 Mar 2006 20:23:02 -0000
@@ -25,8 +25,7 @@
 cat >> configure.in << 'END'
 AC_PROG_F77
 AC_PROG_FC
-_AM_DEPENDENCIES(OBJC)
-AC_SUBST(OBJC)
+AC_PROG_OBJC
 END
 
 cat > Makefile.am << 'END'
--- /dev/null   2006-03-19 06:33:14.877151536 +0100
+++ tests/objc.test     2006-03-20 20:53:40.000000000 +0100
@@ -0,0 +1,38 @@
+#! /bin/sh
+# Copyright (C) 2001, 2002, 2006  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., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test that `.m' extension works.
+# From Ralf Corsepius (for C++).
+
+. ./defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_OBJC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = hello
+hello_SOURCES = hello.m
+END
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+grep '^\.SUFFIXES:.*\.m' Makefile.in
--- /dev/null   2006-03-19 06:33:14.877151536 +0100
+++ tests/objc2.test    2006-03-20 21:24:49.000000000 +0100
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 2002, 2003, 2006  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., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test that Automake suggests using AC_PROG_OBJC if Objective C sources
+# are used.
+
+. ./defs || exit 1
+
+set -e
+
+echo AC_PROG_CC >>configure.in
+
+cat >Makefile.am <<'END'
+bin_PROGRAMS = hello
+hello_SOURCES = hello.m
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep AC_PROG_OBJC stderr




reply via email to

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