Autoconf (y 2)

Automake: el resultado final

A continuación mostramos un ejemplo con los ficheros Makefile.in y configure.in, correspondientes a la aplicación C2HTML:

configure.in


AC_INIT(c2html.c)

AC_PROG_LEX
AC_PROG_CC
AC_PROG_INSTALL
AC_PATH_PROG(EX_PATH, [ex],,$PATH:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin)
VERSION=0.7
AC_SUBST(VERSION)
AC_SUBST(EX_PATH)

if test basename ${LEX}` != 'flex
then
	echo "$0: We ONLY support flex (LEX = ${LEX})" >&2
	exit 1
fi


AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h malloc.h sys/time.h unistd.h)

AC_C_CONST
AC_TYPE_SIZE_T

AC_CHECK_FUNCS(strdup)

AC_OUTPUT(Makefile)


Makefile.in.1

# $Id: Makefile.in,v 0.14 1999/06/15 01:04:30 luis Exp $
# Author: Luis.Colorado@SLUG.HispaLinux.ES
# Date: Sun Jun  6 15:43:44 MEST 1999
# C2HTML -- A program to convert a C source package into a cross reference HTML
#      hierarchy.
# Copyright (C) 1999 <Luis.Colorado@SLUG.HispaLinux.ES>
#
# This program 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 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

CC = @CC@
LEX = @LEX@

CFLAGS=-O2 -I. -DVERSION=\""@VERSION@"\" -DEX_PATH=\""@EX_PATH@ >/dev/null 2>&1"\"
LDFLAGS=

INSTALL = @INSTALL@
INSTALLFLAGS = -m 111 -o bin -g bin

prefix = @prefix@
exec_prefix = @exec_prefix@

c2html_objs = c2html.o calcCRC.o crc12.o hashCRC12.o hashTable.o multifree.o \
	lexical.o html_output.o
c2html_libs =

c2html: $(c2html_objs)
	$(CC) $(LDFLAGS) -o c2html $(c2html_objs) $(c2html_libs)

$(c2html_objs): c2html.h hashCRC12.h hashTable.h multifree.h Makefile

clean:
	$(RM) $(RMFLAGS) $(c2html_objs) c2html *.html

distclean: clean
	$(RM) $(RMFLAGS) Makefile config.log config.cache config.status tags

install: @bindir@/c2html
@bindir@/c2html: c2html Makefile
	-$(INSTALL) $(INSTALLFLAGS) c2html @bindir@

# $Id: Makefile.in,v 0.14 1999/06/15 01:04:30 luis Exp $


Luis.Colorado@Hispalinux.ES
Puentelarrá 31
28031 MADRID
http://SLUG.HispaLinux.ES/~luis/