autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

configure: error: invalid package name


From: Al
Subject: configure: error: invalid package name
Date: Mon, 7 Jul 2003 16:41:07 +0100

Im having trouble trying to get the macro below to work (possibly becauase
Im doing so with virtually zero understanding of m4?). When configure.in
contains

smr_ARG_WITHINCLUDES([forrest],[ForrestProtocol.h])

, configuration with

$ ./configure -C --with-forrest-includes=/desktop/forrest-1.0/include

chokes with

configure: error: invalid package name: forrest-includes

Ive modified the macro a bit so any glaringly obvious errors are probably my
fault (dont blame the original authors). Can anybody see the problem(s)?

Thanks in advance.


dnl ####################### -*- Mode: M4 -*- ###########################
dnl
dnl Copyright (C) 1999 Matthew D. Langston <address@hidden>
dnl Copyright (C) 1998 Steve Robbins <address@hidden>
dnl
dnl This file is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This file is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this file; if not, write to:
dnl
dnl   Free Software Foundation, Inc.
dnl   Suite 330
dnl   59 Temple Place
dnl   Boston, MA 02111-1307, USA.
dnl ####################################################################

dnl This is a convenient macro which translates illegal characters for
dnl bourne shell variables into legal characters.  It has the same
dnl functionality as sed 'y%./+-:%__p__%'.

AC_DEFUN([smr_safe_translation],
    [patsubst(patsubst([$1], [+], [p]), [./-:], [_])])

AC_DEFUN([smr_ARG_WITHINCLUDES],
    [   dnl Define convenient aliases for the arguments since there are so
        dnl many of them and I keep confusing myself whenever I have to edit
        dnl this macro.

        pushdef([smr_name],$1)
        pushdef([smr_header],$2)
        pushdef([smr_safe_name],smr_safe_translation(smr_name))

        dnl Add the option to `configure --help'.  We don't need to supply
the
        dnl 4th argument to AC_ARG_WITH (i.e. the code to set the default
        dnl value) because that is done below by AC_CACHE_CHECK.

        AC_ARG_WITH(
            smr_safe_name-includes,
            AC_HELP_STRING(
                [--with-smr_safe_name-includes[[=DIR]]],
                [set directory for smr_name headers]
            ),
            smr_cv_with_[]smr_safe_name[]_includes=$withval
        )

        dnl We cache the result so that the user doesn't have to remember
        dnl which flags they passed to `configure'.

        AC_CACHE_CHECK(
            [where to find the smr_name header files],
            smr_cv_with_[]smr_safe_name[]_includes,
            smr_cv_with_[]smr_safe_name[]_includes=
        )

        if test ! x"[$]smr_cv_with_[]smr_safe_name[]_includes" = x; then
            if test -d "[$]smr_cv_with_[]smr_safe_name[]_includes"; then

smr_safe_name[]_CFLAGS="-I[$]smr_cv_with_[]smr_safe_name[]_includes"
            else
                AC_MSG_ERROR([argument must be a directory])
            fi
        else
            smr_safe_name[]_CFLAGS=
        fi

        dnl This bit of logic comes from the autoconf AC_PROG_CC macro.  We
        dnl need to put the given include directory into CPPFLAGS
temporarily,
        dnl but then restore CPPFLAGS to its old value.

        smr_test_CPPFLAGS="${CPPFLAGS+set}"
        smr_save_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS [$]smr_safe_name[]_CFLAGS"

        dnl If the header file smr_header exists, then define
        dnl HAVE_[]smr_header (in all capitals).

        AC_CHECK_HEADERS([smr_header])

        if test x"$smr_test_CPPFLAGS" = xset; then
            CPPFLAGS=$smr_save_CPPFLAGS
        else
            unset CPPFLAGS
        fi

        popdef([smr_name])
        popdef([smr_header])
        popdef([smr_safe_name])
    ]
)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]