summaryrefslogtreecommitdiff
path: root/legacy/ethumb/configure.ac
blob: 6dc7ce2e910f8a1893054bd0f8c26a7554273637 (plain) (blame)
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
AC_INIT([ethumb], [0.1.0], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX

AM_INIT_AUTOMAKE([1.6 dist-bzip2])
AM_CONFIG_HEADER([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
_XTERM_COLORS

AC_PROG_CC
AM_PROG_CC_STDC
AM_PROG_CC_C_O
AC_HEADER_STDC
AC_C___ATTRIBUTE__
dnl AC_C_CONST is bogus, its tests fails on -Wall -O1 ( uninitialized values)
dnl AC_C_CONST

AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
AC_PROG_LIBTOOL

VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
version_info=`expr $VMAJ + $VMIN`
AC_SUBST(version_info)
AC_SUBST(VMAJ)

#themesdir="${datadir}/ethumb/data/frames"
#AC_SUBST(themesdir)
#AS_AC_EXPAND(THEMESDIR, $themesdir)
#AC_DEFINE_UNQUOTED(THEMESDIR, ["$THEMESDIR"], [Where frame theme files are installed.]
#)

#AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
#AC_DEFINE_UNQUOTED(SYSCONFDIR, ["$SYSCONFDIR"], [Where system configuration is stored])

EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])

with_max_log_level="<unset>"
AC_ARG_WITH(internal-maximum-log-level,
   [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
                   [limit eina internal log level to the given number, any call to EINA_LOG() with values greater than this will be compiled out, ignoring runtime settings, but saving function calls.])],
   [
    if test "x${withval}" != "xno"; then
       if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
          AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
          AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
          with_max_log_level="${withval}"
       else
          AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
       fi
    fi
    ], [:])

EFL_ETHUMB_BUILD=""
EFL_ETHUMB_CLIENT_BUILD=""
lt_enable_auto_import=""
case "$host_os" in
   mingw* | cegcc*)
      EFL_ETHUMB_BUILD="-DEFL_ETHUMB_BUILD"
      EFL_ETHUMB_CLIENT_BUILD="-DEFL_ETHUMB_CLIENT_BUILD"
      lt_enable_auto_import="-Wl,--enable-auto-import"
   ;;
esac
AC_SUBST(EFL_ETHUMB_BUILD)
AC_SUBST(EFL_ETHUMB_CLIENT_BUILD)
AC_SUBST(lt_enable_auto_import)

PKG_CHECK_MODULES(EINA, [eina-0])
PKG_CHECK_MODULES(EVAS, [evas])
PKG_CHECK_MODULES(ECORE, [ecore])
PKG_CHECK_MODULES(ECORE_EVAS, [ecore-evas])
PKG_CHECK_MODULES(ECORE_FILE, [ecore-file])
PKG_CHECK_MODULES(EDJE, [edje])

requirement_ethumb="eina-0 evas ecore ecore-evas ecore-file edje"
requirement_ethumb_client="ethumb edbus"

AM_CONDITIONAL(HAVE_EMOTION, false)
define([CHECK_MODULE_EMOTION],
[
        AC_ETH_CHECK_PKG(EMOTION, emotion, [], [EMOTION=false])
])

AC_ETH_OPTIONAL_MODULE([emotion], true, [CHECK_MODULE_EMOTION])

if $USE_MODULE_EMOTION ; then
        requirement_ethumb="$requirement_ethumb emotion"
fi

AM_CONDITIONAL(HAVE_EPDF, false)
define([CHECK_MODULE_EPDF],
[
        AC_ETH_CHECK_PKG(EPDF, epdf, [], [EPDF=false])
])

AC_ETH_OPTIONAL_MODULE([epdf], true, [CHECK_MODULE_EPDF])
if $USE_MODULE_EPDF ; then
        requirement_ethumb="$requirement_ethumb epdf"
fi

AM_CONDITIONAL(HAVE_EDBUS, false)
define([CHECK_MODULE_ETHUMBD],
[
        AC_ETH_CHECK_PKG(EDBUS, edbus, [], [ETHUMBD=false])
])

AC_ETH_OPTIONAL_MODULE([ethumbd], true, [CHECK_MODULE_ETHUMBD])
if $USE_MODULE_ETHUMBD ; then
        dbusservicedir=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
        AC_ARG_WITH([dbus-services],
                    AC_HELP_STRING([--with-dbus-services=DBUS_SERVICES], [specify a directory to store dbus service files.]),
                    [
                      dbusservicedir=$withval
                    ]
                   )
fi

AC_SUBST(requirement_ethumb)
AC_SUBST(requirement_ethumb_client)
AC_SUBST(dbusservicedir)

AC_OUTPUT([
ethumb.pc
ethumb_client.pc
org.enlightenment.Ethumb.service
Makefile
src/Makefile
src/bin/Makefile
src/lib/Makefile
src/lib/client/Makefile
src/plugins/Makefile
src/plugins/emotion/Makefile
src/plugins/epdf/Makefile
src/tests/Makefile
data/Makefile
data/frames/Makefile
m4/Makefile
doc/Makefile
])

txt_strip() {
        echo "[$]@" | sed -e 's/^[[ \t]]*\([[^ \t]]*\)[[ \t]]*$/\1/g'
}

MODS=""
for mod in $OPTIONAL_MODULES; do
        MODS="$MODS ${COLOR_HGREEN}+$mod${COLOR_END}"
done
MODS=$(txt_strip $MODS)

UNUSED_MODS=""
for mod in $UNUSED_OPTIONAL_MODULES; do
        UNUSED_MODS="$UNUSED_MODS ${COLOR_HRED}-$mod${COLOR_END}"
done
UNUSED_MODS=$(txt_strip $UNUSED_MODS)

cat <<SUMMARY_EOF

Summary:
 * project..........: $PACKAGE $VERSION
 * prefix...........: $(txt_strip $prefix)
 * DBus services dir: $(txt_strip $dbusservicedir)
 * CFLAGS...........: $(txt_strip $CFLAGS)
 * LDFLAGS..........: $(txt_strip $LDFLAGS)

Configuration Options Summary:

 * maximum log level: ${with_max_log_level}
 * documentation....: ${build_doc}

SUMMARY_EOF

if test "x$MODS" != "x"; then
   echo -e " * enabled modules..: $MODS"
fi

if test "x$UNUSED_MODS" != "x"; then
   echo -e " * disabled modules.: $UNUSED_MODS"
fi

cat << HINT_EOF

now type:

Now type 'make' ('gmake' on some systems) to compile $PACKAGE, and
then afterwards as root (or the user who will install this), type
'make install'. Change users with 'su' or 'sudo' appropriately.

HINT_EOF