+2009-01-30 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ [Gtk] Refactor autoconf/configure.ac in preparation for jsc and webkit build splits
+ https://bugs.webkit.org/show_bug.cgi?id=22136
+
+ * GNUmakefile.am:
+ * acinclude.m4: Removed.
+ * autogen.sh:
+ * autotools/acinclude.m4: Added.
+ * autotools/dolt.m4: Added.
+ * autotools/symbols.filter: Renamed from symbols.filter.
+ * autotools/webkit.m4: Added.
+ * configure.ac:
+
2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Nikolas Zimmermann.
endif
if OS_GNU
-version_script = -Wl,--version-script,$(srcdir)/symbols.filter
+version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
endif
# Shared libraries
libJavaScriptCore_la_LIBADD = \
$(UNICODE_LIBS) \
- $(GLOBALDEPS_LIBS) \
+ $(GLIB_LIBS) \
-lpthread
libJavaScriptCore_la_CXXFLAGS = \
-fstrict-aliasing \
-O3 \
$(global_cflags) \
- $(GLOBALDEPS_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(UNICODE_CFLAGS)
libJavaScriptCore_la_CPPFLAGS = \
libWebCore_la_CFLAGS = \
-fno-strict-aliasing \
$(global_cflags) \
- $(GLOBALDEPS_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(UNICODE_CFLAGS) \
$(LIBXML_CFLAGS) \
$(CAIRO_CFLAGS) \
libJavaScriptCore.la \
libWebCoreJS.la \
$(webcore_libadd) \
- $(GLOBALDEPS_LIBS) \
+ $(GLIB_LIBS) \
$(LIBXML_LIBS) \
$(CAIRO_LIBS) \
$(PANGO_LIBS) \
ORIGDIR=`pwd`
cd $srcdir
+LIBTOOLIZE_FLAGS="--force --automake"
+ACLOCAL_FLAGS="-I autotools"
+AUTOMAKE_FLAGS="--foreign --add-missing"
+
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
touch README INSTALL
-aclocal || exit $?
-$LIBTOOLIZE --force || exit $?
+aclocal $ACLOCAL_FLAGS || exit $?
+$LIBTOOLIZE $LIBTOOLIZE_FLAGS || exit $?
autoheader || exit $?
-automake --foreign --add-missing || exit $?
+automake $AUTOMAKE_FLAGS || exit $?
autoconf || exit $?
cd $ORIGDIR || exit 1
-dnl dolt, a replacement for libtool
-dnl Copyright © 2007-2008 Josh Triplett <josh@freedesktop.org>
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-dnl
-dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
-dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
-dnl installed when running autoconf on your project.
-
-AC_DEFUN([DOLT], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-# dolt, a replacement for libtool
-# Josh Triplett <josh@freedesktop.org>
-AC_PATH_PROG(DOLT_BASH, bash)
-AC_MSG_CHECKING([if dolt supports this host])
-dolt_supported=yes
-if test x$DOLT_BASH = x; then
- dolt_supported=no
-fi
-if test x$GCC != xyes; then
- dolt_supported=no
-fi
-case $host in
-i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
-|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
- pic_options='-fPIC'
- ;;
-i?86-apple-darwin*)
- pic_options='-fno-common'
- ;;
-*mingw32*)
- pic_options='-DDLL_EXPORT'
- ;;
-*)
- dolt_supported=no
- ;;
-esac
-if test x$dolt_supported = xno ; then
- AC_MSG_RESULT([no, falling back to libtool])
- LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
- LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
-else
- AC_MSG_RESULT([yes, replacing libtool])
-
-dnl Start writing out doltcompile.
- cat <<__DOLTCOMPILE__EOF__ >doltcompile
-#!$DOLT_BASH
-__DOLTCOMPILE__EOF__
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-args=("$[]@")
-for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
- if test x"${args@<:@$arg@:>@}" = x-o ; then
- objarg=$((arg+1))
- break
- fi
-done
-if test x$objarg = x ; then
- echo 'Error: no -o on compiler command line' 1>&2
- exit 1
-fi
-lo="${args@<:@$objarg@:>@}"
-obj="${lo%.lo}"
-if test x"$lo" = x"$obj" ; then
- echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
- exit 1
-fi
-objbase="${obj##*/}"
-__DOLTCOMPILE__EOF__
-
-dnl Write out shared compilation code.
- if test x$enable_shared = xyes; then
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-libobjdir="${obj%$objbase}.libs"
-if test ! -d "$libobjdir" ; then
- mkdir_out="$(mkdir "$libobjdir" 2>&1)"
- mkdir_ret=$?
- if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
- echo "$mkdir_out" 1>&2
- exit $mkdir_ret
- fi
-fi
-pic_object="$libobjdir/$objbase.o"
-args@<:@$objarg@:>@="$pic_object"
-__DOLTCOMPILE__EOF__
- cat <<__DOLTCOMPILE__EOF__ >>doltcompile
-"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
-__DOLTCOMPILE__EOF__
- fi
-
-dnl Write out static compilation code.
-dnl Avoid duplicate compiler output if also building shared objects.
- if test x$enable_static = xyes; then
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-non_pic_object="$obj.o"
-args@<:@$objarg@:>@="$non_pic_object"
-__DOLTCOMPILE__EOF__
- if test x$enable_shared = xyes; then
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
-__DOLTCOMPILE__EOF__
- else
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-"${args@<:@@@:>@}" || exit $?
-__DOLTCOMPILE__EOF__
- fi
- fi
-
-dnl Write out the code to write the .lo file.
-dnl The second line of the .lo file must match "^# Generated by .*libtool"
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-{
-echo "# $lo - a libtool object file"
-echo "# Generated by doltcompile, not libtool"
-__DOLTCOMPILE__EOF__
-
- if test x$enable_shared = xyes; then
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "pic_object='.libs/${objbase}.o'"
-__DOLTCOMPILE__EOF__
- else
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo pic_object=none
-__DOLTCOMPILE__EOF__
- fi
-
- if test x$enable_static = xyes; then
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo "non_pic_object='${objbase}.o'"
-__DOLTCOMPILE__EOF__
- else
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-echo non_pic_object=none
-__DOLTCOMPILE__EOF__
- fi
-
- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
-} > "$lo"
-__DOLTCOMPILE__EOF__
-
-dnl Done writing out doltcompile; substitute it for libtool compilation.
- chmod +x doltcompile
- LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
- LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
-
-dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
-dnl a target, so write out a libtool wrapper to handle that case.
-dnl Note that doltlibtool does not handle inferred tags or option arguments
-dnl without '=', because automake does not use them.
- cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
-#!$DOLT_BASH
-__DOLTLIBTOOL__EOF__
- cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
-top_builddir_slash="${0%%doltlibtool}"
-: ${top_builddir_slash:=./}
-args=()
-modeok=false
-tagok=false
-for arg in "$[]@"; do
- case "$arg" in
- --mode=compile) modeok=true ;;
- --tag=CC|--tag=CXX) tagok=true ;;
- *) args@<:@${#args[@]}@:>@="$arg" ;;
- esac
-done
-if $modeok && $tagok ; then
- . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
-else
- exec ${top_builddir_slash}libtool "$[]@"
-fi
-__DOLTLIBTOOL__EOF__
-
-dnl Done writing out doltlibtool; substitute it for libtool.
- chmod +x doltlibtool
- LIBTOOL='$(top_builddir)/doltlibtool'
-fi
-AC_SUBST(LTCOMPILE)
-AC_SUBST(LTCXXCOMPILE)
-# end dolt
-])
-
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_compare_version.html
# ===========================================================================
--- /dev/null
+dnl dolt, a replacement for libtool
+dnl Copyright © 2007-2008 Josh Triplett <josh@freedesktop.org>
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+dnl
+dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
+dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
+dnl installed when running autoconf on your project.
+
+AC_DEFUN([DOLT], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+# dolt, a replacement for libtool
+# Josh Triplett <josh@freedesktop.org>
+AC_PATH_PROG(DOLT_BASH, bash)
+AC_MSG_CHECKING([if dolt supports this host])
+dolt_supported=yes
+if test x$DOLT_BASH = x; then
+ dolt_supported=no
+fi
+if test x$GCC != xyes; then
+ dolt_supported=no
+fi
+case $host in
+i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \
+|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
+ pic_options='-fPIC'
+ ;;
+i?86-apple-darwin*)
+ pic_options='-fno-common'
+ ;;
+*mingw32*)
+ pic_options='-DDLL_EXPORT'
+ ;;
+*)
+ dolt_supported=no
+ ;;
+esac
+if test x$dolt_supported = xno ; then
+ AC_MSG_RESULT([no, falling back to libtool])
+ LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
+ LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
+else
+ AC_MSG_RESULT([yes, replacing libtool])
+
+dnl Start writing out doltcompile.
+ cat <<__DOLTCOMPILE__EOF__ >doltcompile
+#!$DOLT_BASH
+__DOLTCOMPILE__EOF__
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+args=("$[]@")
+for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
+ if test x"${args@<:@$arg@:>@}" = x-o ; then
+ objarg=$((arg+1))
+ break
+ fi
+done
+if test x$objarg = x ; then
+ echo 'Error: no -o on compiler command line' 1>&2
+ exit 1
+fi
+lo="${args@<:@$objarg@:>@}"
+obj="${lo%.lo}"
+if test x"$lo" = x"$obj" ; then
+ echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
+ exit 1
+fi
+objbase="${obj##*/}"
+__DOLTCOMPILE__EOF__
+
+dnl Write out shared compilation code.
+ if test x$enable_shared = xyes; then
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+libobjdir="${obj%$objbase}.libs"
+if test ! -d "$libobjdir" ; then
+ mkdir_out="$(mkdir "$libobjdir" 2>&1)"
+ mkdir_ret=$?
+ if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
+ echo "$mkdir_out" 1>&2
+ exit $mkdir_ret
+ fi
+fi
+pic_object="$libobjdir/$objbase.o"
+args@<:@$objarg@:>@="$pic_object"
+__DOLTCOMPILE__EOF__
+ cat <<__DOLTCOMPILE__EOF__ >>doltcompile
+"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
+__DOLTCOMPILE__EOF__
+ fi
+
+dnl Write out static compilation code.
+dnl Avoid duplicate compiler output if also building shared objects.
+ if test x$enable_static = xyes; then
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+non_pic_object="$obj.o"
+args@<:@$objarg@:>@="$non_pic_object"
+__DOLTCOMPILE__EOF__
+ if test x$enable_shared = xyes; then
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
+__DOLTCOMPILE__EOF__
+ else
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+"${args@<:@@@:>@}" || exit $?
+__DOLTCOMPILE__EOF__
+ fi
+ fi
+
+dnl Write out the code to write the .lo file.
+dnl The second line of the .lo file must match "^# Generated by .*libtool"
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+{
+echo "# $lo - a libtool object file"
+echo "# Generated by doltcompile, not libtool"
+__DOLTCOMPILE__EOF__
+
+ if test x$enable_shared = xyes; then
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+echo "pic_object='.libs/${objbase}.o'"
+__DOLTCOMPILE__EOF__
+ else
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+echo pic_object=none
+__DOLTCOMPILE__EOF__
+ fi
+
+ if test x$enable_static = xyes; then
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+echo "non_pic_object='${objbase}.o'"
+__DOLTCOMPILE__EOF__
+ else
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+echo non_pic_object=none
+__DOLTCOMPILE__EOF__
+ fi
+
+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
+} > "$lo"
+__DOLTCOMPILE__EOF__
+
+dnl Done writing out doltcompile; substitute it for libtool compilation.
+ chmod +x doltcompile
+ LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
+ LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'
+
+dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
+dnl a target, so write out a libtool wrapper to handle that case.
+dnl Note that doltlibtool does not handle inferred tags or option arguments
+dnl without '=', because automake does not use them.
+ cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
+#!$DOLT_BASH
+__DOLTLIBTOOL__EOF__
+ cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
+top_builddir_slash="${0%%doltlibtool}"
+: ${top_builddir_slash:=./}
+args=()
+modeok=false
+tagok=false
+for arg in "$[]@"; do
+ case "$arg" in
+ --mode=compile) modeok=true ;;
+ --tag=CC|--tag=CXX) tagok=true ;;
+ *) args@<:@${#args[@]}@:>@="$arg" ;;
+ esac
+done
+if $modeok && $tagok ; then
+ . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
+else
+ exec ${top_builddir_slash}libtool "$[]@"
+fi
+__DOLTLIBTOOL__EOF__
+
+dnl Done writing out doltlibtool; substitute it for libtool.
+ chmod +x doltlibtool
+ LIBTOOL='$(top_builddir)/doltlibtool'
+fi
+AC_SUBST(LTCOMPILE)
+AC_SUBST(LTCXXCOMPILE)
+# end dolt
+])
--- /dev/null
+dnl macros to check for JavaScriptCore and WebKit/Gtk+ dependencies
+dnl
+dnl The rationale is so that we can share these macros between
+dnl WebKit and JavaScriptCore builds.
+
+# global states
+m4_define([initialized], [no])
+
+# check for pkg-config
+AC_DEFUN([WEBKIT_INIT],
+[dnl
+dnl check if we have the required packages to have successful checks
+dnl
+# check for -fvisibility=hidden compiler support (GCC >= 4)
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
+AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
+AC_COMPILE_IFELSE([char foo;],
+ [ AC_MSG_RESULT([yes])
+ SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
+ AC_MSG_RESULT([no]))
+CFLAGS="$saved_CFLAGS"
+AC_SUBST(SYMBOL_VISIBILITY)
+AC_SUBST(SYMBOL_VISIBILITY_INLINES)
+
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test "$PKG_CONFIG" = "no"; then
+ AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
+fi
+
+AC_PATH_PROG(PERL, perl)
+if test -z "$PERL"; then
+ AC_MSG_ERROR([You need 'perl' to compile WebKit])
+fi
+
+AC_PATH_PROG(BISON, bison)
+if test -z "$BISON"; then
+ AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
+fi
+
+AC_PATH_PROG(MV, mv)
+if test -z "$MV"; then
+ AC_MSG_ERROR([You need 'mv' to compile WebKit])
+fi
+
+# If CXXFLAGS and CFLAGS are unset, default to empty.
+# This is to tell automake not to include '-g' if CXXFLAGS is not set
+# For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
+if test -z "$CXXFLAGS"; then
+ CXXFLAGS=""
+fi
+if test -z "$CFLAGS"; then
+ CFLAGS=""
+fi
+
+AM_PROG_CC_STDC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_SYS_LARGEFILE
+
+# Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
+# doesn't exist)
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
+AC_LANG_POP([C++])
+
+# C/C++ Language Features
+AC_C_CONST
+AC_C_INLINE
+AC_C_VOLATILE
+
+# C/C++ Headers
+AC_HEADER_STDC
+AC_HEADER_STDBOOL
+
+m4_define([initialized], [yes])
+])
+
+AC_DEFUN([WEBKIT_CHECK_DEPENDENCIES],
+[dnl
+dnl check for module dependencies
+for module in $1
+do
+ case $module in
+ glib) _WEBKIT_CHECK_GLIB ;;
+ unicode) _WEBKIT_CHECK_UNICODE ;;
+ *) AC_MSG_ERROR([I don't support that module. Sorry..]) ;;
+
+ esac
+done
+])
+
+AC_DEFUN([_WEBKIT_CHECK_GLIB],
+[dnl
+dnl check for glib
+# Version requirements
+GLIB_REQUIRED_VERSION=2.0
+GOBJECT_REQUIRED_VERSION=2.0
+GTHREAD_REQUIRED_VERSION=2.0
+
+PKG_CHECK_MODULES([GLIB],
+ [glib-2.0 >= $GLIB_REQUIRED_VERSION
+ gobject-2.0 >= $GOBJECT_REQUIRED_VERSION
+ gthread-2.0 >= $GTHREAD_REQUIRED_VERSION])
+AC_SUBST([GLIB_CFLAGS])
+AC_SUBST([GLIB_LIBS])
+
+# GTK+ port only
+# Check for glib-genmarshal and glib-mkenums
+AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
+AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
+if test -z "$GLIB_GENMARSHAL" || test -z "$GLIB_MKENUMS"; then
+ AC_MSG_ERROR([You need the GLib dev tools in your path])
+fi
+])
+
+AC_DEFUN([_WEBKIT_CHECK_UNICODE],
+[dnl
+dnl determine the Unicode backend
+AC_MSG_CHECKING([which Unicode backend to use])
+AC_ARG_WITH(unicode_backend,
+ AC_HELP_STRING([--with-unicode-backend=@<:@icu@:>@],
+ [Select Unicode backend [default=icu]]),
+ [],[unicode_backend="icu"])
+
+case "$unicode_backend" in
+ icu) ;;
+ *) AC_MSG_ERROR([Invalid Unicode backend: must be icu.]) ;;
+esac
+AC_MSG_RESULT([$unicode_backend])
+
+if test "$unicode_backend" = "icu"; then
+ if test "$os_darwin" = "yes"; then
+ UNICODE_CFLAGS="-I\$(srcdir)/JavaScriptCore/icu -I\$(srcdir)/WebCore/icu"
+ UNICODE_LIBS="-licucore"
+ elif test "$os_win32" = "yes"; then
+ UNICODE_CFLAGS=""
+ UNICODE_LIBS="-licuin -licuuc"
+ else
+ AC_PATH_PROG(icu_config, icu-config, no)
+ if test "$icu_config" = "no"; then
+ AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
+ fi
+
+ # We don't use --cflags as this gives us a lot of things that we don't
+ # necessarily want, like debugging and optimization flags
+ # See man (1) icu-config for more info.
+ UNICODE_CFLAGS=`$icu_config --cppflags`
+ UNICODE_LIBS=`$icu_config --ldflags`
+ fi
+fi
+AC_SUBST([UNICODE_CFLAGS])
+AC_SUBST([UNICODE_LIBS])
+])
AC_INIT([WebKit],[webkit_major_version.webkit_minor_version.webkit_micro_version],[http://bugs.webkit.org/])
+AC_CONFIG_MACRO_DIR([autotools])
+AC_CONFIG_AUX_DIR([autotools])
+AC_SUBST(ACLOCAL_AMFLAGS, "-I autotools")
+
AC_CONFIG_HEADERS([autotoolsconfig.h])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([foreign subdir-objects tar-ustar])
# host checking - inspired by the GTK+ configure.in
-# TODO: os_mac, os_bsd
+# TODO: move these to webkit.m4?
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
;;
esac
-# If CXXFLAGS and CFLAGS are unset, default to empty.
-# This is to tell automake not to include '-g' if CXXFLAGS is not set
-# For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
-if test -z "$CXXFLAGS"; then
- CXXFLAGS=""
-fi
-if test -z "$CFLAGS"; then
- CFLAGS=""
-fi
-
-AM_PROG_CC_STDC
-AM_PROG_CC_C_O
-AC_PROG_CXX
-AC_PROG_INSTALL
+# initialize webkit options
+WEBKIT_INIT
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
-AC_SYS_LARGEFILE
+# use dolt to speedup the build
DOLT
-# check for -fvisibility=hidden compiler support (GCC >= 4)
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
-AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
-AC_COMPILE_IFELSE([char foo;],
- [ AC_MSG_RESULT([yes])
- SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
- AC_MSG_RESULT([no]))
-CFLAGS="$saved_CFLAGS"
-AC_SUBST(SYMBOL_VISIBILITY)
-AC_SUBST(SYMBOL_VISIBILITY_INLINES)
-
-AC_PATH_PROG(PERL, perl)
-if test -z "$PERL"; then
- AC_MSG_ERROR([You need 'perl' to compile WebKit])
-fi
-
-AC_PATH_PROG(BISON, bison)
-if test -z "$BISON"; then
- AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
-else
- case "$target_cpu" in
- arm)
- BISON_VERSION=`$BISON --version | head -1 | sed 's,.*\ \([0-9]*\.[0-9]*\)$,\1,'`
- AX_COMPARE_VERSION([2.2],[gt],[$BISON_VERSION],
- AC_MSG_ERROR([You need at least version 2.2 of the 'bison' parser generator to compile WebKit correctly for ARM]))
- ;;
- *) ;;
- esac
-fi
-
AC_PATH_PROG(FLEX, flex)
if test -z "$FLEX"; then
AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
fi
-AC_PATH_PROG(MV, mv)
-if test -z "$MV"; then
- AC_MSG_ERROR([You need 'mv' to compile WebKit])
-fi
-
-# GTK+ port only
-# Check for glib-genmarshal and glib-mkenums
-AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
-AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
-if test -z "$GLIB_GENMARSHAL" || test -z "$GLIB_MKENUMS"; then
- AC_MSG_ERROR([You need the GLib dev tools in your path])
-fi
-
-# Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
-# doesn't exist)
-AC_LANG_PUSH([C++])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
-AC_LANG_POP([C++])
-
-# C/C++ Language Features
-AC_C_CONST
-AC_C_INLINE
-AC_C_VOLATILE
-
-# C/C++ Headers
-AC_HEADER_STDC
-AC_HEADER_STDBOOL
-
# pthread (not needed on Windows)
if test "$os_win32" = "no"; then
AC_CHECK_HEADERS([pthread.h],
fi
AC_SUBST([JPEG_LIBS])
-# check for pkg-config
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-if test "$PKG_CONFIG" = "no"; then
- AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
-fi
-
# Check for libpng the way Gtk+ does it
AC_MSG_CHECKING(for libpng12)
if $PKG_CONFIG --exists libpng12 ; then
fi
AC_SUBST([PNG_LIBS])
-# determine the Unicode backend
-AC_MSG_CHECKING([the Unicode backend to use])
-AC_ARG_WITH(unicode_backend,
- AC_HELP_STRING([--with-unicode-backend=@<:@icu@:>@],
- [Select Unicode backend [default=icu]]),
- [],[unicode_backend="icu"])
-
-case "$unicode_backend" in
- icu) ;;
- *) AC_MSG_ERROR([Invalid Unicode backend: must be icu.]) ;;
-esac
-
-AC_MSG_RESULT([$unicode_backend])
-
-if test "$unicode_backend" = "icu"; then
- AC_PATH_PROG(icu_config, icu-config, no)
- if test "$icu_config" = "no"; then
- if test "$os_darwin" = "yes"; then
- UNICODE_CFLAGS="-I\$(srcdir)/JavaScriptCore/icu -I\$(srcdir)/WebCore/icu"
- UNICODE_LIBS="-licucore"
- elif test "$os_win32" = "yes"; then
- UNICODE_CFLAGS=""
- UNICODE_LIBS="-licuin -licuuc"
- else
- AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
- fi
- else
- # We don't use --cflags as this gives us a lot of things that we don't
- # necessarily want, like debugging and optimization flags
- # See man (1) icu-config for more info.
- UNICODE_CFLAGS=`$icu_config --cppflags`
- UNICODE_LIBS=`$icu_config --ldflags`
- fi
-fi
-
-AC_SUBST([UNICODE_CFLAGS])
-AC_SUBST([UNICODE_LIBS])
-
# determine the GDK/GTK+ target
AC_MSG_CHECKING([the target windowing system])
AC_ARG_WITH(target,
LIBXML_REQUIRED_VERSION=2.6
# minimum GTK+ base dependencies
-GLIB_REQUIRED_VERSION=2.0
-GOBJECT_REQUIRED_VERSION=2.0
-GTHREAD_REQUIRED_VERSION=2.0
PANGO_REQUIRED_VERSION=1.0
GTK_REQUIRED_VERSION=2.8
SQLITE_REQUIRED_VERSION=3.0
GSTREAMER_REQUIRED_VERSION=0.10
-PKG_CHECK_MODULES([GLOBALDEPS],
- [glib-2.0 >= $GLIB_REQUIRED_VERSION
- gobject-2.0 >= $GOBJECT_REQUIRED_VERSION
- gthread-2.0 >= $GTHREAD_REQUIRED_VERSION])
-AC_SUBST([GLOBALDEPS_CFLAGS])
-AC_SUBST([GLOBALDEPS_LIBS])
-
+# Available modules
+#
+# glib - glib and includes gthread
+# unicode - check and identify which unicode backend to use
+#
+# todo: webcore gtk
+WEBKIT_CHECK_DEPENDENCIES([glib unicode])
+
PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED_VERSION)
AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_LIBS)