Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 89 lines (78 sloc) 2.599 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
# configure.ac - configures jscoverage
# Copyright (C) 2007, 2008 siliconforks.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 of the License, 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

AC_PREREQ(2.61)
AC_INIT([jscoverage], [0.4])
AM_INIT_AUTOMAKE([-Wall foreign])
AC_CONFIG_SRCDIR([jscoverage.c])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_HOST

# Checks for programs.
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CXX

# Checks for libraries.
AM_ICONV

# Checks for header files.
AC_CHECK_HEADERS([pthread.h])
AC_CHECK_HEADERS([iconv.h])
AC_CHECK_HEADERS([windows.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN

# Checks for library functions.
AC_CHECK_FUNCS([getaddrinfo gethostbyname_r inet_aton strndup vasprintf asprintf])
AC_MSG_CHECKING([for MultiByteToWideChar])
AC_LANG(C)
AC_LINK_IFELSE(
  [AC_LANG_PROGRAM([[#include <windows.h>]],[[MultiByteToWideChar(0,0,0,0,0,0);]])],
  [AC_DEFINE([HAVE_MULTIBYTETOWIDECHAR], [1], [Define to 1 if you have the `MultiByteToWideChar' function.])
   jscoverage_have_multibytetowidechar=yes
   AC_MSG_RESULT([yes])],
  [jscoverage_have_multibytetowidechar=no
   AC_MSG_RESULT([no])])

AC_SUBST([XP_DEF])
case "$host_os" in
  mingw*)
    XP_DEF='-DXP_WIN'
    ;;
  *)
    XP_DEF='-DXP_UNIX'
    ;;
esac

AC_SUBST([EXTRA_SOCKET_LIBS])
AC_SUBST([EXTRA_THREAD_LIBS])
AC_SUBST([EXTRA_TIMER_LIBS])
case "$host_os" in
  mingw*)
    EXTRA_SOCKET_LIBS='-lws2_32'
    EXTRA_THREAD_LIBS=''
    EXTRA_TIMER_LIBS='-lwinmm'
    ;;
  *)
    EXTRA_SOCKET_LIBS=''
    EXTRA_THREAD_LIBS='-lpthread'
    EXTRA_TIMER_LIBS=''
    ;;
esac

if test "$am_cv_func_iconv" != yes && test "$jscoverage_have_multibytetowidechar" != yes
then
  echo -ne '\033@<:@1;31m'
  AC_MSG_WARN([neither iconv nor Windows character encoding conversion functions found])
  AC_MSG_WARN([only ASCII will be supported])
  echo -ne '\033@<:@0m'
fi

AC_CONFIG_FILES([Makefile make-dist.sh make-bin-dist.sh tests/Makefile])
AC_OUTPUT
Something went wrong with that request. Please try again.