bug-autoconf
[Top][All Lists]
Advanced

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

Fun with autoheader


From: Derek Robert Price
Subject: Fun with autoheader
Date: Tue, 30 Apr 2002 02:21:49 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020326

Hey all,

If anybody has the time, autoheader 2.53 dies in a real ugly way with this configure.in:

address@hidden ccvs-work]$ autoheader
Scalar found where operator expected at /tmp/ahYpmMwP/traces.pl line 525, near "\\"$ac_link"
 (Might be a runaway multi-line "" string starting on line 498)
   (Missing operator before $ac_link?)
Backslash found where operator expected at /tmp/ahYpmMwP/traces.pl line 525, near "$ac_link\"
   (Missing operator before \?)
Scalar found where operator expected at /tmp/ahYpmMwP/traces.pl line 527, near "conftest$ac_exeext' { (eval echo \"$as_me:$LINENO: \\"$ac_try"
 (Might be a runaway multi-line "" string starting on line 525)
Backslash found where operator expected at /tmp/ahYpmMwP/traces.pl line 527, near "$ac_try\"
   (Missing operator before \?)
Scalar found where operator expected at /tmp/ahYpmMwP/traces.pl line 541, near "\\"$ac_link"
 (Might be a runaway multi-line "" string starting on line 527)
   (Missing operator before $ac_link?)
Backslash found where operator expected at /tmp/ahYpmMwP/traces.pl line 541, near "$ac_link\"
   (Missing operator before \?)
Scalar found where operator expected at /tmp/ahYpmMwP/traces.pl line 543, near "conftest$ac_exeext' { (eval echo \"$as_me:$LINENO: \\"$ac_try"
 (Might be a runaway multi-line "" string starting on line 541)
Backslash found where operator expected at /tmp/ahYpmMwP/traces.pl line 543, near "$ac_try\"
   (Missing operator before \?)
couldn't parse /tmp/ahYpmMwP/traces.pl: syntax error at /tmp/ahYpmMwP/traces.pl line 525, near "\\"$ac_link"
autoheader: error: AC_CONFIG_HEADERS not found in configure.in
address@hidden ccvs-work]$


Derek

--
               *8^)

