File: acinclude.m4

package info (click to toggle)
cpl-plugin-sinfo 2.5.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,512 kB
  • ctags: 3,661
  • sloc: ansic: 82,282; sh: 11,405; makefile: 711; python: 278
file content (307 lines) | stat: -rw-r--r-- 9,423 bytes parent folder | download
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# LIB_CHECK_FFTW
#------------------
# Checks for the fftw library and header files.
AC_DEFUN([LIB_CHECK_FFTW],
[

    AC_MSG_CHECKING([for fftw])

    detmon_fftw_check_header="fftw3.h"
    detmon_fftw_check_lib="libfftw3f.a"

    detmon_fftw_includes=""
    detmon_fftw_libraries=""

    AC_ARG_WITH(fftw,
                AC_HELP_STRING([--with-fftw],
                               [location where fftw is installed]),
                [
                    detmon_with_fftw_includes=$withval/include
                    detmon_with_fftw_libs=$withval/lib
                ])

    AC_ARG_WITH(fftw-includes,
                AC_HELP_STRING([--with-fftw-includes],
                               [location of the fftw header files]),
                detmon_with_fftw_includes=$withval)

    AC_ARG_WITH(fftw-libs,
                AC_HELP_STRING([--with-fftw-libs],
                               [location of the fftw library]),
                detmon_with_fftw_libs=$withval)

    AC_ARG_ENABLE(fftw-test,
                  AC_HELP_STRING([--disable-fftw-test],
                                 [disables checks for the fftw library and headers]),
                  detmon_enable_fftw_test=$enableval,
                  detmon_enable_fftw_test=yes)


    if test "x$detmon_enable_fftw_test" = xyes; then

        # Check for the fftw includes

        if test -z "$detmon_with_fftw_includes"; then
            detmon_fftw_incdirs="/opt/fftw/include /usr/local/include /usr/include"

            test -n "$CPLDIR" && detmon_fftw_incdirs="$CPLDIR/include \
                $detmon_fftw_incdirs"

            test -n "$FFTWDIR" && detmon_fftw_incdirs="$FFTWDIR/include \
                $detmon_fftw_incdirs"
        else
            detmon_fftw_incdirs="$detmon_with_fftw_includes"
        fi

        ESO_FIND_FILE($detmon_fftw_check_header, $detmon_fftw_incdirs,
                      detmon_fftw_includes)


        # Check for the fftw library

        if test -z "$detmon_with_fftw_libs"; then
            detmon_fftw_libdirs="/opt/fftw/lib /usr/local/lib /usr/lib"

            test -n "$CPLDIR" && detmon_fftw_libdirs="$CPLDIR/lib \
                $detmon_fftw_libdirs"

            test -n "$FFTWDIR" && detmon_fftw_libdirs="$FFTWDIR/lib \
                $detmon_fftw_libdirs"
        else
            detmon_fftw_libdirs="$detmon_with_fftw_libs"
        fi

        ESO_FIND_FILE($detmon_fftw_check_lib, $detmon_fftw_libdirs,
                      detmon_fftw_libraries)


        if test x"$detmon_fftw_includes" = xno || \
            test x"$detmon_fftw_libraries" = xno; then
            detmon_fftw_notfound=""

            if test x"$detmon_fftw_includes" = xno; then
                if test x"$detmon_fftw_libraries" = xno; then
                    detmon_fftw_notfound="(headers and libraries)"
                else
                    detmon_fftw_notfound="(headers)"
                fi
            else
                detmon_fftw_notfound="(libraries)"
            fi

            AC_MSG_ERROR([fftw $detmon_fftw_notfound was not found on your system. Please check!])
        else
            AC_MSG_RESULT([libraries $detmon_fftw_libraries, headers $detmon_fftw_includes])
        fi

        # Set up the symbols

        FFTW_INCLUDES="-I$detmon_fftw_includes"
        FFTW_LDFLAGS="-L$detmon_fftw_libraries"
        LDFLAGS="$LDFLAGS $FFTW_LDFLAGS"
        AC_CHECK_LIB([fftw3f], [main], [LIBFFTWC="-lfftw3f"], AC_MSG_ERROR([Library fftwcblas not found]))
	AC_DEFINE_UNQUOTED(HAVE_FFTW, 1, [Define to 1 if you have FFTW v. 3.X])
        LIBS="$LIBS $LIBFFTWC"
        LIBFFTW="$LIBFFTWC"
    else
        AC_MSG_RESULT([disabled])
        AC_MSG_WARN([fftw checks have been disabled! This package may not build!])
        FFTW_INCLUDES=""
        FFTW_LDFLAGS=""
        LIBFFTW=""
    fi

    # To be removed after CPL switched to fftw
    FFTW_INCLUDES="$FFTW_INCLUDES"
    FFTW_LDFLAGS="$FFTW_LDFLAGS"
    LIBFFTW="$LIBFFTW"

    AC_SUBST(FFTW_INCLUDES)
    AC_SUBST(FFTW_LDFLAGS)
    AC_SUBST(LIBFFTW)

])


