diff --git a/Makefile.am b/Makefile.am index ddeb3efd..595a5aea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,10 +45,12 @@ libuv_la_SOURCES = src/fs-poll.c \ src/version.c if SUNOS +if GCC # Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers # on other platforms complain that the argument is unused during compilation. libuv_la_CFLAGS += -pthreads endif +endif if WINNT @@ -141,14 +143,20 @@ check_PROGRAMS = test/run-tests if OS390 test_run_tests_CFLAGS = else +if GCC test_run_tests_CFLAGS = -Wno-long-long +else +test_run_tests_CFLAGS = +endif endif if SUNOS +if GCC # Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers # on other platforms complain that the argument is unused during compilation. test_run_tests_CFLAGS += -pthreads endif +endif test_run_tests_LDFLAGS = test_run_tests_SOURCES = test/blackhole-server.c \ @@ -324,7 +332,9 @@ test_run_tests_CFLAGS += -D_GNU_SOURCE endif if SUNOS -test_run_tests_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500 +test_run_tests_CFLAGS += -D__EXTENSIONS__ \ + -D_XOPEN_SOURCE=500 \ + -D_REENTRANT endif if OS390 @@ -462,7 +472,9 @@ endif if SUNOS uvinclude_HEADERS += include/uv/sunos.h -libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500 +libuv_la_CFLAGS += -D__EXTENSIONS__ \ + -D_XOPEN_SOURCE=500 \ + -D_REENTRANT libuv_la_SOURCES += src/unix/no-proctitle.c \ src/unix/sunos.c endif diff --git a/configure.ac b/configure.ac index 931ac3e3..fb1b0acd 100644 --- a/configure.ac +++ b/configure.ac @@ -24,16 +24,18 @@ AC_ENABLE_SHARED AC_ENABLE_STATIC AC_PROG_CC AM_PROG_CC_C_O -AS_IF([AS_CASE([$host_os],[openedition*], [false], [true])], [ - CC_CHECK_CFLAGS_APPEND([-pedantic]) -]) CC_FLAG_VISIBILITY #[-fvisibility=hidden] CC_CHECK_CFLAGS_APPEND([-g]) -CC_CHECK_CFLAGS_APPEND([-std=gnu89]) -CC_CHECK_CFLAGS_APPEND([-Wall]) -CC_CHECK_CFLAGS_APPEND([-Wextra]) -CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter]) -CC_CHECK_CFLAGS_APPEND([-Wstrict-prototypes]) +AS_IF([test "x$GCC" = xyes], [ + AS_IF([AS_CASE([$host_os], [openedition*], [false], [true])], [ + CC_CHECK_CFLAGS_APPEND([-pedantic]) + ]) + CC_CHECK_CFLAGS_APPEND([-std=gnu89]) + CC_CHECK_CFLAGS_APPEND([-Wall]) + CC_CHECK_CFLAGS_APPEND([-Wextra]) + CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter]) + CC_CHECK_CFLAGS_APPEND([-Wstrict-prototypes]) +]) # AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12. m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # autoconf complains if AC_PROG_LIBTOOL precedes AM_PROG_AR. @@ -50,6 +52,7 @@ AC_CHECK_LIB([rt], [clock_gettime]) AC_CHECK_LIB([sendfile], [sendfile]) AC_CHECK_LIB([socket], [socket]) AC_SYS_LARGEFILE +AM_CONDITIONAL([GCC], [AS_IF([test "x$GCC" = xyes], [true], [false])]) AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])]) AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])]) AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false])])