CVS Solutions Architect
Worldwide Information Technologies ( http://2-wit.com )
Email: address@hidden
Public key available from www.keyserver.net - Key ID 5ECF1609
Fingerprint 511D DCD9 04CE 48A9 CC07  A421 BFBF 5CC2 56A6 AB0E
--
The man who reads nothing at all is better educated than the man who reads
nothing but newspapers.

                        - Thomas Jefferson (1743-1826)


dnl configure.in for cvs
AC_INIT([Concurrent Versions System (CVS)],[1.11.2.1],address@hidden,[cvs])
AC_CONFIG_SRCDIR(src/cvs.h)
AM_INIT_AUTOMAKE([gnu 1.5 dist-bzip2 no-define])
AC_PREREQ(2.53)

AC_PREFIX_PROGRAM(cvs)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AM_PROG_CC_C_O

dnl FIXME the next three calls should be avoided according to autoconf
dnl philosophy.  for example, AC_CHECK_LIB should be used to look for crypt.
dnl
dnl These are here instead of later because they want to be called before
dnl anything that calls a C compiler.
AC_AIX
AC_MINIX
AC_ISC_POSIX
if test "$ISC" = yes; then
CFLAGS="$CFLAGS -D_SYSV3"
# And I don't like this...  In theory it should be found later if server is
# enabled, but maybe something on INTERACTIVE UNIX (ISC) we didn't ask to link
# with crypt tries?  Anyhow, the autoconf manual says we can delete this ISC
# stuff on or after 2006-07-23 when Sun discontinues support and ISC becomes
# obsolescent, but I suppose that is probably a matter of opinion.
LIBS="-lcrypt $LIBS"
fi

AC_PROG_RANLIB
AC_PROG_YACC
AC_PROG_LN_S
AC_EXEEXT

AC_PATH_PROG(PERL, perl, no)
AC_PATH_PROG(CSH, csh, no)
AC_PATH_PROG(PR, pr, no)
# For diff/util.c
if test x"$PR" != xno; then
        AC_DEFINE_UNQUOTED([PR_PROGRAM], ["$PR"], [Path to the pr utility])
fi

dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
dnl FIXME I pulled this default list from sanity.sh.  Perhaps these lists
dnl can be stored in one location?
dnl
dnl Yeah, put the value in a variable add it to the substitution list
dnl then have configure create sanity.sh from sanity.sh.in...
glocs="$PATH:/usr/local/bin:/usr/contrib/bin:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin"
AC_PATH_PROGS(ROFF, groff roff, $missing_dir/missing roff, $glocs)
AC_PATH_PROG(PS2PDF, ps2pdf, $missing_dir/missing ps2pdf)
AC_PATH_PROG(TEXI2DVI, texi2dvi, $missing_dir/missing texi2dvi)

AC_SYS_INTERPRETER
if test X"$ac_cv_sys_interpreter" != X"yes" ; then
  # silly trick to avoid problems in AC macros...
  ac_msg='perl scripts using #! may not be invoked properly'
  AC_MSG_WARN($ac_msg)
fi

# BSD's logo is a devil for a reason, hey?
AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
[if test ! -d ac_test_dir ; then
        AC_TRY_COMMAND([mkdir ac_test_dir])
fi
cat >conftestmake <<EOF
VPATH = ac_test_dir
ac_test_target: ac_test_dep
        echo BSD VPATH bug present >&2
ac_test_dep: ac_test_dep_dep
EOF
touch ac_test_dir/ac_test_dep_dep
touch ac_test_dir/ac_test_dep
touch ac_test_target
# Don't know why, but the following test doesn't work under FreeBSD 4.2
# without this sleep command
sleep 1
if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null |grep ^BSD\ VPATH\ bug\ 
present\$ >/dev/null]) ; then
        ccvs_cv_bsd_make_vpath_bug=yes
else
        ccvs_cv_bsd_make_vpath_bug=no
fi
AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
# We also don't need to worry about the bug when $srcdir = $builddir
AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
                test $ccvs_cv_bsd_make_vpath_bug = no \
                || test $srcdir = .)

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(\
        errno.h \
        direct.h \
        fcntl.h \
        io.h \
        limits.h \
        memory.h \
        ndbm.h \
        string.h \
        syslog.h \
        sys/bsdtypes.h \
        sys/file.h \
        sys/param.h \
        sys/resource.h \
        sys/select.h \
        sys/time.h \
        sys/timeb.h \
        unistd.h \
        utime.h\
)
AC_HEADER_STAT
AC_HEADER_TIME

AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL

AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_BLKSIZE:
        your code should no longer depend upon `HAVE_ST_BLKSIZE', but
        `HAVE_STRUCT_STAT_ST_BLKSIZE'.  Remove this warning and
        the `AC_DEFINE' when you adjust the code.])
AC_CHECK_MEMBERS([struct stat.st_blksize],[AC_DEFINE(HAVE_ST_BLKSIZE, 1,
                            [Define to 1 if your `struct stat' has
                             `st_blksize'.  Deprecated, use
                             `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])])

AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV:
        your code should no longer depend upon `HAVE_ST_RDEV', but
        `HAVE_STRUCT_STAT_ST_RDEV'.  Remove this warning and
        the `AC_DEFINE' when you adjust the code.])
AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
                            [Define to 1 if your `struct stat' has `st_rdev'.
                             Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
                             instead.])])

