Permalink
Browse files

Fix build on cygwin after switch to -std=c++11

  • Loading branch information...
1 parent 2f9b8f9 commit 700c8996987ef45f605e34049d4d64eb4bc96726 @DarthGandalf DarthGandalf committed Aug 13, 2014
Showing with 15 additions and 1 deletion.
  1. +14 −0 configure.ac
  2. +1 −1 modules/modperl/Makefile.inc
View
@@ -87,6 +87,8 @@ case "${host_os}" in
ISSUN=1
;;
cygwin)
+ # We don't want to use -std=gnu++11 instead of -std=c++11, but among other things, -std=c++11 defines __STRICT_ANSI__ which makes cygwin not to compile: undefined references to strerror_r, to fdopen, to strcasecmp, etc (their declarations in system headers are between ifdef)
+ appendCXX -U__STRICT_ANSI__
ISCYGWIN=1
;;
darwin*)
@@ -641,6 +643,18 @@ AC_CONFIG_FILES([znc-uninstalled.pc])
AC_CONFIG_FILES([modules/Makefile])
AC_OUTPUT
+if test "x$ISCYGWIN" = x1; then
+ # Side effect of undefining __STRICT_ANSI__
+ # http://llvm.org/bugs/show_bug.cgi?id=13530
+ echo >> include/znc/zncconfig.h
+ echo '#ifndef ZNCCONFIG_H_ADDITIONS' >> include/znc/zncconfig.h
+ echo '#define ZNCCONFIG_H_ADDITIONS' >> include/znc/zncconfig.h
+ echo '#ifdef __clang__' >> include/znc/zncconfig.h
+ echo 'struct __float128;' >> include/znc/zncconfig.h
+ echo '#endif' >> include/znc/zncconfig.h
+ echo '#endif' >> include/znc/zncconfig.h
+fi
+
echo
echo ZNC AC_PACKAGE_VERSION configured
echo
@@ -8,7 +8,7 @@ PERL_LD := $(shell $(PERL) -MExtUtils::Embed -e ldopts)
PERL_CXX += -Wno-write-strings -Wno-redundant-decls -Wno-missing-declarations
PERL_CXX += -Wno-type-limits -Wno-sign-compare -Wno-strict-overflow -Wno-unused-value
# perl 5.20 will fix this warning: https://rt.perl.org/Public/Bug/Display.html?id=120670
-PERL_CXX += -Wno-reserved-user-defined-literal
+PERL_CXX += -Wno-reserved-user-defined-literal -Wno-literal-suffix
# This is for SWIG
PERL_CXX += -DSWIG_TYPE_TABLE=znc
PERLCEXT_EXT := $(shell $(PERL) -MConfig -e'print $$Config::Config{dlext}')

0 comments on commit 700c899

Please sign in to comment.