gecko-dev/webshell/embed/gtk/configure.in
ramiro%netscape.com a7b2911bcd Fix a small typo.
1999-09-10 23:30:39 +00:00

135 lines
3.4 KiB
Plaintext

AC_INIT(lib/gtkmozilla.h)
AM_INIT_AUTOMAKE(gtkmozilla, 0.1)
dnl Specify a header configuration file
AM_CONFIG_HEADER(config.h)
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
dnl Initialize libtool
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
dnl Build time sanity check
AM_SANITY_CHECK
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_ISC_POSIX
dnl Checks for libraries.
AM_PATH_GTK(1.2.0)
AC_CHECK_LIB(pthread, pthread_attr_init,
USE_PTHREADS=1 LIBPTHREAD="-lpthread")
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_ARG_ENABLE(debug,
[ --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],
,
enable_debug=minimum)
if test "x$enable_debug" = "xyes"; then
DEBUG_FLAGS="-g -DENABLE_DEBUG"
else
if test "x$enable_debug" = "xno"; then
DEBUG_FLAGS=""
else
DEBUG_FLAGS=""
fi
fi
AC_SUBST(DEBUG_FLAGS)
dnl Check for Mozilla.
dnl ========================================================
AC_ARG_WITH(mozilla,
[ --with-mozilla=\$dir location of mozilla directory],
MOZ_DIR=$withval,
AC_MSG_ERROR(You must specify where mozilla lives with --with-mozilla.))
MOZILLA_DIR="${MOZ_DIR}"
AC_ARG_WITH(nspr,
[ --with-nspr=\$dir location of nspr headers and libs],
NSPR_DIR=$withval, NSPR_DIR=)
if test -z "$NSPR_DIR"; then
NSPR_DIR=$MOZILLA_DIR/dist
fi
dnl ========================================================
dnl By default, turn rtti and exceptions off on g++/egcs
dnl ========================================================
if test "$GXX" = "yes"; then
_MOZ_RTTI_FLAGS=${_COMPILER_PREFIX}-fno-rtti
AC_MSG_CHECKING(for C++ exceptions flag)
dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
[echo "int main() { return 0; }" | cat > conftest.C
${CXX-g++} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
if egrep "warning.*renamed" conftest.out >/dev/null; then
ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
else
ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
fi
rm -f conftest*])
AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
_MOZ_EXCEPTIONS_FLAGS=$ac_cv_cxx_exceptions_flags
fi
dnl C++ rtti (g++/egcs only - for now)
dnl Should be smarter and check that the compiler does indeed have rtti
AC_ARG_ENABLE(cpp-rtti,
[ --enable-cpp-rtti Enable C++ RTTI ],
[if test "$enableval" = "yes"; then
_MOZ_RTTI_FLAGS=${_COMPILER_PREFIX}-frtti
fi])
dnl C++ exceptions (g++/egcs only - for now)
dnl Should be smarter and check that the compiler does indeed have exceptions
AC_ARG_ENABLE(cpp-exceptions,
[ --enable-cpp-exceptions Enable C++ exceptions ],
[if test "$enableval" = "yes"; then
_MOZ_EXCEPTIONS_FLAGS=${_COMPILER_PREFIX}-fexceptions
fi])
AC_ARG_WITH(pthreads,
[ --with-pthreads use system pthread library ],
[if test "$withval" = "yes"; then
if test -z "$USE_PTHREADS"; then
AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support]);
fi
else
USE_PTHREADS=
LIBPTHREAD=
fi])
CXXFLAGS="$CXXFLAGS $_MOZ_RTTI_FLAGS $_MOZ_EXCEPTIONS_FLAGS"
AC_SUBST(MOZILLA_DIR)
AC_SUBST(NSPR_DIR)
AC_SUBST(LIBPTHREAD)
AC_OUTPUT(
Makefile
lib/Makefile
examples/Makefile
examples/simplebrowser/Makefile
examples/helpbrowser/Makefile
examples/helpbrowser/help_data/Makefile
)