AC_REPLACE_FUNCS(\
        dup2 \
        gethostname \
        memmove \
        mkdir \
        rename \
        strerror \
        strstr \
        strtoul\
        valloc \
        waitpid \
)
AC_CHECK_FUNCS(\
        fchdir \
        fchmod \
        fsync \
        ftime \
        ftruncate \
        getgroups \
        getopt \
        getpagesize \
        getpassphrase \
        gettimeofday \
        initgroups \
        login \
        logout \
        mknod \
        mkstemp \
        mktemp \
        putenv \
        readlink \
        regcomp \
        regerror \
        regexec \
        regfree \
        sigaction \
        sigblock \
        sigprocmask \
        sigsetmask \
        sigvec \
        tempnam \
        timezone \
        tzset \
        vprintf \
        wait3 \
)
# we only need one of the following
AC_CHECK_FUNCS([\
        nanosleep \
        usleep \
        select \
], [break])

dnl
dnl The CVS coding standard (as specified in HACKING) is that if it exists
dnl in SunOS4 and ANSI, we use it.  CVS itself, of course, therefore doesn't
dnl need HAVE_* defines for such functions, but diff wants them.
dnl
AC_DEFINE(HAVE_STRCHR, 1,
[Define if you have strchr (always for CVS).])
AC_DEFINE(HAVE_MEMCHR, 1,
[Define if you have memchr (always for CVS).])

dnl
dnl Force lib/regex.c to use malloc instead of messing around with alloca
dnl and define the old re_comp routines that we use.
dnl
AC_DEFINE(REGEX_MALLOC, 1,
[Define to force lib/regex.c to use malloc instead of alloca.])
AC_DEFINE(_REGEX_RE_COMP, 1,
[Define to force lib/regex.c to define re_comp et al.])
dnl
dnl AC_FUNC_FORK([]) is rather baroque.  It seems to be rather more picky
dnl than, say, the Single Unix Specification (version 2), which simplifies
dnl a lot of cases by saying that the child process can't set any variables
dnl (thus avoiding problems with register allocation) or call any functions
dnl (thus avoiding problems with whether file descriptors are shared).
dnl It would be nice if we could just write to the Single Unix Specification.
dnl I think the only way to do redirection this way is by doing it in the
dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
dnl That would appear to have a race condition if the user hits ^C (or
dnl some other signal) at the wrong time, as main_cleanup will try to use
dnl stdout/stderr.  So maybe we are stuck with AC_FUNC_FORK([]).
dnl
AC_FUNC_FORK([])
AC_FUNC_CLOSEDIR_VOID

dnl
dnl Check for shadow password support.
dnl
dnl We used to try to determine whether shadow passwords were actually in
dnl use or not, but the code has been changed to work right reguardless,
dnl so we can go back to a simple check.
AC_SEARCH_LIBS(getspnam, sec gen, AC_DEFINE(HAVE_GETSPNAM, 1,
[Define if you have the getspnam function.]))

AC_FUNC_UTIME_NULL
AC_SYS_LONG_FILE_NAMES

AC_FUNC_FNMATCH
if test "$ac_cv_func_fnmatch_works" = no; then
  AC_LIBOBJ(fnmatch)
  AC_LIBSOURCE(fnmatch.h)
fi

dnl for the buffer routine replacements
AC_FUNC_MMAP

# Try to find connect and gethostbyname.
AC_CHECK_LIB(nsl, main)
AC_SEARCH_LIBS(connect, xnet socket inet,
  AC_DEFINE(HAVE_CONNECT, 1,
[Define if you have the connect function.]))
dnl no need to search nsl for gethostbyname here since we should have
dnl just added libnsl above if we found it.
AC_SEARCH_LIBS(gethostbyname, netinet)

dnl
dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
dnl
dnl If you change this, keep in mind that some systems have a bogus
dnl libkrb in the system libraries, so --with-krb4=value needs to
dnl override the system -lkrb.
dnl
KRB4=/usr/kerberos
define(WITH_KRB4,[
AC_ARG_WITH([krb4],
  [  --with-krb4=value       set default \$(KRB4) from value],
  [KRB4=$withval],
)dnl
echo "default place for krb4 is $KRB4"
AC_SUBST(KRB4)])dnl
WITH_KRB4

