configure.ac 3.53 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
PIXMAN_VERSION=0.19.2
23

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

30 31 32 33 34 35
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=
)
36

37 38 39 40 41 42 43 44
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
])

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

52 53 54 55 56 57
AC_ARG_WITH([system_pixman],
  [AS_HELP_STRING([--with-system_pixman],
    [Use system installed pixman(default=no)])
  ]
)

58 59 60 61 62 63
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])
  ])
])

64 65 66 67 68 69 70

AS_IF([test "x$with_system_pixman" = "xyes"],
  [PKG_CHECK_MODULES([pixman], [pixman-1 >= $PIXMAN_VERSION], [PIXMAN=pixman],
    [AC_MSG_ERROR([--with-system-pixman requested but no pixman(>=$PIXMAN_VERSION) package found])
  ])
])

71 72 73
if test "$OBJ_PATH" != ""; then
SDK_DIR=$OBJ_PATH/dist
IDL_DIR=$OBJ_PATH/dist/idl
74 75 76 77 78
ENGINE_CFLAGS="-I$OBJ_PATH/dist/include -I$OBJ_PATH/dist/include/mozilla -I$OBJ_PATH/dist/include/dom"
AS_IF([test "x$with_system_nspr" = "xyes"],
  [ENGINE_CFLAGS="${ENGINE_CFLAGS} `pkg-config --cflags-only-I nspr`"],
  [ENGINE_CFLAGS="${ENGINE_CFLAGS} -I$OBJ_PATH/dist/include/nspr"]
)
79 80 81 82 83

AS_IF([test "x$with_system_pixman" = "xyes"],
  [ENGINE_CFLAGS="${ENGINE_CFLAGS} `pkg-config --cflags-only-I pixman-1`"],
  [ENGINE_CFLAGS="${ENGINE_CFLAGS} -I$OBJ_PATH/dist/include/pixman"]
)
84
ENGINE_LIBS="-L$OBJ_PATH/dist/sdk/lib -lxpcomglue_s -lxul"
85
else
86
PKG_CHECK_MODULES(ENGINE, libxul $NSPR,
87 88 89
[
    SDK_DIR=`pkg-config --variable=sdkdir libxul`
    IDL_DIR=`pkg-config --variable=idldir libxul`
90
    INCLUDE_DIR=`pkg-config --variable=includedir libxul`
91 92 93 94 95 96 97 98 99 100

    AS_IF([test "x$with_system_nspr" = "xyes"],
      [ENGINE_CFLAGS="${ENGINE_CFLAGS} `pkg-config --cflags-only-I nspr`"],
      [ENGINE_CFLAGS="${ENGINE_CFLAGS} -I$INCLUDE_DIR/nspr"]
    )

    AS_IF([test "x$with_system_pixman" = "xyes"],
      [ENGINE_CFLAGS="${ENGINE_CFLAGS} `pkg-config --cflags-only-I pixman-1`"],
      [ENGINE_CFLAGS="${ENGINE_CFLAGS} -I$INCLUDE_DIR/pixman"]
    )
101
])
102 103 104
fi
AC_SUBST(SDK_DIR)
AC_SUBST(IDL_DIR)
105

106

107 108 109
# Required flags
CXXFLAGS="$CXXFLAGS -include mozilla-config.h -std=gnu++0x -fno-rtti -fvisibility=hidden "
# random warnings hide
110 111 112 113 114
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
115
CXXFLAGS="$CXXFLAGS -fno-exceptions "
116 117 118 119 120 121 122 123 124

AC_SUBST(ENGINE_CFLAGS)
AC_SUBST(ENGINE_LIBS)

AC_OUTPUT([
    Makefile
    history/Makefile
    chromehelper/Makefile
    prompt/Makefile
Tatiana Meshkova's avatar
Tatiana Meshkova committed
125
    jscomps/Makefile
Tatiana Meshkova's avatar
Tatiana Meshkova committed
126
    touchhelper/Makefile
127
    jsscripts/Makefile
128
    widgetfactory/Makefile
129
    overrides/Makefile
130
])