Merge from Trond
[m6w6/libmemcached] / m4 / pandora_use_pipe.m4
1 dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 dnl
4 dnl pandora-build: A pedantic build system
5 dnl Copyright (C) 2009 Sun Microsystems, Inc.
6 dnl This file is free software; Sun Microsystem
7 dnl gives unlimited permission to copy and/or distribute it,
8 dnl with or without modifications, as long as this notice is preserved.
9 dnl
10 dnl From Monty Taylor
11 dnl
12 dnl Test if we can Use -pipe to avoid making temp files during the compile.
13 dnl Should speed up compile on slower disks
14
15 AC_DEFUN([PANDORA_USE_PIPE],[
16
17 AS_IF([test "$GCC" = "yes"],[
18 AC_CACHE_CHECK([for working -pipe], [pandora_cv_use_pipe], [
19 AC_RUN_IFELSE([AC_LANG_SOURCE([[
20 #include <stdio.h>
21
22 int main(int argc, char** argv)
23 {
24 (void) argc; (void) argv;
25 return 0;
26 }
27 ]])],
28 [pandora_cv_use_pipe=yes],
29 [pandora_cv_use_pipe=no])
30 ])
31 AS_IF([test "$pandora_cv_use_pipe" = "yes"],[
32 AM_CFLAGS="-pipe ${AM_CFLAGS}"
33 AM_CXXFLAGS="-pipe ${AM_CXXFLAGS}"
34 ])
35 ])
36 ])