2 AC_INIT(stressapptest, 1.0.3_autoconf, opensource@google.com)
6 # Checking for target cpu and setting custom configuration
7 # for the different platforms
11 AC_DEFINE([STRESSAPPTEST_CPU_X86_64],[],
12 [Defined if the target CPU is x86_64])
15 AC_DEFINE([STRESSAPPTEST_CPU_I686],[],
16 [Defined if the target CPU is i686])
19 AC_DEFINE([STRESSAPPTEST_CPU_PPC],[],
20 [Defined if the target CPU is PowerPC])
23 AC_DEFINE([STRESSAPPTEST_CPU_ARMV7A],[],
24 [Defined if the target CPU is armv7a])
27 AC_MSG_ERROR([$target_cpu is not supported! Try x86_64, i686, powerpc, or armv7a])
32 ## The following allows like systems to share settings. This is not meant to
33 ## imply that these OS are the same thing. From OpenOffice dmake configure.in
37 AC_DEFINE([STRESSAPPTEST_OS_LINUX],[],
38 [Defined if the target OS is Linux])
42 AC_DEFINE([STRESSAPPTEST_OS_DARWIN],[],
43 [Defined if the target OS is OSX])
47 AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
48 [Defined if the target OS is BSD based])
52 AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
53 [Defined if the target OS is BSD based])
56 AC_MSG_ERROR([$_os operating system is not suitable to build dmake!])
60 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
61 AC_CONFIG_SRCDIR([src/])
62 AC_CONFIG_HEADER([src/stressapptest_config.h])
64 # Checks for programs.
65 # Don't generate CXXFLAGS defaults: if CXXFLAGS are unset
66 # AC_PROG_CXX will override them with unwanted defaults.
71 #Getting user and host info
73 AC_MSG_CHECKING([user ID])
74 AC_MSG_RESULT([$username])
77 AC_MSG_CHECKING([host name])
78 AC_MSG_RESULT([$hostname])
81 AC_MSG_CHECKING([current timestamp])
82 AC_MSG_RESULT([$timestamp])
84 AC_DEFINE_UNQUOTED([STRESSAPPTEST_TIMESTAMP],
85 "$username @ $hostname on $timestamp",
86 [Timestamp when ./configure was executed])
89 CXXFLAGS="$CXXFLAGS -DCHECKOPTS"
90 CXXFLAGS="$CXXFLAGS -Wreturn-type -Wunused -Wuninitialized -Wall -Wno-psabi"
91 CXXFLAGS="$CXXFLAGS -O3 -funroll-all-loops -funroll-loops -DNDEBUG"
93 # Checks for header files.
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])
99 # Checks for typedefs, structures, and compiler characteristics.
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 -static -lrt -pthread -laio"
117 # Checking for pthreads
118 pthread_arg="not_available"
119 AC_MSG_CHECKING([if pthreads is supported])
121 pthread_header="#include<pthread.h>"
122 pthread_body="pthread_create(0,0,0,0)"
123 # Check if compile with no extra argument
124 AC_LINK_IFELSE([AC_LANG_PROGRAM($pthread_header, $pthread_body)],
127 if test x"$pthread_arg" = x"not_available"; then
128 AC_MSG_FAILURE([Cannot find a proper pthread library])
133 # Checking for libaio
134 libaio_arg="not_available"
135 AC_MSG_CHECKING([if libaio is supported])
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)],
143 if test x"$libaio_arg" = x"not_available"; then
144 AC_MSG_FAILURE([Cannot find libaio library, please install libaio-dev])
150 librt_arg="not_available"
151 AC_MSG_CHECKING([if librt is supported])
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)],
159 if test x"$librt_arg" = x"not_available"; then
160 AC_MSG_FAILURE([Cannot find librt library])
166 # Checks for library functions.
167 AC_FUNC_CLOSEDIR_VOID
168 AC_PROG_GCC_TRADITIONAL
169 AC_FUNC_SELECT_ARGTYPES
173 AC_CHECK_FUNCS([gettimeofday memset select socket strtol strtoull])
175 AC_CONFIG_FILES([Makefile src/Makefile])