~bladernr/opencompute/stressapptest

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Michael Prokop
  • Date: 2010-07-29 13:04:19 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100729130419-mamp4xaaivhgw64j
Tags: 1.0.3-1
* [e723f0c] Merging upstream version 1.0.3.
* [0713e49] Bump Standards-Version to 3.9.1.
* [9466bfa] Add libaio-dev to Build-Depends.
* [b6a48bb] Rework autoconf handling in debian/rules. (Closes:
  #575495) - thanks to Reinhard Tartler <siretart@tauware.de>
  for helping.
* [c60a573] Switch to dpkg-source 3.0 (quilt) format.
* [05108de] Add quilt patch to build non-static.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
AC_PREREQ(2.61)
2
 
AC_INIT(stressapptest, 1.0.1_autoconf, opensource@google.com)
 
2
AC_INIT(stressapptest, 1.0.3_autoconf, opensource@google.com)
3
3
 
4
4
AC_CANONICAL_HOST
5
5
AC_CANONICAL_BUILD
7
7
# for the different platforms
8
8
AC_CANONICAL_TARGET
9
9
case x"$target_cpu" in
10
 
"xx86_64")
11
 
  AC_DEFINE([STRESSAPPTEST_CPU_X86_64],[],
12
 
            [Defined if the target CPU is x86_64])
13
 
;;
14
 
"xi686")
15
 
  AC_DEFINE([STRESSAPPTEST_CPU_I686],[],
16
 
            [Defined if the target CPU is i686])
17
 
;;
18
 
"xpowerpc")
19
 
  AC_DEFINE([STRESSAPPTEST_CPU_PPC],[],
20
 
            [Defined if the target CPU is PowerPC])
21
 
;;
 
10
  "xx86_64")
 
11
    AC_DEFINE([STRESSAPPTEST_CPU_X86_64],[],
 
12
              [Defined if the target CPU is x86_64])
 
13
    ;;
 
14
  "xi686")
 
15
    AC_DEFINE([STRESSAPPTEST_CPU_I686],[],
 
16
              [Defined if the target CPU is i686])
 
17
    ;;
 
18
  "xpowerpc")
 
19
    AC_DEFINE([STRESSAPPTEST_CPU_PPC],[],
 
20
              [Defined if the target CPU is PowerPC])
 
21
    ;;
 
22
  "xarmv7a")
 
23
    AC_DEFINE([STRESSAPPTEST_CPU_ARMV7A],[],
 
24
              [Defined if the target CPU is armv7a])
 
25
    ;;
 
26
  *)
 
27
    AC_MSG_ERROR([$target_cpu is not supported! Try x86_64, i686, powerpc, or armv7a])
 
28
    ;;
22
29
esac
23
30
 
24
31
_os=`uname`
25
32
## The following allows like systems to share settings. This is not meant to
26
33
## imply that these OS are the same thing. From OpenOffice dmake configure.in
27
34
case "$_os" in
28
 
        "Linux")
29
 
          OS_VERSION=linux
30
 
          AC_DEFINE([STRESSAPPTEST_OS_LINUX],[],
31
 
                    [Defined if the target OS is Linux])
32
 
          ;;
33
 
        "Darwin")
34
 
          OS_VERSION=macosx
35
 
          AC_DEFINE([STRESSAPPTEST_OS_DARWIN],[],
36
 
                    [Defined if the target OS is OSX])
37
 
          ;;
38
 
        "FreeBSD")
39
 
          OS_VERSION=bsd
40
 
          AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
41
 
                    [Defined if the target OS is BSD based])
42
 
          ;;
43
 
        "NetBSD")
44
 
          OS_VERSION=bsd
45
 
          AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
46
 
                    [Defined if the target OS is BSD based])
47
 
          ;;
48
 
   *)
49
 
      AC_MSG_ERROR([$_os operating system is not suitable to build dmake!])
50
 
      ;;
 
35
  "Linux")
 
36
    OS_VERSION=linux
 
37
    AC_DEFINE([STRESSAPPTEST_OS_LINUX],[],
 
38
              [Defined if the target OS is Linux])
 
39
    ;;
 
40
  "Darwin")
 
41
    OS_VERSION=macosx
 
42
    AC_DEFINE([STRESSAPPTEST_OS_DARWIN],[],
 
43
              [Defined if the target OS is OSX])
 
44
    ;;
 
45
  "FreeBSD")
 
46
    OS_VERSION=bsd
 
47
    AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
 
48
              [Defined if the target OS is BSD based])
 
49
    ;;
 
50
  "NetBSD")
 
51
    OS_VERSION=bsd
 
52
    AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
 
53
              [Defined if the target OS is BSD based])
 
54
    ;;
 
55
  *)
 
56
    AC_MSG_ERROR([$_os operating system is not suitable to build dmake!])
 
57
    ;;
51
58
esac
52
59
 
53
60
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
75
82
AC_MSG_RESULT([$timestamp])
76
83
 
