From a47350271759e5b84ad303cc011f8174b866cafc Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 5 Jan 2007 03:41:05 +0000 Subject: [PATCH] Updated the autoconf script and makefile so that we don't get those occasional script errors when it wants to automatically reconfigure. I probably broke three other things because I am not very good with autoconf. :( --- webcit/Makefile.in | 7 +- webcit/acinclude.m4 | 50 +++++++++++++ webcit/aclocal.m4 | 102 ++++++++++++++++++++++++++ webcit/bootstrap | 56 +++++++++++++- webcit/{configure.in => configure.ac} | 23 +----- 5 files changed, 216 insertions(+), 22 deletions(-) create mode 100644 webcit/acinclude.m4 create mode 100644 webcit/aclocal.m4 rename webcit/{configure.in => configure.ac} (95%) diff --git a/webcit/Makefile.in b/webcit/Makefile.in index 2eac9b2b2..a40e3fd39 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -71,14 +71,17 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \ $(CC) $(CFLAGS) $(DEFS) -c $(PTHREAD_DEFS) -DWEBCITDIR=\"$(prefix)\" -DLOCALEDIR=\"$(LOCALEDIR)\" $< Makefile: $(srcdir)/Makefile.in config.status - CONFIG_FILES="Makefile" CONFIG_HEADERS= $(SHELL) ./config.status + CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status config.status: $(srcdir)/configure $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in +$(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 cd $(srcdir) && $(AUTOCONF) +$(srcdir)/aclocal.m4: $(srcdir)/acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + install: test -d $(DESTDIR)$(prefix) || mkdir $(DESTDIR)$(prefix) test -d $(DESTDIR)$(prefix)/static || mkdir $(DESTDIR)$(prefix)/static diff --git a/webcit/acinclude.m4 b/webcit/acinclude.m4 new file mode 100644 index 000000000..0941acf0b --- /dev/null +++ b/webcit/acinclude.m4 @@ -0,0 +1,50 @@ +# CIT_STRUCT_TM +# ------------------ +# Figure out how to get the current GMT offset. If `struct tm' has a +# `tm_gmtoff' member, define `HAVE_STRUCT_TM_TM_GMTOFF'. Otherwise, if the +# external variable `timezone' is found, define `HAVE_TIMEZONE'. +AC_DEFUN([CIT_STRUCT_TM], +[AC_REQUIRE([AC_STRUCT_TM])dnl +AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include +#include <$ac_cv_struct_tm> +]) +if test "$ac_cv_member_struct_tm_tm_gmtoff" != yes; then + AC_CACHE_CHECK(for timezone, ac_cv_var_timezone, +[AC_TRY_LINK( +[#include ], +[printf("%ld", (long)timezone);], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)]) + if test $ac_cv_var_timezone = yes; then + AC_DEFINE(HAVE_TIMEZONE, 1, + [Define if you don't have `tm_gmtoff' but do have the external + variable `timezone'.]) + fi +fi +])# CIT_STRUCT_TM + +AC_DEFUN([AC_CHECK_DB],[ +for lib in $1 +do + AS_VAR_PUSHDEF([ac_tr_db], [ac_cv_db_lib_${lib}])dnl + bogo_saved_LIBS="$LIBS" + LIBS="$LIBS -l$lib" + AC_CACHE_CHECK([for db_create in -l${lib}], ac_tr_db, + [AC_TRY_LINK([#include ], [int foo=db_create((void *)0, (void *) 0, +0 )], + [AS_VAR_SET(ac_tr_db, yes)], + [AS_VAR_SET(ac_tr_db, no)]) + ]) + AS_IF([test AS_VAR_GET(ac_tr_db) = yes], + [$2 + LIBS="$bogo_saved_LIBS" + SERVER_LIBS="$SERVER_LIBS -l$lib" + db=yes], + [LIBS="$bogo_saved_LIBS" + db=no]) + AS_VAR_POPDEF([ac_tr_db])dnl +test "$db" = "yes" && break +done +if test "$db" = "no"; then +$3 +fi +])# AC_CHECK_DB + diff --git a/webcit/aclocal.m4 b/webcit/aclocal.m4 new file mode 100644 index 000000000..6af4bc7fa --- /dev/null +++ b/webcit/aclocal.m4 @@ -0,0 +1,102 @@ +# generated automatically by aclocal 1.9.5 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +m4_include([acinclude.m4]) diff --git a/webcit/bootstrap b/webcit/bootstrap index bf4277220..767549d89 100755 --- a/webcit/bootstrap +++ b/webcit/bootstrap @@ -1,3 +1,57 @@ #!/bin/sh +# +# run me after checking WebCit out of svn. +# +# $Id: bootstrap 3850 2005-09-13 14:00:24Z ajc $ +# -autoconf +# Remove any vestiges of pre-6.05 build environments +rm -f .libs modules *.so *.lo *.la + +# Goofy red hat 7.3 stuff +if grep 7.3 /etc/redhat-release >/dev/null 2>&1 ; then + redhat73=true +else + redhat73=false +fi +if [ "$redhat73" = "true" ]; then + aclocal=/usr/bin/aclocal-1.5 + autoconf=/usr/bin/autoconf-2.53 + autoheader=/usr/bin/autoheader-2.53 + + if test -z $aclocal ; then + echo "Please install the automake15 RPM package" + redhat73=missing + fi + if test -z $autoconf || test -z $autoheader ; then + echo "Please install the autoconf253 RPM package" + redhat73=missing + fi + if test "$redhat73" = "missing" ; then + exit 1 + fi +else + aclocal=aclocal + autoconf=autoconf + autoheader=autoheader +fi + +echo ... running aclocal ... +$aclocal +echo ... running autoconf ... +$autoconf +# If your autoconf version changes, the autom4te.cache stuff will mess you up. +# Get rid of it. +echo ... removing autoheader cache files ... +rm -rf autom4te*.cache +echo ... running autoheader ... +$autoheader + +echo +echo This script has been tested with autoconf 2.53 and +echo automake 1.5. Other versions may work, but I recommend the latest +echo compatible versions of these. +echo +echo Also note that autoconf and automake should be configured +echo with the same prefix. +echo diff --git a/webcit/configure.in b/webcit/configure.ac similarity index 95% rename from webcit/configure.in rename to webcit/configure.ac index b1d917040..b5eed7a90 100644 --- a/webcit/configure.in +++ b/webcit/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id$ +dnl $Id: configure.in 4798 2006-12-28 16:34:20Z ajc $ AC_INIT(webserver.c) @@ -13,7 +13,9 @@ AC_SUBST(VERSION) AC_SUBST(PROG_SUBDIRS) AC_CANONICAL_HOST AC_PROG_INSTALL -AC_CHECK_PROG(AUTOCONF, autoconf) +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AC_CHECK_PROG(SED, sed, sed, no) AC_PREFIX_DEFAULT(/usr/local/webcit) @@ -27,8 +29,6 @@ AC_ARG_WITH(ssl, fi ] ) - - dnl Set some system-specific variables which are OK to set before compiler dnl checks: PTHREAD_DEFS=-D_REENTRANT @@ -343,21 +343,6 @@ fi AC_SUBST(SETUP_LIBS) -dnl where to make webcit search its mo's? -if test "$prefix" = "NONE"; then - LOCALEDIR="$ac_default_prefix/locale/" -else - LOCALEDIR="$prefix/locale/" -fi -AC_ARG_WITH(localedir, - [ --with-locale directory where to find our mo's], - [ if test "x$withval" != "xno" ; then - LOCALEDIR="$withval/" - fi - ] -) -AC_SUBST(LOCALEDIR) - AC_OUTPUT(Makefile po/Makefile ) echo ------------------------------------------------------------------------ -- 2.30.2