libtool
[Top][All Lists]
Advanced

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

Re: AM_FCFLAGS not working as I expect...


From: Ralf Wildenhues
Subject: Re: AM_FCFLAGS not working as I expect...
Date: Mon, 15 May 2006 06:11:03 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hi Alan,

* Alan W. Irwin wrote on Sun, May 14, 2006 at 09:47:16PM CEST:
> On 2006-05-14 05:42+0200 Ralf Wildenhues wrote:
> >* Alan W. Irwin wrote on Sun, May 14, 2006 at 01:07:37AM CEST:

> >>Here is the message I got from our bootstrap script.
> >*snip*
> >
> >Please post a link to the code that you got this error with, so I can
> >see what's going on here.  Thanks.
> 
> We just had a release (without the f95 interface), and we are now preparing
> for the next one with the f95 interface.  We don't have a tarball for you to
> play with yet, but CVS HEAD is close to final shape except for this libtool
> issue, and it is what all the PLplot core developers use for for their f95
> interface tests.

OK, I tried CVS PLplot now.  Remember you were seeing errors such as
this (quoting again to make this more easily searchable):

| cf/c++.ac:71: error: m4_require: circular dependency of AC_LANG_COMPILER(C++)
| autoconf/lang.m4:299: AC_LANG_COMPILER_REQUIRE is expanded from...
| autoconf/general.m4:2334: AC_LINK_IFELSE is expanded from...
| /tmp/libtool-2.1/share/aclocal/libtool.m4:896: _LT_SYS_MODULE_PATH_AIX is 
expanded from...
| /tmp/libtool-2.1/share/aclocal/libtool.m4:6077: _LT_LANG_CXX_CONFIG is 
expanded from...
| /tmp/libtool-2.1/share/aclocal/libtool.m4:783: _LT_LANG is expanded from...
| /tmp/libtool-2.1/share/aclocal/libtool.m4:772: LT_LANG is expanded from...
| autoconf/c.m4:727: AC_LANG_COMPILER(C++) is expanded from...
| autoconf/lang.m4:299: AC_LANG_COMPILER_REQUIRE is expanded from...
| autoconf/general.m4:2292: AC_COMPILE_IFELSE is expanded from...
| cf/c++.ac:71: the top level
| autom4te: /usr/bin/m4 failed with exit status: 1
| aclocal: autom4te failed with exit status: 1

This is a consequence of the way CVS HEAD Libtool has fixed the language
tag issue; namely, that C++ and/or Fortran tags are not generated if the
project doesn't use them.  The issue is that AC_PROG_CXX is called after
LT_INIT aka AC_PROG_LIBTOOL (aka AM_PROG_LIBTOOL, but why are you still
using that old name?  When Autoconf-2.60 is out, try running autoupdate
on your setup).  The way the tag issue was fixed, weird things happen
with AC_PROG_CXX and AC_PROG_F77, so it's more important to keep the
order.

Why is this useful?  Well, the libtool macro stuff needs to know about
the compilers anyway, so if you have any kind of local adjustments, it
helps to do that earlier.  Also, note this matches the macro order
suggested in the Autoconf manual.

So, the patch below moves those compiler tests up, and invokes the
libtool macro afterwards.  This eliminates that circular dependency.
Since in PL_GET_DLNAME (used from within cf/tcl.ac) you use the built
libtool script to gather further information, those tests have to come
after AC_PROG_LIBTOOL.  There is another important change: by default,
the `libtool' script will only be created at the end of the configure
run.  Use LT_OUTPUT to enable earlier build of the script.

> >>Running libtoolize (GNU libtool 1.2286 2006/04/22 18:57:04)
> >>2.1a...libtoolize: You should add the contents of cf/ltdl.m4' to
> >>aclocal.m4'.
> >>libtoolize: You should add the contents of cf/argz.m4' to aclocal.m4'.
> >>libtoolize: You should add the contents of cf/lt~obsolete.m4' to
> >>aclocal.m4'.
> >> done

> >>I have no idea why those three cf/*.m4 macro files are not being included
> >>properly in aclocal.m4.  We include the line:
> >
> >Do you have AC_CONFIG_MACRO_DIR([cf])?
> 
> Yes.  See configure.ac.
> 
> > If so, try
> > libtoolize --copy --install --ltdl
> 
> Currently with libtool-1.5.22 (see cf/bootstrap.sh) we use
> 
> libtoolize --force --copy --ltdl --automake
> 
> When I added the --install option to those other options, that only
> partially solved the problem.  ltdl.m4 is now properly included in
> aclocal.m4, but the two others (argz.m4 and lt~obsolete.m4) still generate
> the error message and are not included in aclocal.m4.

First, it's a warning and not an error (libtoolize exits successfully),
and second, the warning about argz.m4 and lt~obsolete.m4 is bogus.  We
aim to fix it before 2.0 comes out.  For now you can just ignore it.

> --- ../plplot_working/cf/c++.ac 2005-11-01 15:46:18.000000000 -0800
> +++ cf/c++.ac   2006-05-13 14:36:17.000000000 -0700
> @@ -57,7 +57,7 @@
>        ;;
>      esac
> 
> -    AC_LANG_PUSH([C++])
> +dnl    AC_LANG_PUSH([C++])
*snip*

You can undo all the language changes now, to restore proper
functionality.

Other than that, CVS Automake warns about some GNU make-specific stuff
in doc/docbook/src/Makefile.am (which I guess you know about), and this:
| drivers/Makefile.am:77: compiling `get-drv-info.c' with per-target flags 
requires `AM_PROG_CC_C_O' in `configure.ac'

