forked from gimp-plugins-justice/gimp-plugin-astronomy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
203 lines (176 loc) · 5.89 KB
/
configure.ac
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
# -*- Autoconf -*-
dnl Process this file with autoconf -f to produce a configure script.
AC_PREREQ([2.70])
dnl Name your plug-in here
m4_define([plugin_name], [gimp-plugin-astronomy])
dnl These two define the plug-in version number
m4_define([plugin_major_version], [0])
m4_define([plugin_minor_version], [11])
m4_define([plugin_version], [plugin_major_version.plugin_minor_version])
m4_define([plugin_package_name], [gimp-plugin-astronomy])
m4_define([plugin_package_home], [https://github.com/JoesCat/gimp-plugin-astronomy])
m4_define([plugin_package_email], [https://github.com/JoesCat/gimp-plugin-astronomy/issues/])
AC_INIT([plugin_name],[plugin_version],[plugin_package_email],
[plugin_package_name],[plugin_package_home])
AC_CONFIG_SRCDIR([src/alignment.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_USE_SYSTEM_EXTENSIONS
AM_MAINTAINER_MODE([enable])
AM_INIT_AUTOMAKE([foreign -Wall])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_SED
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PATH_PROG([STRIP],[strip],[:])
AC_PATH_PROG([GIMPTOOL],[gimptool-2.0],[:])
AC_PATH_PROG([MSGFMT],[msgfmt],[:])
AC_PATH_PROG([MSGINIT],[msginit],[:])
AC_PATH_PROG([MSGMERGE],[msgmerge],[:])
AC_PATH_PROG([XGETTEXT],[xgettext],[:])
AC_CONFIG_HEADERS([src/config.h],[:])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
msos=
case "$host" in
*cygwin* | *mingw*)
msos=yes
esac
# Check for math.h include and math library (some OSes have -lm built-in).
have_libm=maybe
AC_CHECK_HEADER([math.h],
AC_SEARCH_LIBS([cos],[m],[have_libm=yes]))
if test x"${have_libm}" != xyes; then
AC_MSG_FAILURE([ERROR: Please install the Math library and math.h],[1])
fi
# Avoid being locked to a particular verion of gettext, use what's available now.
have_gettext=no
AC_CHECK_HEADERS([intl.h],[have_gettext=yes])
AC_CHECK_FUNC([gettext],[have_gettext=yes],[have_gettext=no])
AC_CHECK_FUNC([bind_textdomain_codeset],,[have_gettext=no])
AC_CHECK_FUNC([textdomain],,[have_gettext=no])
if test x"${have_gettext}" = xno; then
AC_SEARCH_LIBS([intl],[have_gettext=yes],[
AC_MSG_ERROR([ERROR: gettext() required! Please install libintl or GETTEXT Packages.])])
fi
GETTEXT_PACKAGE=gimp20-plugin-astronomy
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext translation domain.])
if test x"${have_gettext}" = xyes; then
AC_DEFINE([HAVE_GETTEXT],1,[Enable use of local languages])
fi
# Check for package gsl, else gsl_version.h include file and gsl library. GPL
GSL_LIBS=
have_libgsl=maybe
PKG_CHECK_MODULES([GSL],[gsl],[have_libgsl=yes],[have_libgsl=no])
if test x"${have_libgsl}" != xyes; then
AC_CHECK_HEADER([gsl/gsl_version.h],
AC_SEARCH_LIBS([gsl_version],[gsl],
AC_SEARCH_LIBS([cblas_sdsdot],[gslcblas],[have_libgsl=yes])))
fi
if test x"${have_libgsl}" != xyes; then
AC_MSG_FAILURE([ERROR: Please install the developer version of gsl library.],[1])
fi
AC_SUBST(GSL_LIBS)
# Check for package fftw, else fftw3.h include file and fftw3 library. GPL
FFTW_LIBS=
have_libfftw=maybe
PKG_CHECK_MODULES([FFTW],[fftw3 >= 3.0],[have_libfftw=yes])
if test x"${have_libfftw}" != xyes; then
AC_CHECK_HEADER([fftw3.h],
AC_SEARCH_LIBS([fftw_plan_dft_r2c_2d],[fftw3],[have_libfftw=yes]))
fi
if test x"${have_libfftw}" != xyes; then
AC_MSG_FAILURE([ERROR: Please install the developer version of fftw3 library.],[1])
fi
AC_SUBST(FFTW_LIBS)
# Check for libgimp/gimp.h include file and libgimp library. LGPL
GIMP_CFLAGS=
GIMP_LIBS=
have_libgimp=no
PKG_CHECK_MODULES([GIMP],[gimp-2.0 >= 2.4.0 gimpui-2.0 >= 2.4.0],[have_libgimp=yes])
if test x"${have_libgimp}" != xyes; then
AC_MSG_FAILURE([ERROR: Please install the developer version of libgimp.],[1])
fi
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)
GIMP_LIBDIR=`${PKG_CONFIG} --variable=gimplibdir gimp-2.0`
AC_SUBST(GIMP_LIBDIR)
GIMP_DATADIR=`${PKG_CONFIG} --variable=gimpdatadir gimp-2.0`
AC_SUBST(GIMP_DATADIR)
AC_CHECK_FUNCS(bind_textdomain_codeset)
dnl need to hardcode locale
LOCALEDIR='/usr/share/locale'
AC_SUBST(LOCALEDIR)
DATADIR='${datadir}/${plugin_name}'
AC_SUBST(DATADIR)
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
AC_SUBST([ACLOCAL],["${ACLOCAL}"])
AM_CONDITIONAL([HAVEGIMPTOOL],[test "${GIMPTOOL}"x != x])
AM_CONDITIONAL([HAVEMSOS],[test x"${msos}" == xyes])
CPPFLAGS="${CPPFLAGS} AS_ESCAPE([-I${top_builddir}]) AS_ESCAPE([-I${top_srcdir}])"
AC_SUBST([CPPFLAGS],["${CPPFLAGS}"])
AC_DEFINE(PLUGIN_PACKAGE_NAME, ["plugin_package_name"], [Plug-In package name])
AC_DEFINE(PLUGIN_VERSION, ["plugin_version"], [Plug-In version])
AC_DEFINE(PLUGIN_MAJOR_VERSION, ["plugin_major_version"], [Plug-In major version])
AC_DEFINE(PLUGIN_MINOR_VERSION, ["plugin_minor_version"], [Plug-In minor version])
AC_SUBST([PLUGIN_NAME],[plugin_name])
AC_SUBST([PLUGIN_PACKAGE_NAME],[plugin_package_name])
AC_SUBST([PLUGIN_VERSION],[plugin_version])
AC_SUBST([PLUGIN_EMAIL],[plugin_package_email])
dnl Do this here since automake can't process 'if/else/endif in Makefile.am
SNIPPET1='
ifeq ($(shell id -u),0)
bindir = $(GIMP_LIBDIR)/plug-ins
else
bindir = $(libdir)/gimp/2.0/plug-ins
endif
'
AC_SUBST([SNIPPET1])
AM_SUBST_NOTMAKE([SNIPPET1])
SNIPPET2='
ifeq ($(shell id -u),0)
scmdir = $(GIMP_DATADIR)/scripts
else
scmdir = $(datadir)/gimp/2.0/scripts
endif
'
AC_SUBST([SNIPPET2])
AM_SUBST_NOTMAKE([SNIPPET2])
SNIPPET3='
gimplocaledir = $(localedir)
ifeq ($(shell id -u),0)
gimplocaledir = $(LOCALEDIR)
endif
'
AC_SUBST([SNIPPET3])
AM_SUBST_NOTMAKE([SNIPPET3])
AC_CONFIG_FILES([
Makefile
doc/Makefile
scripts/Makefile
src/Makefile
po/Makefile
rpm/gimp-plugin-astronomy.spec
])
AC_OUTPUT
AC_MSG_NOTICE([
Configuration:
Source code location ${srcdir}
Build code location ${builddir}
bin plug-in dir ${GIMP_LIBDIR}/plug-ins
scripts plug-in dir ${GIMP_DATADIR}/scripts
gimp locale dir ${LOCALEDIR}
Compiler ${CC}
CPPFLAGS ${CPPFLAGS}
GSL_LIBS ${GSL_LIBS}
FFTW_LIBS ${FFTW_LIBS}
GIMP_CFLAGS ${GIMP_CFLAGS}
GIMP_LIBS ${GIMP_LIBS}
CFLAGS ${CFLAGS}
LIBS ${LIBS}
])