krb_h=
AC_MSG_CHECKING([for krb.h])
if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
   hold_cflags=$CFLAGS
   CFLAGS="$CFLAGS -I$KRB4/include"
   AC_TRY_LINK([#include <krb.h>],[int i;],
          [krb_h=yes krb_incdir=$KRB4/include],
          [CFLAGS=$hold_cflags
           AC_TRY_LINK([#include <krb.h>],[int i;],
             [krb_h=yes krb_incdir=])])
   CFLAGS=$hold_cflags
else
   AC_TRY_LINK([#include <krb.h>],[int i;],
             [krb_h=yes krb_incdir=])
fi
if test -z "$krb_h"; then
  AC_TRY_LINK([#include <krb.h>],[int i;],
    [krb_h=yes krb_incdir=],
    [if test "$cross_compiling" != yes && test -r 
$KRB4/include/kerberosIV/krb.h; then
       hold_cflags=$CFLAGS
       CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
       AC_TRY_LINK([#include <krb.h>],[int i;],
         [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
       CFLAGS=$hold_cflags
     fi])
fi
AC_MSG_RESULT($krb_h)

includeopt=
AC_SUBST(includeopt)
if test -n "$krb_h"; then
  krb_lib=
  if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
       hold_ldflags=$LDFLAGS
       LDFLAGS="-L${KRB4}/lib $LDFLAGS"
       AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib],
           [LDFLAGS=$hold_ldflags
            # Using open here instead of printf so we don't
            # get confused by the cached value for printf from above.
            AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])])
       LDFLAGS=$hold_ldflags
  else
       AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=])
  fi
  if test -n "$krb_lib"; then
    AC_DEFINE([HAVE_KERBEROS], 1,
              [Define if you have MIT Kerberos version 4 available.])
    test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
    LIBS="${LIBS} -lkrb"
    # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before
    # -ldes in the command line.  Don't do it permanently so that we honor
    # the user's setting for LDFLAGS
    hold_ldflags=$LDFLAGS
    test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}"
    AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
    LDFLAGS=$hold_ldflags
    if test -n "$krb_incdir"; then
      includeopt="${includeopt} -I$krb_incdir"
    fi
  fi
fi
AC_CHECK_FUNCS(krb_get_err_text)

ACX_WITH_GSSAPI

dnl
dnl Use --with-encryption to turn on encryption support
dnl
AC_ARG_ENABLE(encryption,
  [  --enable-encryption     enable encryption support (disabled by default)], ,
  [enable_encryption=no])
