configure.ac 2.52 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
AC_INIT(configure.ac)
AM_CONFIG_HEADER(config.h)

VERSION=1.0.0

AM_INIT_AUTOMAKE(historycomponent, $VERSION)

AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
13 14
AC_DISABLE_STATIC
AM_DISABLE_STATIC
15 16 17 18
AC_PROG_RANLIB
AC_HEADER_STDC
AM_PROG_LIBTOOL
AC_PROG_CPP
19 20 21
PKG_PROG_PKG_CONFIG

NSPR_VERSION=4.9.6
22

23 24 25
if test "$PYTHON" == ""; then
    PYTHON=python
fi
26
AC_SUBST(PYTHON)
27 28
echo "Using PYTHON=$PYTHON"

29 30 31 32 33 34
AC_ARG_WITH(engine-path,
    AC_HELP_STRING([--with-engine-path[=path_to_obj_build_dir]],
                   [Specify engine path (default=)]
    ),
    with_engine=$withval, with_engine=
)
35

36 37 38 39 40 41 42 43
OBJ_PATH=
AC_ARG_WITH(engine-path,
[  --with-engine-path[[=DIR]]       use engine obj build in DIR],[
  if test "$withval" != "no" -a "$withval" != "yes"; then
    OBJ_PATH=$withval
  fi
])

44 45 46 47 48 49 50 51 52 53 54 55 56
NSPR=mozilla-nspr
AC_ARG_WITH([system-nspr],
  [AS_HELP_STRING([--with-system-nspr],
    [Use system installed NSPR(default=no)])
  ]
)

AS_IF([test "x$with_system_nspr" = "xyes"],
  [PKG_CHECK_MODULES([nspr], [nspr >= $NSPR_VERSION], [NSPR=nspr],
    [AC_MSG_ERROR([--with-system-nspr requested but no nspr(>=$NSPR_VERSION) package found])
  ])
])

57 58 59
if test "$OBJ_PATH" != ""; then
SDK_DIR=$OBJ_PATH/dist
IDL_DIR=$OBJ_PATH/dist/idl
60
ENGINE_CFLAGS="-I$OBJ_PATH/dist/include -I$OBJ_PATH/dist/include/nspr -I$OBJ_PATH/dist/include/mozilla -I$OBJ_PATH/dist/include/dom -I/usr/include/nspr4"
61
ENGINE_LIBS="-L$OBJ_PATH/dist/sdk/lib -lxpcomglue_s -lxul -lmozalloc"
62
else
63
PKG_CHECK_MODULES(ENGINE, libxul $NSPR,
64 65 66
[
    SDK_DIR=`pkg-config --variable=sdkdir libxul`
    IDL_DIR=`pkg-config --variable=idldir libxul`
67 68
    INCLUDE_DIR=`pkg-config --variable=includedir libxul`
    ENGINE_CFLAGS="$ENGINE_CFLAGS -I$INCLUDE_DIR/nspr"
69
])
70 71 72
fi
AC_SUBST(SDK_DIR)
AC_SUBST(IDL_DIR)
73

74

75 76 77
# Required flags
CXXFLAGS="$CXXFLAGS -include mozilla-config.h -std=gnu++0x -fno-rtti -fvisibility=hidden "
# random warnings hide
78 79 80 81 82
CXXFLAGS="$CXXFLAGS -Wno-attributes -Wno-ignored-qualifiers -Wall "
CXXFLAGS="$CXXFLAGS -Wno-unused-parameter -Wpointer-arith -Woverloaded-virtual "
CXXFLAGS="$CXXFLAGS -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy "
CXXFLAGS="$CXXFLAGS -Wno-format -Wno-overlength-strings -Wno-invalid-offsetof "
CXXFLAGS="$CXXFLAGS -Wno-variadic-macros -Wno-long-long  -Wno-psabi "
Tatiana Meshkova's avatar
Tatiana Meshkova committed
83
CXXFLAGS="$CXXFLAGS -fno-exceptions "
84 85 86 87 88 89 90 91 92

AC_SUBST(ENGINE_CFLAGS)
AC_SUBST(ENGINE_LIBS)

AC_OUTPUT([
    Makefile
    history/Makefile
    chromehelper/Makefile
    prompt/Makefile
Tatiana Meshkova's avatar
Tatiana Meshkova committed
93
    jscomps/Makefile
Tatiana Meshkova's avatar
Tatiana Meshkova committed
94
    touchhelper/Makefile
95
    jsscripts/Makefile
96
    widgetfactory/Makefile
97
    overrides/Makefile
98
])