157434Smarkmdnl Process this file with autoconf to produce a configure script.
257434SmarkmAC_INIT(bonnie++.cpp)
374818SruAC_CONFIG_HEADER(conf.h)
474818SruAC_SUBST(version)
5114283Sruversion="1.03d"
6
7AC_SUBST(stripping)
8AC_ARG_ENABLE(stripping,
9      [  --disable-stripping  disables stripping of installed binaries],
10      STRIPPING=$strippingval, STRIPPING=no)
11if [[ ! "$STRIPPING" = "no" ]]; then
12  stripping=""
13else
14  stripping="-s"
15fi
16echo $DEB_BUILD_OPTIONS | grep -q nostrip
17if [[ "$?" = "0" ]]; then
18  stripping=""
19fi
20
21AC_SUBST(debug)
22AC_ARG_ENABLE(debug,
23      [  --with-debug  enables debug code generation for binaries],
24      debug=-g, debug="")
25echo $DEB_BUILD_OPTIONS | grep -q debug
26if [[ "$?" = "0" ]]; then
27  debug=-g
28fi
29
30dnl Checks for programs.
31AC_LANG_CPLUSPLUS
32AC_PROG_CXX
33AC_PROG_CXXCPP
34AC_PROG_INSTALL
35
36dnl Checks for typedefs, structures, and compiler characteristics.
37AC_C_CONST
38AC_TYPE_SIZE_T
39
40AC_SUBST(semun)
41AC_TRY_COMPILE(#include <sys/types.h>
42#include <sys/ipc.h>
43#include <sys/sem.h>
44    , union semun sem , semun="yes")
45if [[ -n "$semun" ]]; then
46   semun="#define SEMUN_IN_SEM_H"
47fi
48AC_SUBST(sa_sigaction)
49AC_TRY_COMPILE([#include <signal.h>]
50             , [struct sigaction sa; sa.sa_sigaction = 0]
51             , sa_sigaction=y)
52if [[ "$sa_sigaction" = "y" ]]; then
53  sa_sigaction="#define USE_SA_SIGACTION"
54fi
55AC_SUBST(bool)
56AC_TRY_COMPILE([], [bool var;] , , bool="typedef bool char;")
57AC_SUBST(true_false)
58AC_TRY_COMPILE(, [char c = true; char d = false;
59] , true_false="0", true_false="1")
60AC_SUBST(snprintf)
61AC_TRY_LINK([#include <stdio.h>], char buf[[10]]; snprintf(buf, sizeof(buf), "abc");,,snprintf="no");
62if [[ -n "$snprintf" ]]; then
63   snprintf="#define NO_SNPRINTF"
64fi
65
66AC_SUBST(exes)
67AC_SUBST(man8)
68AC_CHECK_HEADERS(vector.h vector, vec_exes="zcav" vec_man8="zcav.8", echo "STL not installed so no ZCAV!")
69exes="bonnie++ $vec_exes"
70man8="bonnie++.8 $vec_man8"
71AC_CHECK_HEADERS(algorithm algo.h algo)
72
73AC_SUBST(aix_mem_size)
74if [[ -f /etc/objrepos ]]; then
75  aix_mem_size="#define AIX_MEM_SIZE 1"
76fi
77
78AC_OUTPUT(Makefile bonnie.h port.h bonnie++.spec bon_csv2html bon_csv2txt sun/pkginfo)
79