File: configure.ac

package info (click to toggle)
munipack 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,104 kB
  • sloc: cpp: 29,677; sh: 4,909; f90: 2,872; makefile: 278; python: 140; xml: 72; awk: 12
file content (233 lines) | stat: -rw-r--r-- 7,989 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
dnl
dnl  Copyright © 1997-2025 F.Hroch (hroch@physics.muni.cz)
dnl
dnl  This file is part of Munipack.
dnl
dnl  Munipack is free software: you can redistribute it and/or modify
dnl  it under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation, either version 3 of the License, or
dnl  (at your option) any later version.
dnl
dnl  Munipack is distributed in the hope that it will be useful,
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with Munipack.  If not, see <http://www.gnu.org/licenses/>.
dnl

AC_PREREQ([2.69])

dnl The macro(s) has been added during bootstraping:
AC_INIT([Munipack],[0.6.2],[hroch@physics.muni.cz],
 	[munipack],[https://munipack.physics.muni.cz])
dnl .

AC_DEFINE(PACKAGE_COPYLEFT,["(C) 1997-2025 F.Hroch <hroch@physics.muni.cz>"],
				 [package copyleft])
AC_DEFINE(PACKAGE_DESCRIPTION,["An astronomical image processing software"],
				   [package description])

AC_CANONICAL_BUILD

AM_INIT_AUTOMAKE

AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_FC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_AWK

AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_C_CONST
AC_FUNC_MALLOC

AC_FC_MODULE_FLAG
AC_FC_MODULE_OUTPUT_FLAG
AC_FC_MODULE_EXTENSION
dnl The above macros are defined for recent Autotools, for some older ones,
dnl uncomment, and modify, these subtitutions (and comment out the above lines
dnl and AC_PREREQ):
dnl AC_SUBST(FC_MODEXT,[mod])
dnl AC_SUBST(FC_MODINC,[-I])
dnl AC_SUBST(FC_MODOUT,[-J])

dnl Define the AM_ include path for Fortran modules: required for OakLeaf.
dnl Both the paths are commonly unassigned to C/C++ compilers by default.
AC_SUBST(AM_FC_MODINC,["${FC_MODINC}/usr/include ${FC_MODINC}/usr/local/include"])

dnl Variables LIBM, LIBCFITSIO, LIBMINPACK and LIBOAKLEAF needs to be
dnl defined to link ONLY to necessary libraries.
dnl Else, C++ will add links against to uselles, Fortran, libraries and vice versa.
dnl Autotools functions AC_*_LIB forms LIBS variable by such way.

dnl math
AC_CHECK_HEADERS([math.h])
AC_SEARCH_LIBS([sqrt],[m],AC_SUBST(LIBM,[-lm]))

dnl Perhaps, nsl and socket libraries are required for cfitsio by
dnl section `2.3 Linking Programs ...' of CFITSIO User’s Reference Guide
AC_SEARCH_LIBS([gethostbyname],[nsl])
AC_SEARCH_LIBS([connect],[socket])

dnl The mandatory libraries are: cfitsio, minpack, plplot and oakleaf.

dnl cfitsio
AC_CHECK_HEADERS([fitsio.h])
AC_CHECK_LIB([cfitsio],[ffclos],AC_SUBST(LIBCFITSIO,[-lcfitsio]),[
    echo
    echo "configure: cfitsio library not found"
    echo
    echo "Please check installation of cfitsio and try again."
    echo "Look at http://heasarc.gsfc.nasa.gov/fitsio for more information."
    echo
    echo "If you have cfitsio already instaled, check that a development"
    echo "files (in libcfitsio-dev, cfitsio-devel,.. packages) are"
    echo "available by setting environment variables (./configure --help)."
    echo
    exit 1],
    [-lm])

dnl minpack
dnl AC_CHECK_HEADERS([minpack.h])
AC_CHECK_LIB([minpack],[lmder_],AC_SUBST(LIBMINPACK,[-lminpack]),[
    echo
    echo "configure: minpack library not found"
    echo
    echo "Please check installation of Minpack and try again."
    echo "Minpack is available at http://netlib.org/minpack/."
    echo
    echo "If you have Minpack already instaled, check that a development"
    echo "files (in libminpack-dev, minpack-devel,.. packages) are"
    echo "available by setting environment variables (./configure --help)."
    echo
    exit 1])


dnl Oak Leaf
dnl AC_CHECK_HEADER([oakleaf.mod])
AC_CHECK_LIB([oakleaf],[__robustmean_real64_MOD_rmean_real64],AC_SUBST(LIBOAKLEAF,[-loakleaf]),[
    echo
    echo "configure: Oak Leaf library not found"
    echo
    echo "Please check installation of Oak Leaf and try again."
    echo "OakLeaf is available at https://integral.physics.muni.cz/oakleaf/."
    echo
    echo "If you have Oak Leaf already instaled, check that a development"
    echo "files (in liboakleaf-dev, oakleaf-devel,.. packages) are"
    echo "available by setting environment variables (./configure --help)."
    echo
    exit 1])

dnl The options below enables/disables some parts of Munipack: if all of thems
dnl are disabled, only the core processing routines are made, and wxWidgets are
dnl no more required.

dnl Virtual observatory
AC_ARG_ENABLE([vo],AS_HELP_STRING([--disable-vo],[disable Virtual Observatory support]),disable_vo=yes,disable_vo=no)

dnl Command line interface: `munipack` command.
AC_ARG_ENABLE([cli],AS_HELP_STRING([--disable-cli],[disable Command-line User Interface]),disable_cli=yes,disable_cli=no)

dnl Graphical user interface: `xmunipack` command.
AC_ARG_ENABLE([gui],AS_HELP_STRING([--disable-gui],[disable Graphic User Interface]),disable_gui=yes,disable_gui=no)

if test "x$disable_cli" = "xno" -o "x$disable_vo" = "xno" -o "x$disable_gui" = "xno"; then

  dnl wxWidgets
  AM_OPTIONS_WXCONFIG
  AM_PATH_WXCONFIG([3.0.0], [wxWin=1])

  if test -z "$wxWin"; then

    AC_MSG_WARN([

      wxWidgets toolkit not found!

      Continuing without wxWidgets.
      These parts may be unavailable (even required on command-line):

        * Both graphical and command-line interfaces
        * Some functionality related to Virtual observatory

      Otherwise:

        Install wxWidgets on your system

        Please check: wx-config is available in PATH, a directory
        where wxWidgets libraries are installed (returned by
        'wx-config --libs' command) is in LD_LIBRARY_PATH or
        equivalent variable and appropriate wxWidgets version
        is available.
    ])

  fi
fi


AC_ARG_VAR([GUI_CXXFLAGS],[C++ wxWidgets flags for GUI (wx-config --cxxflags)])
AC_ARG_VAR([GUI_LIBS],[C++ wxWidgets libraries for GUI (wx-config --libs core,base,net,xml,adv,qa,html)])
AC_ARG_VAR([CLI_CXXFLAGS],[C++ wxWidgets flags for CLI (wx-config --cxxflags base)])
AC_ARG_VAR([CLI_LIBS],[C++ wxWidgets libraries for CLI (wx-config --libs base)])
AC_ARG_VAR([VO_CXXFLAGS],[C++ wxWidgets flags for VO (wx-config --cxxflags base,net,xml)])
AC_ARG_VAR([VO_LIBS],[C++ wxWidgets libraries for VO (wx-config --libs base,net,xml)])

wxVO="no"
wxGUI="no"
wxCLI="no"

if test "$wxWin" = 1; then

  if test "x$disable_gui" = "xno"; then
     wxGUI="yes"
     AC_SUBST(XMUNIPACKDIR,[xmunipack])
     AC_SUBST(MATPLOTDIR,[wxMathPlot])
     PKG_CHECK_MODULES([PLplot],[plplot])
     AC_SUBST(WX_CXXFLAGS_GUI,
              [${GUI_CXXFLAGS:-`wx-config --cxxflags`}])
     AC_SUBST(WX_LIBS_GUI,
                  [${GUI_LIBS:-`wx-config --libs core,base,net,xml,adv,qa,html`}])
  fi

  if test "x$disable_cli" = "xno"; then
     wxCLI="yes"
     AC_SUBST(MUNIPACKDIR,[munipack])
     AC_SUBST(WX_CXXFLAGS_CLI,[${CLI_CXXFLAGS:-`wx-config --cxxflags base`}])
     AC_SUBST(WX_LIBS_CLI,        [${CLI_LIBS:-`wx-config --libs base`}])
  fi

  if test "x$disable_vo" = "xno"; then
     wxVO="yes"
     AC_SUBST(VODIR,[vo])
     AC_SUBST(WX_CXXFLAGS_VO,
                     [${VO_CXXFLAGS:-`wx-config --cxxflags base,net,xml`}])
     AC_SUBST(WX_LIBS_VO,[${VO_LIBS:-`wx-config --libs base,net,xml`}])
  fi
fi

dnl clean precompiled modules of fortran
AC_SUBST(MOSTLYCLEANFILES,[*.${FC_MODEXT}])

AC_CONFIG_HEADERS([config.h])

AC_CONFIG_FILES([lib/Makefile preprocess/Makefile astrometry/Makefile
   photometry/Makefile kombine/Makefile artificial/Makefile
   list/Makefile colouring/Makefile fits/Makefile vo/Makefile
   munipack/Makefile wxMathPlot/Makefile xmunipack/Makefile
   doc/Makefile test/Makefile Makefile])

AC_OUTPUT

echo
echo " Configured Munipack:"
echo
echo "                      Virtual Observatory support enabled: ${wxVO}"
echo "                           Command line interface enabled: ${wxCLI}"
echo "                         Graphical User Interface enabled: ${wxGUI}"
echo