Commit ebfb70d5 authored by kocienda's avatar kocienda

Added a basic set of files for an autoconf-based build system


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b359331c
#======================================================================
#
# Top-level Makefile for WebPageView
#
# $RCSfile$
# $Revision$
# $Author$
# $Date$
#
#======================================================================
# Include header
TOPSRCDIR = .
include $(TOPSRCDIR)/Makefile.vars
#----------------------------------------------------------------------
# Subdirectories to build
SUBDIRS = \
src/kdelibs/kjs \
$(NULL)
#----------------------------------------------------------------------
# Standard targets
all install clean distclean maintainer-clean:
@target=$@; \
list='$(SUBDIRS)'; \
for subdir in $$list; do \
echo ">>> Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) || \
case "$$amf" in \
*=*) exit 1;; \
*k*) fail=yes;; \
*) exit 1;; \
esac; \
done; \
echo ">>> Making local-$$target in `pwd`"; \
$(MAKE) local-$$target; \
$(NULL)
#----------------------------------------------------------------------
# Custom targets
local-all:
local-dep:
local-install:
local-clean:
local-distclean:
${MAKE} local-clean
rm -rf Makefile \
Makefile.rules \
Makefile.vars \
config.h \
config.cache \
config.log \
config.status \
$(NULL)
local-maintainer-clean:
rm -f configure;
${MAKE} local-distclean
#======================================================================
# end
#======================================================================
#======================================================================
#
# $RCSfile$
# $Revision$
# $Author$
# $Date$
#
# Make.rules boilerplate
#
#======================================================================
# Suffix rules
#
$(filter %.c,$(CLEXOBJECTS)): %.c: %.l
$(LEX) $(LEXFLAGS) $<
$(filter %.cpp,$(CXXLEXOBJECTS)): %.cpp: %.l
$(LEX) $(LEXFLAGS) $<
$(filter %.c,$(CYACCOBJECTS)): %.c: %.y
$(YACC) $(YACCFLAGS) $<
$(filter %.cpp,$(CXXYACCOBJECTS)): %.cpp: %.y
$(YACC) $(YACCFLAGS) $<
$(filter %.o,$(COBJECTS)): %.o: %.c
$(CC) $(CFLAGS) -I$(TOPSRCDIR) -c $< -o $@
$(filter %.o,$(CXXOBJECTS)): %.o: %.cpp
$(CC) $(CXXFLAGS) -I$(TOPSRCDIR) -c $< -o $@
.SUFFIXES: .cpp .h .c
.cpp.o:
$(CC) $(CXXFLAGS) -I$(TOPSRCDIR) -c $< -o $@
#----------------------------------------------------------------------
# Standard subdir targets
setup:
if (test -f "./MakeSystemChanges.sh"); then \
./MakeSystemChanges.sh; \
fi
clean:
rm -f ${CLEAN_FILES} core
distclean:
${MAKE} clean
rm -f Makefile \
config.h \
config.cache \
config.log \
config.status \
$(NULL)
maintainer-clean:
rm -f configure
${MAKE} distclean;
#======================================================================
# end $RCSfile$
#======================================================================
#======================================================================
#
# $RCSfile$
# $Revision$
# $Author$
# $Date$
#
# Makefile.in boilerplate
#
#======================================================================
# Shell
SHELL = /bin/sh
#----------------------------------------------------------------------
# Variables
PROGRAM =
LIBRARY =
LEXOBJECTS =
YACCOBJECTS =
COBJECTS =
CXXOBJECTS =
OBJECTS =
HEADERS =
CLEAN_FILES =
#----------------------------------------------------------------------
# Executables
CC = @CC@
AR = @AR@
LEX = @LEX@
YACC = @YACC@
RANLIB = @RANLIB@
SED = @SED@
INSTALL = @INSTALL@
#----------------------------------------------------------------------
# Flags
ARFLAGS = @ARFLAGS@
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
LDFLAGS = @LDFLAGS@
YACCFLAGS = @YACCFLAGS@
LEXFLAGS = @LEXFLAGS@
#======================================================================
# end $RCSfile$
#======================================================================
dnl -------------------------------------------------------------------
dnl
dnl Local autoconf macros
dnl
dnl $RCSfile$
dnl $Revision$
dnl $Author$
dnl $Date$
dnl
dnl -------------------------------------------------------------------
dnl
dnl Sets the top directory for the build
dnl
dnl Usage: AC_PATH_SET_TOPSRCDIR(PROGRAM_NAME)
dnl
AC_DEFUN(AC_PATH_SET_TOPSRCDIR,
[AC_MSG_CHECKING([top directory])
ac_cv_path_TOPSRCDIR=`pwd`
AC_MSG_RESULT(ok)
])dnl
dnl
dnl
dnl -------------------------------------------------------------------
dnl
#!/bin/sh
# Script for handling errors encountered while configuring source code.
# Copyright (C) 2000 Webcodex, Inc.
# Webcodex, Inc.
# 840 C Street, #621
# San Rafael, CA 94901
# http://www.webcodex.com
# 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, 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.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
case "$1" in
-h|--h|--he|--hel|--help)
echo "
This is 'config.err' - a script for handling configuration errors
Usage: $0 [OPTION]... ERR [ARGUMENT]...
Handle \`ERR [ARGUMENT]...' for ERR, or return an
error status if there is no known handling for ERR.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported ERR values:
dir Not in a supported directory
cc No compiler for the C language
bison No GNU bison
flex No GNU flex
"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo 1>&2 "
This is 'config.err' - a script for handling configuration errors
\$RCSfile$
\$Revision$
\$Author$
\$Date$
"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
dir)
echo 1>&2 "
*** ERROR: This script must run in a directory that ends with this path:
\`$2'.
"
exit 1
;;
cc)
echo 1>&2 "
*** ERROR: Your system seems to be missing a C compiler. You will need to
install one before you can to build and install this program. Check with
the documentation for your system to see how best to acquire or locate a C
compiler.
"
exit 1
;;
flex|bison)
echo 1>&2 "
*** ERROR: \`$1' is missing on your system. You will need to install
\`$1' to compile this program. You can get the source code for this
program from any GNU archive site.
"
exit 1
;;
*) echo 1>&2 "
*** ERROR: \`$1' is needed, and you do not seem to have it installed on
your system. You might have modified some files in a manner that is not
yet supported. Check the \`README' file. It tells you about the
requirements for compiling and installing this package. You may also
check at any GNU archive site, in case some other package might contain
this missing \`$1' program.
"
exit 1
;;
esac
exit 0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
AC_INIT(Makefile.vars.in)
AC_CONFIG_HEADER(config.h)
dnl
dnl -------------------------------------------------------------------
dnl Set the package and version
dnl -------------------------------------------------------------------
dnl
WEBPAGEVIEW_MAJOR_VERSION=0
WEBPAGEVIEW_MINOR_VERSION=0
WEBPAGEVIEW_MICRO_VERSION=1
WEBPAGEVIEW_VERSION=$WEBPAGEVIEW_MAJOR_VERSION.$WEBPAGEVIEW_MINOR_VERSION.$WEBPAGEVIEW_MICRO_VERSION
VERSION=$WEBPAGEVIEW_VERSION
PACKAGE=WEBPAGEVIEW
AC_SUBST(WEBPAGEVIEW_MAJOR_VERSION)
AC_SUBST(WEBPAGEVIEW_MINOR_VERSION)
AC_SUBST(WEBPAGEVIEW_MICRO_VERSION)
AC_DEFINE_UNQUOTED(WEBPAGEVIEW_MAJOR_VERSION,$WEBPAGEVIEW_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(WEBPAGEVIEW_MINOR_VERSION,$WEBPAGEVIEW_MINOR_VERSION)
AC_DEFINE_UNQUOTED(WEBPAGEVIEW_MICRO_VERSION,$WEBPAGEVIEW_MICRO_VERSION)
dnl
dnl -------------------------------------------------------------------
dnl Set configuration error script
dnl -------------------------------------------------------------------
dnl
CONFIG_ERR=`pwd`/config.err
dnl
dnl -------------------------------------------------------------------
dnl Make make system changes in the given subdirectories
dnl -------------------------------------------------------------------
dnl
SUBDIRS='src/kdelibs/kjs'
for subdir in $SUBDIRS; do
if (test -f "./$subdir/MakeSystemChanges.sh"); then
CWD=`pwd`
echo ">>> Setting up in $subdir";
cd $subdir;
./MakeSystemChanges.sh;
cd $CWD;
fi
done
dnl
dnl -------------------------------------------------------------------
dnl Check the host system configuration
dnl -------------------------------------------------------------------
dnl
AC_CANONICAL_HOST
case "$host" in
*macosx*) AC_DEFINE(MACOSX) ;;
esac
dnl
dnl -------------------------------------------------------------------
dnl Check for programs
dnl -------------------------------------------------------------------
dnl
AC_PROG_CC
if test -z "$ac_cv_prog_CC"; then
$CONFIG_ERR cc
exit 1
fi
CFLAGS="-DHAVE_CONFIG_H"
AC_SUBST(CFLAGS)
CXXFLAGS=$CFLAGS
AC_SUBST(CXXFLAGS)
AC_DECL_YYTEXT
AC_CHECK_PROGS(LEX, flex lex)
if test -z "$ac_cv_prog_LEX"; then
$CONFIG_ERR lex
exit 1
fi
LEXFLAGS="-I -d"
AC_SUBST(LEXFLAGS)
AC_CHECK_PROGS(YACC, bison)
if test "$ac_cv_prog_YACC" != "bison"; then
$CONFIG_ERR bison
exit 1
fi
YACCFLAGS="-d"
AC_SUBST(YACCFLAGS)
AC_CHECK_PROG(AR, ar, ar)
if test -z "$ac_cv_prog_AR"; then
$CONFIG_ERR ar
exit 1
fi
ARFLAGS="cr"
AC_SUBST(ARFLAGS)
AC_PROG_RANLIB
if test -z "$ac_cv_prog_RANLIB"; then
$CONFIG_ERR ranlib
exit 1
fi
AC_CHECK_PROGS(SED, sed)
if test -z "$ac_cv_prog_SED"; then
$CONFIG_ERR sed
exit 1
fi
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_ARG_PROGRAM
dnl
dnl -------------------------------------------------------------------
dnl Checks for header files.
dnl -------------------------------------------------------------------
dnl
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/param.h sys/mman.h sys/time.h sys/cdefs.h fnmatch.h sysent.h strings.h sys/stat.h sys/select.h sys/socket.h socketbits.h sigaction.h paths.h malloc.h limits.h dlfcn.h)
dnl
dnl -------------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
dnl -------------------------------------------------------------------
dnl
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME
dnl
dnl -------------------------------------------------------------------
dnl Checks for library functions.
dnl -------------------------------------------------------------------
dnl
AC_CHECK_FUNCS(socket vsnprintf seteuid setegid random strfmon stpcpy mkstemp gettimeofday setenv unsetenv mkstemps)
AC_LANG_SAVE
AC_LANG_C
AC_FUNC_VFORK
AC_CHECK_HEADERS(ieeefp.h float.h)
AC_CHECK_LIB(m, isinf, [
AC_DEFINE_UNQUOTED(HAVE_FUNC_ISINF, 1, [Define if you have isinf])
])
AC_CHECK_LIB(m, finite, [
AC_DEFINE_UNQUOTED(HAVE_FUNC_FINITE, 1, [Define if you have finite])
])
AC_CHECK_LIB(m, _finite, [
AC_DEFINE_UNQUOTED(HAVE_FUNC__FINITE, 1, [Define if you have _finite])
])
AC_CHECK_LIB(m, isnan, [
AC_DEFINE_UNQUOTED(HAVE_FUNC_ISNAN, 1, [Define if you have isnan])
])
dnl AC_CHECK_GETDOMAINNAME
dnl AC_CHECK_GETHOSTNAME
dnl AC_CHECK_RANDOM
dnl
dnl -------------------------------------------------------------------
dnl Output files
dnl -------------------------------------------------------------------
dnl
AC_OUTPUT(
Makefile
Makefile.vars
Makefile.rules
src/kdelibs/kjs/Makefile
src/kdelibs/khtml/xml/Makefile
)
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`