# SINFONI_SET_PREFIX(PREFIX)
#---------------------------
AC_DEFUN([SINFONI_SET_PREFIX],
[
    unset CDPATH
    # make $PIPE_HOME the default for the installation
    AC_PREFIX_DEFAULT($1)

    if test "x$prefix" = "xNONE"; then
        prefix=$ac_default_prefix
        ac_configure_args="$ac_configure_args --prefix $prefix"
    fi

    if test "x$exec_prefix" = "xNONE"; then
        exec_prefix=$prefix
    fi

])


# SINFONI_SET_VERSION_INFO(VERSION, [CURRENT], [REVISION], [AGE])
#----------------------------------------------------------------
# Setup various version information, especially the libtool versioning
AC_DEFUN([SINFONI_SET_VERSION_INFO],
[
    sinfoni_version=`echo "$1" | sed -e 's/[[a-z,A-Z]].*$//'`

    sinfoni_major_version=`echo "$sinfoni_version" | \
        sed 's/\([[0-9]]*\).\(.*\)/\1/'`
    sinfoni_minor_version=`echo "$sinfoni_version" | \
        sed 's/\([[0-9]]*\).\([[0-9]]*\)\(.*\)/\2/'`
    sinfoni_micro_version=`echo "$sinfoni_version" | \
        sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`

    if test -z "$sinfoni_major_version"; then
        sinfoni_major_version=0
    fi

    if test -z "$sinfoni_minor_version"; then
        sinfoni_minor_version=0
    fi

    if test -z "$sinfoni_micro_version"; then
        sinfoni_micro_version=0
    fi

    SINFONI_VERSION="$sinfoni_version"
    SINFONI_MAJOR_VERSION=$sinfoni_major_version
    SINFONI_MINOR_VERSION=$sinfoni_minor_version
    SINFONI_MICRO_VERSION=$sinfoni_micro_version

    if test -z "$4"; then
        SINFONI_INTERFACE_AGE=0
    else
        SINFONI_INTERFACE_AGE="$4"
    fi

    SINFONI_BINARY_AGE=`expr 100 '*' $SINFONI_MINOR_VERSION + $SINFONI_MICRO_VERSION`
    SINFONI_BINARY_VERSION=`expr 10000 '*' $SINFONI_MAJOR_VERSION + \
                          $SINFONI_BINARY_AGE`

    AC_SUBST(SINFONI_VERSION)
    AC_SUBST(SINFONI_MAJOR_VERSION)
    AC_SUBST(SINFONI_MINOR_VERSION)
    AC_SUBST(SINFONI_MICRO_VERSION)
    AC_SUBST(SINFONI_INTERFACE_AGE)
    AC_SUBST(SINFONI_BINARY_VERSION)
    AC_SUBST(SINFONI_BINARY_AGE)

    AC_DEFINE_UNQUOTED(SINFONI_MAJOR_VERSION, $SINFONI_MAJOR_VERSION,
                       [SINFONI major version number])
    AC_DEFINE_UNQUOTED(SINFONI_MINOR_VERSION, $SINFONI_MINOR_VERSION,
                       [SINFONI minor version number])
    AC_DEFINE_UNQUOTED(SINFONI_MICRO_VERSION, $SINFONI_MICRO_VERSION,
                       [SINFONI micro version number])
    AC_DEFINE_UNQUOTED(SINFONI_INTERFACE_AGE, $SINFONI_INTERFACE_AGE,
                       [SINFONI interface age])
    AC_DEFINE_UNQUOTED(SINFONI_BINARY_VERSION, $SINFONI_BINARY_VERSION,
                       [SINFONI binary version number])
    AC_DEFINE_UNQUOTED(SINFONI_BINARY_AGE, $SINFONI_BINARY_AGE,
                       [SINFONI binary age])

    ESO_SET_LIBRARY_VERSION([$2], [$3], [$4])
])


