-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
187 lines (153 loc) · 5.49 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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.69)
dnl Name your plug-in here
m4_define([plugin_name], [refocus-it])
dnl These two define the plug-in version number
m4_define([plugin_major_version], [2])
m4_define([plugin_minor_version], [1])
m4_define([plugin_version], [plugin_major_version.plugin_minor_version])
m4_define([plugin_package_name], [gimp3-refocus-it])
m4_define([plugin_package_home], [https://github.com/JoesCat/gimp3-refocus-it])
m4_define([plugin_package_email], [https://github.com/JoesCat/gimp3-refocus-it/issues])
AC_INIT([plugin_name], [plugin_version], [plugin_package_email],
[plugin_package_name], [plugin_package_home])
AC_DEFINE(PLUGIN_NAME, ["plugin_name"], [Plug-In name])
AC_DEFINE(PLUGIN_EMAIL, [plugin_package_email], [Plug-In package email])
AC_DEFINE(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_CONFIG_SRCDIR([src/image.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([foreign -Wall])
#--------------------------------------------------------------------------
# automake 1.12 needs AM_PROG_AR but automake < 1.11.2 doesn't recognize it
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
AC_SUBST([LIBTOOL_DEPS])
#--------------------------------------------------------------------------
# Checks for programs.
AC_PROG_CC
AC_PROG_SED
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PATH_PROG([CHMOD],[chmod],[:])
AC_PATH_PROG([STRIP],[strip],[:])
AC_PATH_PROG([GIMP],[gimp-2.10],[:])
AC_PATH_PROG([GIMPTOOL],[gimptool-2.0],[:])
AC_PATH_PROG([MD5SUM],[md5sum],[:])
AC_PATH_PROG([MSGFMT],[msgfmt],[:])
AC_PATH_PROG([MSGINIT],[msginit],[:])
AC_PATH_PROG([MSGMERGE],[msgmerge],[:])
AC_PATH_PROG([XGETTEXT],[xgettext],[:])
AM_CONFIG_HEADER(refocus-it-config.h)
AC_PROG_INSTALL
AC_PROG_MAKE_SET
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
AM_MAINTAINER_MODE
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
#--------------------------------------------------------------------------
AC_SEARCH_LIBS([strerror],[cposix])
# Search for math.h include and math lib (some OSes have -lm built-in).
have_libm=maybe
AC_CHECK_HEADERS([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
dnl DEBUG
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug],[Enable debugging @<:@default=no@:>]), , enable_debug=no)
if test x$enable_debug = xno ; then
AC_DEFINE(NDEBUG,, Enable debugging)
fi
dnl i18n stuff
LOCALEDIR='${datadir}/locale'
AC_SUBST(LOCALEDIR)
# Avoid being locked to a particular gettext verion, use what's available.
have_gettext=no
AC_CHECK_HEADERS([intl.h],[have_gettext=yes])
AC_CHECK_FUNC([gettext],[have_gettext=yes],[have_gettext=no])
AC_CHECK_HEADERS([locale.h],,[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
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 locale, textdomain related Packages.])])
fi
GETTEXT_PACKAGE=gimp20-refocus-it
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
SNIPPET2='
gimplocaledir = $(localedir)
ifeq ($(shell id -u),0)
gimplocaledir = $(LOCALEDIR)
endif
'
AC_SUBST([SNIPPET2])
AM_SUBST_NOTMAKE([SNIPPET2])
AC_CHECK_HEADERS([stdlib.h string.h strings.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(sqrt)
dnl Gimp-plugin
PKG_CHECK_MODULES(GIMP, gimp-2.0 gimpui-2.0)
AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS)
GIMP_LIBDIR=`$PKG_CONFIG --variable=gimplibdir gimp-2.0`
AC_SUBST(GIMP_LIBDIR)
DATADIR='${datadir}/${PLUGIN_NAME}'
AC_SUBST(DATADIR)
AC_MSG_CHECKING([if GTK+ is version 2.3.0 or newer])
if $PKG_CONFIG --atleast-version=2.3.0 gtk+-2.0; then
have_gtk_2_3=yes
else
have_gtk_2_3=no
fi
AC_MSG_RESULT($have_gtk_2_3)
if test "x$have_gtk_2_3" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
fi
#--------------------------------------------------------------------------
# Pass variables to MAKEFILE.AM
AC_SUBST([PLUGIN_MAJOR_VERSION],[plugin_major_version])
AC_SUBST([PLUGIN_MINOR_VERSION],[plugin_minor_version])
AC_SUBST([PLUGIN_VERSION],[plugin_version])
AC_SUBST([PLUGIN_PACKAGE_NAME],[plugin_package_email])
AC_SUBST([PLUGIN_EMAIL],[plugin_package_email])
AC_SUBST([HOST],["$host"])
# Put ifndef wrapper on refocus-it-config.h so we don't call it repeatedly.
AH_TOP([#ifndef REFOCUS_IT_CONFIG_H
#define REFOCUS_IT_CONFIG_H 1])
AH_BOTTOM([
#endif])
#--------------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile
po/Makefile
src/Makefile
gimp-plugin/Makefile
])
AC_OUTPUT