[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Including foreign makefiles
From: |
Adam C Powell IV |
Subject: |
Re: Including foreign makefiles |
Date: |
Fri, 23 Mar 2001 16:15:54 -0500 |
Tom Tromey wrote:
> >>>>> "Adam" == Adam C Powell IV <address@hidden> writes:
>
> Adam> So the question is, is there an automake-kosher way to include a
> Adam> foreign makefile, or specify that certain variables will be
> Adam> somehow defined elsewhere, not in Makefile.am or configure.in?
>
> Not really.
Somehow I didn't think so.
> I'm suprised you're seeing an error message here. Can you write a
> simple example that shows it?
>
> Tom
configure.in and Makefile.am are attached, they're relatively simple as these
things go. If you run Debian (unstable), having petsc-dev installed should
make it all work. Note again that PETSC_INCLUDE comes through just fine, but
PETSC_TS_LIB does not. (Upstream uses the curly braces, I tried both styles
and neither works as you can see below.)
# automake
Makefile.am:14: variable `PETSC_TS_LIB' not defined
Makefile.am:15: variable `PETSC_TS_LIB' not defined
# automake --version
automake (GNU automake) 1.4
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Tom Tromey <address@hidden>
# dpkg -l automake [stripped first few lines]
ii automake 1.4-8 A tool for generating GNU Standards-complian
Is there anything I can do to avoid or supress the error so make
dist(check) works?
Thank you,
-Adam P.
GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6
Welcome to the best software in the world today cafe!
# This is the makefile.am
# This includes all of the PETSc definitions, e.g. PETSC_INCLUDE and
# PETSC_x_LIB, which have compiler options as well as BLAS/LAPACK and MPI flags
# and libs.
include $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base
INCLUDES = ${PETSC_INCLUDE}
noinst_HEADERS = cahnhill.h
bin_PROGRAMS = chsnes chts
chsnes_SOURCES = chsnes.c cahnhill.c
chts_SOURCES = chts.c cahnhill.c petscgeom.c
chsnes_LDADD = $(PETSC_TS_LIB)
chts_LDADD = ${PETSC_TS_LIB}
dnl Process this file with autoconf to produce a configure script.
AC_INIT(cahnhill.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(petscprogs, 0.1)
AM_MAINTAINER_MODE
dnl Checks for compilers and libtool
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_F77
AC_STDC_HEADERS
AC_F77_LIBRARY_LDFLAGS
AM_PROG_LIBTOOL
AC_C_BIGENDIAN
AC_C_INLINE
dnl math checks
dnl cpml is Compaq Portable Math Library for Linux/Alpha, ffm is free fast
dnl math by Joachim Wesner and Kazushige Goto for Linux/Alpha.
AC_CHECK_HEADERS(libffm.h)
dnl AC_CHECK_LIB(cpml, sqrt, MATH_LIBS="-lcpml" MATH_INCLUDES="",
dnl MATH_LIBS="-lm" MATH_INCLUDES="")
AC_CHECK_LIB(ffm, dsqrtiv, MATH_LIBS="$MATH_LIBS -lffm" MATH_INCLUDES="-DFFM")
AC_SUBST(MATH_LIBS)
AC_SUBST(MATH_INCLUDES)
dnl PETSc checks, with defaults for PETSC_DIR, PETSC_ARCH and BOPT.
dnl Note: this trusts PETSc to provide valid flags and libs for BLAS/LAPACK and
dnl MPI. I don't see an easy way to verify such validity.
AC_CHECK_FILE($PETSC_DIR/bin/petscarch, ,
[AC_CHECK_FILE(/usr/lib/petsc/bin/petscarch, PETSC_DIR=/usr/lib/petsc,
AC_MSG_ERROR(Cannot find petscarch, please set PETSC_DIR for your PETSc
install.))])
AC_SUBST(PETSC_DIR)
AC_CHECK_PROG(PETSC_ARCH, petscarch, `petscarch`, ,
$PETSC_DIR/bin, /usr/bin)
AC_SUBST(PETSC_ARCH)
AC_CHECK_FILE($PETSC_DIR/lib/lib$BOPT/$PETSC_ARCH/libpetsc.a, ,
[AC_CHECK_FILE($PETSC_DIR/lib/libO/$PETSC_ARCH/libpetsc.a, BOPT=O,
AC_MSG_ERROR(Library libpetsc.a does not seem to be installed.))])
AC_SUBST(BOPT)
dnl Output
AC_OUTPUT(Makefile)