so if you want to be portable to compilers that don't understand "-c
-o", you could add AM_PROG_CC_C_O right after AC_PROG_CC (the `compile'
script will then be used).

And then, due to macro requirements from macros inside shell
conditionals, some spurious extra `yes' and a couple of errors turned
up.  Using AS_IF from Autoconf-2.59c fixes that (AS_IF works with 2.59
also but won't cause the required macros to be expanded outside the
conditional, unlike the 2.59c AS_IF).  And AC_PROG_CXX should be used
before tests for the C++ compiler are used.

The following is where I stopped at, due to insufficient development
packages installed on my system.  Let's see how this works for you.

Cheers,
Ralf

        * configure.ac (Language bindings): Move up to other program
        checks, before Libtool configuration.  Use AM_PROG_CC_C_O.
        * cf/bootstrap.sh (libtoolize): Add --install.
        * cf/c++.ac: Call AC_PROG_CXX before testing the C++ compiler.
        * cf/f77.ac, cf/f95.ac: Use AS_IF in strategic places.
        * cf/libtool.ac: Update to CVS Libtool macros.

Index: configure.ac
===================================================================
RCS file: /cvsroot/plplot/plplot/configure.ac,v
retrieving revision 1.208
diff -u -r1.208 configure.ac
--- configure.ac        8 May 2006 05:01:11 -0000       1.208
+++ configure.ac        15 May 2006 04:03:36 -0000
@@ -139,15 +139,30 @@
 dnl Require C compile
 
 AC_PROG_CC
+AM_PROG_CC_C_O
 AM_CONDITIONAL(cc_is_gcc, [test "$GCC" = yes])
 
+dnl =======================================================================
+dnl Language bindings
+dnl =======================================================================
+
+m4_include(cf/c++.ac)
+m4_include(cf/f77.ac)
+m4_include(cf/f95.ac)
+
 dnl Libtool configuration
 
 m4_include(cf/libtool.ac)
 
+m4_include(cf/python.ac)
+m4_include(cf/java.ac)
+m4_include(cf/swig.ac)
+m4_include(cf/octave.ac)
+m4_include(cf/tcl.ac)
+m4_include(cf/pdl.ac)
 
 dnl =======================================================================
-dnl Libraires
+dnl Libraries
 dnl =======================================================================
 
 dnl Add libm to LIBS, as some non linux unices might require this.
@@ -224,21 +239,6 @@
 
 
 dnl =======================================================================
-dnl Language bindings
-dnl =======================================================================
-
-m4_include(cf/python.ac)
-m4_include(cf/java.ac)
-m4_include(cf/swig.ac)
-m4_include(cf/octave.ac)
-m4_include(cf/tcl.ac)
-m4_include(cf/c++.ac)
-m4_include(cf/f77.ac)
-m4_include(cf/f95.ac)
-m4_include(cf/pdl.ac)
-
-
-dnl =======================================================================
 dnl pkg-config support
 dnl =======================================================================
 
Index: cf/bootstrap.sh
===================================================================
RCS file: /cvsroot/plplot/plplot/cf/bootstrap.sh,v
retrieving revision 1.8
diff -u -r1.8 bootstrap.sh
--- cf/bootstrap.sh     27 Apr 2005 06:43:40 -0000      1.8
+++ cf/bootstrap.sh     15 May 2006 04:03:36 -0000
@@ -125,7 +125,7 @@
 run aclocal $aclocal_incdir \
   && run autoheader \
   && rm -rf libltdl \
-  && run libtoolize --force --copy --ltdl --automake \
+  && run libtoolize --force --copy --ltdl --install --automake \
   && run automake --add-missing --copy \
   && run autoconf \
   && ( echo -n "Regenerating libltdl/aclocal+configure..."; \
Index: cf/c++.ac
===================================================================
RCS file: /cvsroot/plplot/plplot/cf/c++.ac,v
retrieving revision 1.8
diff -u -r1.8 c++.ac
--- cf/c++.ac   1 Nov 2005 23:46:18 -0000       1.8
+++ cf/c++.ac   15 May 2006 04:03:36 -0000
@@ -56,6 +56,11 @@
       fi
       ;;
     esac
+fi
+
+AC_PROG_CXX
+
+if test "$enable_cxx" = yes; then
 
     AC_LANG_PUSH([C++])
 
@@ -114,8 +119,6 @@
 
 fi
 
-AC_PROG_CXX
-
 AC_SUBST(enable_cxx)
 
 AC_CONFIG_FILES([
Index: cf/f77.ac
===================================================================
RCS file: /cvsroot/plplot/plplot/cf/f77.ac,v
retrieving revision 1.6
diff -u -r1.6 f77.ac
--- cf/f77.ac   7 May 2006 22:29:56 -0000       1.6
+++ cf/f77.ac   15 May 2006 04:03:36 -0000
@@ -24,16 +24,16 @@
 
 PL_ARG_ENABLE(f77, [compile Fortran-77 interface code], yes)
 
-if test "$enable_f77" = yes ; then
-  AC_PROG_FC
+AS_IF([test "$enable_f77" = yes],
+ [AC_PROG_FC
   # If no F77 compiler is found, then disable f77 bindings building
   if test -z "$FC" ; then
     enable_f77=no
     AC_MSG_WARN([Disabling F77 bindings building because no compiler was 
found])
   fi
-fi
-if test "$enable_f77" = yes ; then
-  HAVE_F77PARSE_CL=yes
+])
+AS_IF([test "$enable_f77" = yes],
+ [HAVE_F77PARSE_CL=yes
   AC_LANG_PUSH([Fortran 77])
   AC_MSG_CHECKING([if fortran command-line parsing is possible])
   AC_RUN_IFELSE([
@@ -83,7 +83,7 @@
     HAVE_F77PARSE_CL_TRUE="C "
     HAVE_F77PARSE_CL_FALSE=""
   fi
-fi
+])
 
 AC_SUBST(HAVE_F77PARSE_CL_TRUE)
 AC_SUBST(HAVE_F77PARSE_CL_FALSE)
Index: cf/f95.ac
===================================================================
RCS file: /cvsroot/plplot/plplot/cf/f95.ac,v
retrieving revision 1.2
diff -u -r1.2 f95.ac
--- cf/f95.ac   12 May 2006 19:13:25 -0000      1.2
+++ cf/f95.ac   15 May 2006 04:03:36 -0000
@@ -24,10 +24,8 @@
 
 PL_ARG_ENABLE(f95, [compile Fortran-95 interface code], yes)
 
-if test "$enable_f95" = yes ; then
-  if test "$enable_f77" != yes ; then
-    AC_PROG_FC
-  fi
+AS_IF([test "$enable_f95" = yes],
+ [AC_PROG_FC
   AC_LANG_PUSH([Fortran])
   AC_MSG_CHECKING([whether FC is a true Fortran9x compiler])
   AC_COMPILE_IFELSE([
@@ -36,7 +34,7 @@
   AC_MSG_RESULT(yes),
   AC_MSG_RESULT(no); enable_f95=no)
   AC_LANG_POP([Fortran])
-fi
+])
 if test "$enable_f95" = no ; then
     AC_MSG_WARN([Disabling f95 interface])
 fi
Index: cf/libtool.ac
===================================================================
RCS file: /cvsroot/plplot/plplot/cf/libtool.ac,v
retrieving revision 1.4
diff -u -r1.4 libtool.ac
--- cf/libtool.ac       15 Sep 2005 17:36:58 -0000      1.4
+++ cf/libtool.ac       15 May 2006 04:03:36 -0000
@@ -77,11 +77,10 @@
 AC_SUBST(LIBLTDL)
 
 dnl This required for dll support under cygwin.  Must occur before
-dnl AM_PROG_LIBTOOL
+dnl AC_PROG_LIBTOOL
 
-AC_LIBTOOL_WIN32_DLL
-
-AM_PROG_LIBTOOL
+LT_INIT([win32-dll])
+LT_OUTPUT
 
 AM_CONDITIONAL(with_ltdlsystem, [test "$with_ltdlsystem" = yes])
 




reply via email to

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