if test "$enable_encryption" = yes; then
  AC_DEFINE(ENCRYPTION, 1,
[Define to enable encryption support.]
fi

# Check for options requesting client and server feature. If none are
# given and we have connect(), we want the full client & server arrangement.
AC_ARG_ENABLE(client,
[  --enable-client         include code for running as a remote client (default)
  --disable-client        don't include remote client code], ,
[if test "$ac_cv_search_connect" != no; then
  enable_client=yes
fi])
if test "$enable_client" = yes; then
  AC_DEFINE(CLIENT_SUPPORT, 1,
[Define if you want CVS to be able to be a remote repository client.])
fi

AC_ARG_ENABLE(server,
[  --enable-server         include code for running as a server (default)
  --disable-server        don't include server code], ,
[if test "$ac_cv_search_connect" != no; then
  enable_server=yes
fi])
if test "$enable_server" = yes; then
  AC_DEFINE(SERVER_SUPPORT, 1,
[Define if you want CVS to be able to serve repositories to remote
clients.])
dnl
dnl The auth server needs to be able to check passwords against passwd
dnl file entries, so we only #define AUTH_SERVER_SUPPORT if we can
dnl find the crypt function. 
dnl
  AC_SEARCH_LIBS(crypt, crypt,
                 [AC_DEFINE(HAVE_CRYPT, 1,
[Define if you have the crypt function.])
                 AC_DEFINE(AUTH_SERVER_SUPPORT, 1,
[Define if you want to use the password authenticated server.])
])dnl AC_SEARCH_LIBS
fi # enable_server

dnl For the moment we will assume that all systems which have
dnl the unixyness to run configure are unixy enough to do the
dnl PreservePermissions stuff.  I have this sinking feeling that
dnl things won't be that simple, before long.
dnl AC_DEFINE(PRESERVE_PERMISSIONS_SUPPORT, 1,
dnl [Define if this system supports chown(), link(), and friends.])

dnl On cygwin32, we configure like a Unix system, but we use the
dnl Windows support code in lib/fncase.c to handle the case
dnl insensitive file system.  We also need some support libraries.  We
dnl do this at the end so that the new libraries are added at the end
dnl of LIBS.
dnl
dnl FIXME: We should be trying to meet the autoconf ideal of checking for
dnl the properties of the system rather than the name of the os here.  In other
dnl words, we should check the case sensitivty of the system and then for
dnl the support functions we are using and which library we find them in.
AC_CACHE_CHECK(for cygwin32, ccvs_cv_sys_cygwin32,
[AC_TRY_COMPILE([], [return __CYGWIN32__;],
ccvs_cv_sys_cygwin32=yes, ccvs_cv_sys_cygwin32=no)])
if test $ccvs_cv_sys_cygwin32 = yes; then
  AC_LIBOBJ(fncase)
  LIBS="$LIBS -ladvapi32"

  dnl On Windows you can only change file times if you can write to
  dnl the file.  cygwin32 should really handle this for us, but as of
  dnl January 1998 it doesn't.
  AC_DEFINE(UTIME_EXPECTS_WRITABLE, 1,
[Define if utime requires write access to the file (true on Windows,
but not Unix).])

  dnl On Windows we must use setmode to change between binary and text
  dnl mode.  This probably doesn't really require two macro definitions
  AC_DEFINE(USE_SETMODE_STDOUT, 1,
[Define if setmode is required when writing binary data to stdout.])
  AC_DEFINE(HAVE_SETMODE, 1,
[Define if the diff library should use setmode for binary files.])
fi

test -f src/options.h && (
  AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
  AC_MSG_WARN(You may wish to check that local options have not been lost.)
  AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
  cp ./src/options.h ./src/options.h-SAVED
)

dnl associate the setting of the execute bit with the individual scripts
AC_CONFIG_FILES(contrib/clmerge, [chmod +x contrib/clmerge])
AC_CONFIG_FILES(contrib/cln_hist, [chmod +x contrib/cln_hist])
AC_CONFIG_FILES(contrib/commit_prep, [chmod +x contrib/commit_prep])
AC_CONFIG_FILES(contrib/cvs_acls, [chmod +x contrib/cvs_acls])
AC_CONFIG_FILES(contrib/log, [chmod +x contrib/log])
AC_CONFIG_FILES(contrib/log_accum, [chmod +x contrib/log_accum])
AC_CONFIG_FILES(contrib/mfpipe, [chmod +x contrib/mfpipe])
AC_CONFIG_FILES(contrib/pvcs2rcs, [chmod +x contrib/pvcs2rcs])
AC_CONFIG_FILES(contrib/rcslock, [chmod +x contrib/rcslock])
AC_CONFIG_FILES(contrib/sccs2rcs, [chmod +x contrib/sccs2rcs])
AC_CONFIG_FILES(src/cvsbug, [chmod +x src/cvsbug])

dnl the bulk files
AC_CONFIG_FILES([Makefile \
          contrib/Makefile \
          cvs.spec \
          diff/Makefile \
          doc/Makefile \
          emx/Makefile \
          lib/Makefile \
          man/Makefile \
          os2/Makefile \
          src/Makefile \
          tools/Makefile \
          vms/Makefile \
          windows-NT/Makefile \
          windows-NT/SCC/Makefile \
          zlib/Makefile])

dnl and we're done
AC_OUTPUT

reply via email to

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