From: Jim Meyering Date: Mon, 1 May 2000 10:57:08 +0000 (+0000) Subject: From Akim Demaille X-Git-Tag: Release-1-4b~89 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=4cdad9db251b2eb12e7c2dddb768b6e858aab754;p=automake.git From Akim Demaille * m4/init.m4 (AC_PROVIDE_IFELSE): If it is not defined, do it. (AM_INIT_AUTOMAKE): Update the writing conventions. Quote the arguments properly. Add a few missing `dnl'. Use AC_PROVIDE_IFELSE. --- diff --git a/m4/init.m4 b/m4/init.m4 index 13509e20..403f4f05 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -2,29 +2,46 @@ # some checks are only needed if your package does certain things. # But this isn't really a big deal. -# serial 1 +# serial 2 -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. +# The purpose of this macro is to provide the user with a means to +# check macros which are provided without letting her know how the +# information is coded. +# If this macro is not defined by Autoconf, define it here. +ifdef([AC_PROVIDE_IFELSE], + [], + [define([AC_PROVIDE_IFELSE], + [ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + +# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) +# ---------------------------------------------- AC_DEFUN(AM_INIT_AUTOMAKE, -[AC_REQUIRE([AC_PROG_INSTALL]) -dnl We require 2.13 because we rely on SHELL being computed by configure. -AC_PREREQ([2.13]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured +[dnl We require 2.13 because we rely on SHELL being computed by configure. +AC_PREREQ([2.13])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi + +# Define the identity of the package. +PACKAGE=$1 +AC_SUBST(PACKAGE)dnl +VERSION=$2 +AC_SUBST(VERSION)dnl ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake) @@ -34,12 +51,16 @@ AM_MISSING_PROG(AMTAR, tar) AM_MISSING_INSTALL_SH dnl We need awk for the "check" target. The system "awk" is bad on dnl some platforms. -AC_REQUIRE([AC_PROG_AWK]) -AC_REQUIRE([AC_PROG_MAKE_SET]) -AC_REQUIRE([AM_DEP_TRACK]) -AC_REQUIRE([AM_SET_DEPDIR]) -ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [ - define([AC_PROG_CC], defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])]) -ifdef([AC_PROVIDE_AC_PROG_CXX], [AM_DEPENDENCIES(CXX)], [ - define([AC_PROG_CXX], defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])]) +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl +AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_PROVIDE_IFELSE([AC_PROG_CC], + [AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])dnl ])