delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/11/19:25:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3DD048DD.8000303@alum.mit.edu>
Date: Mon, 11 Nov 2002 19:18:37 -0500
From: "Steven G. Johnson" <stevenj AT alum DOT mit DOT edu>
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: gmane.comp.sysutils.autoconf.general,gmane.os.cygwin
To: ai26 AT sternwarte DOT uni-erlangen DOT de
CC: cygwin AT cygwin DOT com
Subject: Re: problem with simple autoconf for fortran
References: <KGOKJINLWSB0KE54QLED3ZC94VTOPO DOT 3dd035b0 AT micha>

Michael Lemke wrote:
> I have these three files (+ the stuff created by autoconf etc): 
>   x.F
> [...]
> $ cat configure.ac
> dnl Process this file with autoconf to produce a configure script.
> AC_INIT(x,1.0)
> AM_INIT_AUTOMAKE
> 
> dnl Checks for programs.
> AC_PROG_MAKE_SET
> AC_PROG_F77
> [...]
> That went all fine.  Then I do a make:
> $ make
> g77 -DPACKAGE_NAME=\"x\" -DPACKAGE_TARNAME=\"x\" -DPACKAGE_VERSION=\"1.0\" -
> DPACKAGE_STRING=\"x\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"x\" -DVERSION=
> \"1.0\"  -I. -I.   @CPPFLAGS@  -g -O2 -c -o x.o `test -f 'x.F' || echo './'`x.F
> g77: cannot specify -o with -c or -S and multiple compilations
> make: *** [x.o] Error 1
> 
> Why is there a @CPPFLAGS@ ?  Isn't that supposed to be replaced by some real
> flags?  Did I miss something in my configure.ac/Makefile.am?

Try putting AC_PROG_CPP in your configure.ac.  When your file is named 
.F (instead of .f), automake expects that the Fortran compiler is 
preprocessing it with the C preprocessor and understands CPPFLAGS. 
However, CPPFLAGS are only set by the AC_PROG_CC/AC_PROG_CPP macros.

Steven


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019