# SINFONI_SET_PATHS
#------------------
# Define auxiliary directories of the installed directory tree.
AC_DEFUN([SINFONI_SET_PATHS],
[

    if test -z "$plugindir"; then
        plugindir='${libdir}/cpl/plugins/${PACKAGE}-${VERSION}'
    fi

    if test -z "$privatelibdir"; then
        privatelibdir='${libdir}/${PACKAGE}-${VERSION}'
    fi

    if test -z "$pipedocsdir"; then
        pipedocsdir='${datadir}/doc/esopipes/${PACKAGE}-${VERSION}'
    fi

    htmldir='${pipedocsdir}/html'

    if test -z "$confdir"; then
       configdir='${datadir}/${PACKAGE}/config'
    fi

    if test -z "$wkfextradir"; then
        wkfextradir='${datadir}/esopipes/${PACKAGE}-${VERSION}/reflex'
    fi

    if test -z "$wkfcopydir"; then
        wkfcopydir='${datadir}/reflex/workflows/${PACKAGE}-${VERSION}'
    fi

    AC_SUBST(plugindir)
    AC_SUBST(privatelibdir)
    AC_SUBST(htmldir)
    AC_SUBST(pipedocsdir)
    AC_SUBST(configdir)
    AC_SUBST(wkfextradir)
    AC_SUBST(wkfcopydir)

    # Define a preprocesor symbol for the plugin search paths

    AC_DEFINE_UNQUOTED(SINFONI_PLUGIN_DIR, "esopipes-plugins",
                       [Plugin directory tree prefix])

    eval plugin_dir="$plugindir"
    plugin_path=`eval echo $plugin_dir | \
                sed -e "s/\/${PACKAGE}-${VERSION}.*$//"`

    AC_DEFINE_UNQUOTED(SINFONI_PLUGIN_PATH, "$plugin_path",
                       [Absolute path to the plugin directory tree])

])


# SINFONI_CREATE_SYMBOLS
#-----------------------
# Define include and library related makefile symbols
AC_DEFUN([SINFONI_CREATE_SYMBOLS],
[

    # Symbols for package include file and library search paths

    SINFONI_INCLUDES='-I$(top_srcdir)/sinfoni'
    IRPLIB_INCLUDES='-I$(top_srcdir)/irplib'

    SINFONI_LDFLAGS='-L$(top_builddir)/sinfoni'
    IRPLIB_LDFLAGS='-I$(top_builddir)/irplib'

    # Library aliases

    LIBSINFONI='$(top_builddir)/sinfoni/libsinfo.la'
    LIBIRPLIB='$(top_builddir)/irplib/libirplib.la'

    # Substitute the defined symbols

    AC_SUBST(SINFONI_INCLUDES)
    AC_SUBST(SINFONI_LDFLAGS)
    AC_SUBST(IRPLIB_INCLUDES)
    AC_SUBST(IRPLIB_LDFLAGS)

    AC_SUBST(LIBSINFONI)
    AC_SUBST(LIBIRPLIB)

    # Check for CPL and user defined libraries
    AC_REQUIRE([CPL_CHECK_LIBS])
    AC_REQUIRE([ESO_CHECK_EXTRA_LIBS])

    all_includes='$(SINFONI_INCLUDES) $(IRPLIB_INCLUDES) $(CPL_INCLUDES) $(CX_INCLUDES) $(EXTRA_INCLUDES)'
    all_ldflags='$(SINFONI_LDFLAGS) $(IRPLIB_LDFLAGS) $(CPL_LDFLAGS) $(CX_LDFLAGS) $(EXTRA_LDFLAGS)'

    AC_SUBST(all_includes)
    AC_SUBST(all_ldflags)
])