77
84
AC_DEFINE_UNQUOTED([STRESSAPPTEST_TIMESTAMP],
78
 
                   "$username @ $hostname on $timestamp",
79
 
                   [Timestamp when ./configure was executed])
 
85
                   "$username @ $hostname on $timestamp",
 
86
                   [Timestamp when ./configure was executed])
80
87
 
81
88
#Default cxxflags
82
89
CXXFLAGS="$CXXFLAGS -DCHECKOPTS"
83
 
CXXFLAGS="$CXXFLAGS -Wreturn-type -Wunused -Wuninitialized -Wall"
 
90
CXXFLAGS="$CXXFLAGS -Wreturn-type -Wunused -Wuninitialized -Wall -Wno-psabi"
84
91
CXXFLAGS="$CXXFLAGS -O3 -funroll-all-loops  -funroll-loops -DNDEBUG"
85
92
 
86
93
# Checks for header files.
87
94
AC_HEADER_DIRENT
88
95
AC_HEADER_STDC
89
96
AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
 
97
AC_CHECK_HEADERS([pthread.h libaio.h])
90
98
 
91
99
# Checks for typedefs, structures, and compiler characteristics.
92
100
AC_HEADER_STDBOOL
99
107
AC_TYPE_UINT16_T
100
108
AC_C_VOLATILE
101
109
 
 
110
 
 
111
# These are the libraries stressapptest requires to build.
 
112
# We'll check that they work, and fail otherwise.
 
113
# In the future we may provide for testing alternate
 
114
# arguments, but that's not necessary now.
 
115
LIBS="$LIBS -lrt -pthread -laio"
 
116
 
102
117
# Checking for pthreads
103
118
pthread_arg="not_available"
104
 
AC_MSG_CHECKING([which argument is required to compile pthreads])
 
119
AC_MSG_CHECKING([if pthreads is supported])
105
120
 
106
121
pthread_header="#include<pthread.h>"
107
122
pthread_body="pthread_create(0,0,0,0)"
110
125
pthread_arg="")
111
126
 
112
127
if test x"$pthread_arg" = x"not_available"; then
113
 
  # At first, only -pthread was tested, but this is the place
114
 
  # to add extra pthread flags if someone can test them
115
 
  bkp_LDFLAGS="$LDFLAGS"
116
 
  for altheader in -pthread; do
117
 
    LDFLAGS="$bkp_LDFLAGS $altheader"
118
 
    AC_LINK_IFELSE([AC_LANG_PROGRAM($pthread_header, $pthread_body)],
119
 
    pthread_arg="$altheader")
120
 
    LDFLAGS="$bkp_LDFLAGS"
121
 
  done
122
 
fi
123
 
 
124
 
if test x"$pthread_arg" = x"not_available"; then
125
 
   AC_MSG_FAILURE([Cannot find a proper pthread library])
126
 
else
127
 
   if test x"$pthread_arg" = x; then
128
 
     AC_MSG_RESULT([none])
129
 
   else
130
 
     AC_MSG_RESULT([$pthread_arg])
131
 
   fi
132
 
   LDFLAGS="$LDFLAGS $pthread_arg"
133
 
fi
 
128
  AC_MSG_FAILURE([Cannot find a proper pthread library])
 
129
else
 
130
  AC_MSG_RESULT([yes])
 
131
fi
 
132
 
 
133
# Checking for libaio
 
134
libaio_arg="not_available"
 
135
AC_MSG_CHECKING([if libaio is supported])
 
136
 
 
137
libaio_header="#include<libaio.h>"
 
138
libaio_body="io_submit(0,0,0)"
 
139
# Check if compile with no extra argument
 
140
AC_LINK_IFELSE([AC_LANG_PROGRAM($libaio_header, $libaio_body)],
 
141
libaio_arg="")
 
142
 
 
143
if test x"$libaio_arg" = x"not_available"; then
 
144
  AC_MSG_FAILURE([Cannot find libaio library, please install libaio-dev])
 
145
else
 
146
  AC_MSG_RESULT([yes])
 
147
fi
 
148
 
 
149
# Checking for librt
 
150
librt_arg="not_available"
 
151
AC_MSG_CHECKING([if librt is supported])
 
152
 
 
153
librt_header="#include<sys/shm.h>"
 
154
librt_body="shm_open(0, 0, 0)"
 
155
# Check if compile with no extra argument
 
156
AC_LINK_IFELSE([AC_LANG_PROGRAM($librt_header, $librt_body)],
 
157
librt_arg="")
 
158
 
 
159
if test x"$librt_arg" = x"not_available"; then
 
160
  AC_MSG_FAILURE([Cannot find librt library])
 
161
else
 
162
  AC_MSG_RESULT([yes])
 
163
fi
 
164
 
134
165
 
135
166
# Checks for library functions.
136
167
AC_FUNC_CLOSEDIR_VOID