From d31deb3d9cc7ff7b054e08a64310f057d827a431 Mon Sep 17 00:00:00 2001 From: "Theodore A. Roth" Date: Tue, 25 Feb 2003 00:57:27 +0000 Subject: [PATCH] * ChangeLog: Point reader to the CHANGELOG file. * Makefile.am (EXTRA_DIST): Rename avrdude.conf.sample to avrdude.conf.in. Remove avrdude.conf and distclean-local rules. Add install-exec-local and backup-avrdude-conf rules. * avrdude.conf.in: Set default_parallel to "@DEFAULT_PAR_PORT@" for autoconf expansion. Set default_serial to "@DEFAULT_SER_PORT@" for autoconf expansion. * configure.ac: Add call to AC_CANONICAL_{BUILD,HOST,TARGET} macros. Set DEFAULT_PAR_PORT and DEFAULT_SER_PORT based on $host. Add copyright header. Define avrdude_version so AC_INIT and AM_INIT_AUTOMAKE are sure to get the same version. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@238 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avrdude/ChangeLog | 1 + avrdude/Makefile.am | 14 ++++--- avrdude/avrdude.conf.in | 4 +- avrdude/configure.ac | 81 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 90 insertions(+), 10 deletions(-) diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index e69de29b..0ead8444 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -0,0 +1 @@ +See the CHANGELOG file. diff --git a/avrdude/Makefile.am b/avrdude/Makefile.am index b0fd6905..00768349 100644 --- a/avrdude/Makefile.am +++ b/avrdude/Makefile.am @@ -21,7 +21,7 @@ # $Id$ # -EXTRA_DIST = avrdude.1 avrdude.pdf avrdude.conf.sample bootstrap +EXTRA_DIST = avrdude.1 avrdude.pdf avrdude.conf.in bootstrap AM_YFLAGS = -d @@ -63,8 +63,12 @@ man_MANS = avrdude.1 sysconf_DATA = avrdude.conf -avrdude.conf: avrdude.conf.sample - cp $(srcdir)/avrdude.conf.sample $@ +install-exec-local: backup-avrdude-conf -distclean-local: - rm -rf avrdude.conf +# This will get run before the config file is installed. +backup-avrdude-conf: + @echo "Backing up avrdude.conf in ${DESTDIR}${sysconfdir}" + @if test -e ${DESTDIR}${sysconfdir}/avrdude.conf; then \ + cp -pR ${DESTDIR}${sysconfdir}/avrdude.conf \ + ${DESTDIR}${sysconfdir}/avrdude.conf.bak; \ + fi diff --git a/avrdude/avrdude.conf.in b/avrdude/avrdude.conf.in index ceafe60f..3f839ce7 100644 --- a/avrdude/avrdude.conf.in +++ b/avrdude/avrdude.conf.in @@ -172,8 +172,8 @@ # # Overall avrdude defaults # -default_parallel = "/dev/ppi0"; -default_serial = "/dev/cuaa0"; +default_parallel = "@DEFAULT_PAR_PORT@"; +default_serial = "@DEFAULT_SER_PORT@"; # diff --git a/avrdude/configure.ac b/avrdude/configure.ac index b647a196..743cc8b2 100644 --- a/avrdude/configure.ac +++ b/avrdude/configure.ac @@ -1,8 +1,44 @@ +# +# avrdude - A Downloader/Uploader for AVR device programmers +# Copyright (C) 2003 Theodore A. Roth +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# +# $Id$ +# + # Process this file with autoconf to produce a configure script. -AC_INIT(avrdude, 3.1.0cvs, avrdude-dev@nongnu.org) + +# Automake-1.5 requires arguments to AM_INIT_AUTOMAKE, but Automake-1.6 and +# later to not. To work around this, we need to give the version in two places +# so we define avrdude_version. Once freebsd can use 1.6 or newer, we can get +# rid of this silly hack and remove the args to AM_INIT_AUTOMAKE. + +m4_define([avrdude_version],[3.1.0cvs]) + AC_PREREQ(2.53) +AC_INIT(avrdude, avrdude_version, avrdude-dev@nongnu.org) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + AC_CONFIG_SRCDIR([main.c]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE(avrdude, avrdude_version) AM_CONFIG_HEADER([ac_cfg.h]) # Checks for programs. @@ -28,5 +64,44 @@ AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_CHECK_FUNCS([memset select strcasecmp strdup strerror strncasecmp strtol strtoul]) -AC_CONFIG_FILES([Makefile]) +# Checks for misc stuff. + +# Find the parallel serial device files based on target system +# If a system doesn't have a PC style parallel, mark it as unknown. +case $target in + i[[3456]]86-*-linux*) + DEFAULT_PAR_PORT="/dev/parport0" + DEFAULT_SER_PORT="/dev/ttyS0" + ;; + *-*-linux*) + DEFAULT_PAR_PORT="unknown" + DEFAULT_SER_PORT="/dev/ttyS0" + ;; + i[[3456]]86-*-freebsd*) + DEFAULT_PAR_PORT="/dev/ppi0" + DEFAULT_SER_PORT="/dev/cuaa0" + ;; + *-*-freebsd*) + DEFAULT_PAR_PORT="unknown" + DEFAULT_SER_PORT="/dev/cuaa0" + ;; + *-*-msdos* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) + DEFAULT_PAR_PORT="lpt1" + DEFAULT_SER_PORT="com1" + ;; + *) + DEFAULT_PAR_PORT="unknown" + DEFAULT_SER_PORT="unknown" + ;; +esac + +AC_MSG_CHECKING([for parallel device]) +AC_MSG_RESULT([$DEFAULT_PAR_PORT]) +AC_SUBST(DEFAULT_PAR_PORT, $DEFAULT_PAR_PORT) + +AC_MSG_CHECKING([for serial device]) +AC_MSG_RESULT([$DEFAULT_SER_PORT]) +AC_SUBST(DEFAULT_SER_PORT, $DEFAULT_SER_PORT) + +AC_CONFIG_FILES([Makefile avrdude.conf]) AC_OUTPUT