X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=m4%2Fpandora_platform.m4;h=ee361c715b443206cbf982385fc554051caa3130;hb=558dbc482b4285c064b15b7d6889a7e2860c96f2;hp=aaec77def23772631aefc01ad6be2c460664d12d;hpb=3cc0dd0ea0b37e346bbc187042c76149f2870ebf;p=awesomized%2Flibmemcached diff --git a/m4/pandora_platform.m4 b/m4/pandora_platform.m4 index aaec77de..ee361c71 100644 --- a/m4/pandora_platform.m4 +++ b/m4/pandora_platform.m4 @@ -23,11 +23,20 @@ AC_DEFUN([PANDORA_PLATFORM],[ case "$host_os" in - *solaris*|*freebsd*) + *solaris*) AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[ CPPFLAGS="${CPPFLAGS} -I/usr/local/include" ]) + AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[ + LDFLAGS="${LDFLAGS} -L/usr/local/lib" + ]) + ;; + *freebsd*) + AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[ + CPPFLAGS="${CPPFLAGS} -isystem /usr/local/include" + ]) + AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[ LDFLAGS="${LDFLAGS} -L/usr/local/lib" ]) @@ -50,6 +59,7 @@ AC_DEFUN([PANDORA_PLATFORM],[ *solaris*) TARGET_SOLARIS="true" PANDORA_OPTIMIZE_BITFIELD=0 + AS_IF([test "x${USE_NLS}" = "xyes"],[LIBS="${LIBS} -lintl"]) AC_SUBST(TARGET_SOLARIS) AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris]) ;; @@ -59,12 +69,32 @@ AC_DEFUN([PANDORA_PLATFORM],[ AC_DEFINE([TARGET_OS_FREEBSD], [1], [Whether we are building for FreeBSD]) AC_DEFINE([__APPLE_CC__],[1],[Workaround for bug in FreeBSD headers]) ;; - *) + *mingw32*) + TARGET_WINDOWS="true" + AC_SUBST(TARGET_WINDOWS) + AC_DEFINE([TARGET_OS_WINDOWS], [1], [Whether we are building for Windows]) + AC_DEFINE([WINVER], [WindowsXP], [Version of Windows]) + AC_DEFINE([_WIN32_WINNT], [0x0501], [Magical number to make things work]) + AC_DEFINE([EAI_SYSTEM], [11], [Another magical number]) + AH_BOTTOM([ +#ifndef HAVE_SYS_SOCKET_H +# define SHUT_RD SD_RECEIVE +# define SHUT_WR SD_SEND +# define SHUT_RDWR SD_BOTH +#endif + ]) + + LIBS="$LIBS -lwsock32 -lws2_32" + AM_CFLAGS="${AM_CFLAGS} -I\${top_srcdir}/win32/mingw -I\${top_builddir}/win32/mingw -I\${top_srcdir}/win32 -I\${top_builddir}/win32" ;; esac + AM_CONDITIONAL(BUILD_WIN32, [test "x${TARGET_WINDOWS}" = "xtrue"]) + AM_CONDITIONAL(TARGET_OSX, [test "x${TARGET_OSX}" = "xtrue"]) + AM_CONDITIONAL(TARGET_LINUX, [test "x${TARGET_LINUX}" = "xtrue"]) AC_SUBST(PANDORA_OPTIMIZE_BITFIELD) + AC_CHECK_DECL([__clang__], [CLANG="yes"], [CLANG="no"]) AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) AC_CHECK_DECL([__ICC], [INTELCC="yes"], [INTELCC="no"])