1# Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl> 2# 3# Permission to use, copy, modify, and/or distribute this software for any 4# purpose with or without fee is hereby granted, provided that the above 5# copyright notice and this permission notice appear in all copies. 6# 7# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 15AC_PREREQ(2.57) 16AC_INIT([libuv], [1.44.1], [https://github.com/libuv/libuv/issues]) 17AC_CONFIG_MACRO_DIR([m4]) 18m4_include([m4/libuv-extra-automake-flags.m4]) 19m4_include([m4/as_case.m4]) 20m4_include([m4/libuv-check-flags.m4]) 21AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects] UV_EXTRA_AUTOMAKE_FLAGS) 22AC_CANONICAL_HOST 23AC_ENABLE_SHARED 24AC_ENABLE_STATIC 25AC_PROG_CC 26AM_PROG_CC_C_O 27 28CC_ATTRIBUTE_VISIBILITY([default], [ 29 CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"]) 30]) 31CC_CHECK_CFLAGS_APPEND([-fno-strict-aliasing]) 32CC_CHECK_CFLAGS_APPEND([-g]) 33CC_CHECK_CFLAGS_APPEND([-std=gnu89]) 34CC_CHECK_CFLAGS_APPEND([-Wall]) 35CC_CHECK_CFLAGS_APPEND([-Wextra]) 36CC_CHECK_CFLAGS_APPEND([-Wno-long-long]) 37CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter]) 38CC_CHECK_CFLAGS_APPEND([-Wstrict-prototypes]) 39# AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12. 40m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 41# autoconf complains if AC_PROG_LIBTOOL precedes AM_PROG_AR. 42AC_PROG_LIBTOOL 43m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 44LT_INIT 45AX_PTHREAD([ 46 LIBS="$LIBS $PTHREAD_LIBS" 47 CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 48]) 49AC_SEARCH_LIBS([dlopen], [dl]) 50AC_SEARCH_LIBS([kstat_lookup], [kstat]) 51AC_SEARCH_LIBS([gethostbyname], [nsl]) 52AC_SEARCH_LIBS([perfstat_cpu], [perfstat]) 53AC_SEARCH_LIBS([clock_gettime], [rt]) 54AC_SEARCH_LIBS([sendfile], [sendfile]) 55AC_SEARCH_LIBS([socket], [socket]) 56AC_SYS_LARGEFILE 57AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])]) 58AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])]) 59AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false])]) 60AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os],[darwin*], [true], [false])]) 61AM_CONDITIONAL([DRAGONFLY],[AS_CASE([$host_os],[dragonfly*], [true], [false])]) 62AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[*freebsd*], [true], [false])]) 63AM_CONDITIONAL([HAIKU], [AS_CASE([$host_os],[haiku], [true], [false])]) 64AM_CONDITIONAL([HURD], [AS_CASE([$host_os],[gnu*], [true], [false])]) 65AM_CONDITIONAL([LINUX], [AS_CASE([$host_os],[linux*], [true], [false])]) 66AM_CONDITIONAL([MSYS], [AS_CASE([$host_os],[msys*], [true], [false])]) 67AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])]) 68AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])]) 69AM_CONDITIONAL([OS390], [AS_CASE([$host_os],[openedition*], [true], [false])]) 70AM_CONDITIONAL([OS400], [AS_CASE([$host_os],[os400], [true], [false])]) 71AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])]) 72AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])]) 73AS_CASE([$host_os],[mingw*], [ 74 LIBS="$LIBS -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -luser32" 75]) 76AS_CASE([$host_os], [netbsd*], [AC_CHECK_LIB([kvm], [kvm_open])]) 77AS_CASE([$host_os], [kfreebsd*], [ 78 LIBS="$LIBS -lfreebsd-glue" 79]) 80AS_CASE([$host_os], [haiku], [ 81 LIBS="$LIBS -lnetwork" 82]) 83AC_CHECK_HEADERS([sys/ahafs_evProds.h]) 84AC_CONFIG_FILES([Makefile libuv.pc]) 85AC_CONFIG_LINKS([test/fixtures/empty_file:test/fixtures/empty_file]) 86AC_CONFIG_LINKS([test/fixtures/load_error.node:test/fixtures/load_error.node]) 87AC_CONFIG_LINKS([test/fixtures/lorem_ipsum.txt:test/fixtures/lorem_ipsum.txt]) 88AC_OUTPUT 89