File: configure.in

package info (click to toggle)
libepsilon 0.9.2+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,168 kB
  • ctags: 1,205
  • sloc: ansic: 11,329; sh: 9,321; perl: 936; xml: 86; makefile: 84
file content (204 lines) | stat: -rw-r--r-- 5,444 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
dnl
dnl $Id: configure.in,v 1.32 2011/05/27 10:47:34 simakov Exp $
dnl

AC_INIT(configure.in)

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(epsilon, 0.9.2)

AC_LANG_C
AC_PROG_CC
AC_SYS_LARGEFILE

dnl Library code modified:              REVISION++
dnl Interfaces changed/added/removed:   CURRENT++ REVISION=0
dnl Interfaces added:                   AGE++
dnl Interfaces removed:                 AGE=0
LT_CURRENT=1
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AM_PROG_LIBTOOL

dnl
dnl Check for POPT library
dnl

AC_CHECK_HEADER([popt.h], [have_popt_h=yes],)
AC_CHECK_LIB([popt], [poptGetContext], [have_popt_lib=yes], ,)

if test x$have_popt_h = xyes -a x$have_popt_lib = xyes ; then
    LIBS="$LIBS -lpopt"
else
    AC_MSG_ERROR([
=================================================
Configure script failed to find popt library!
You can download it from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/
=================================================])
fi

dnl
dnl POSIX threads support
dnl

AH_TEMPLATE([ENABLE_PTHREADS], [Define to 1 to enable POSIX threads support])

AC_ARG_ENABLE(
    pthreads,
    AC_HELP_STRING([--enable-pthreads], [Enable POSIX threads support [[default=no]]]),
    [
        if test x$enableval = xyes ; then
            AC_CHECK_HEADER([pthread.h], [have_pthread_h=yes],)
            AC_CHECK_LIB([pthread], [pthread_create], [have_pthread_lib=yes], ,)

            if test x$have_pthread_h = xyes -a x$have_pthread_lib = xyes ; then
                LIBS="$LIBS -lpthread"
                AC_DEFINE([ENABLE_PTHREADS], [1],)
            else
                AC_MSG_ERROR([
=================================================
Configure script failed to find pthread library!
Try `--disable-pthreads' option.
=================================================])
            fi
        fi
    ],
)

dnl
dnl Default number of threads
dnl

AC_ARG_WITH(def-threads,
    AC_HELP_STRING([--with-def-threads=N], [Default number of threads]),
    [
	CFLAGS="$CFLAGS -DDEF_N_THREADS=$withval"
	AC_MSG_CHECKING(default number of threads)
	AC_MSG_RESULT($withval)
    ]
)

dnl
dnl Maximal number of threads
dnl

AC_ARG_WITH(max-threads,
    AC_HELP_STRING([--with-max-threads=N], [Maximal number of threads]),
    [
	CFLAGS="$CFLAGS -DMAX_N_THREADS=$withval"
	AC_MSG_CHECKING(maximal number of threads)
	AC_MSG_RESULT($withval)
    ]
)

dnl
dnl Cluster mode
dnl

AH_TEMPLATE([ENABLE_CLUSTER], [Define to 1 to enable cluster mode])

AC_ARG_ENABLE(
    cluster,
    AC_HELP_STRING([--enable-cluster], [Enable cluster mode [[default=no]]]),
    [
        if test x$enableval = xyes ; then
            AC_CHECK_HEADERS([sys/types.h sys/socket.h sys/wait.h netinet/in.h arpa/inet.h syslog.h signal.h fcntl.h unistd.h], [],
                AC_MSG_ERROR([
=================================================
Configure script failed to enable cluster mode!
Try `--disable-cluster' option.
=================================================]))
            AC_CHECK_FUNCS([socket setsockopt bind listen accept fork setsid waitpid sigaction flock], [],
                AC_MSG_ERROR([
=================================================
Configure script failed to enable cluster mode!
Try `--disable-cluster' option.
=================================================]))
            AC_CHECK_HEADER([pthread.h], [have_pthread_h=yes],)
            AC_CHECK_LIB([pthread], [pthread_create], [have_pthread_lib=yes], ,)

            if test x$have_pthread_h = xyes -a x$have_pthread_lib = xyes ; then
                LIBS="$LIBS -lpthread"
                AC_DEFINE([ENABLE_PTHREADS], [1],)
            else
                AC_MSG_ERROR([
=================================================
Configure script failed to enable cluster mode!
Try `--disable-cluster' option.
=================================================])
            fi

            AC_DEFINE([ENABLE_CLUSTER], [1],)
        fi
    ],
)

dnl
dnl MPI support
dnl

AH_TEMPLATE([ENABLE_MPI], [Define to 1 to enable MPI support])

AC_ARG_ENABLE(
    mpi,
    AC_HELP_STRING([--enable-mpi], [Enable MPI support [[default=no]]]),
    [
        if test x$enableval = xyes ; then
            AC_CHECK_HEADER([mpi.h], [have_mpi_h=yes],)

            if test x$have_mpi_h = xyes ; then
                AC_DEFINE([ENABLE_MPI], [1],)
            else
                AC_MSG_ERROR([
=================================================
Configure script failed to find MPI library!
Try `--disable-mpi' option.
=================================================])
            fi
        fi
    ],
)

dnl
dnl Enable set validation
dnl

AH_TEMPLATE([ENABLE_SET_VALIDATION], [Define to 1 to enable set validation])

AC_ARG_ENABLE(
    set-validation,
    AC_HELP_STRING([--enable-set-validation], [Enable set validation [[default=no]]]),
    [
        if test x$enableval = xyes ; then
            AC_DEFINE([ENABLE_SET_VALIDATION], [1],)
        fi
    ],
)

AC_OUTPUT(
    Makefile
    src/Makefile
    filters/Makefile
    tools/Makefile
    lib/Makefile
    man/Makefile
    tests/lib/EPSILON/Makefile
    tests/lib/Test/PBM/Makefile
    tests/lib/Test/Makefile
    tests/lib/Makefile
    tests/t/Makefile
    tests/Makefile
    tests/build/Makefile
    tests/images/Makefile
)

dnl
dnl Output current VERSION into separate header file.
dnl This is a workaround for platforms that have no
dnl autotools support.
dnl

echo "#define VERSION \"$VERSION\"" > src/epsilon_version.h