summaryrefslogtreecommitdiff
path: root/configure.in
blob: 663ed76f7b8279e599777a48f82645d6bc085709 (plain)
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
308
309
310
311
312
dnl Process this file with autoconf to produce a configure script.

# get rid of that stupid cache mechanism
rm -f config.cache

AC_INIT(configure.in)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
AM_INIT_AUTOMAKE(enlightenment, 0.16.999.018)
AM_CONFIG_HEADER(config.h)

AC_C_BIGENDIAN
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
AC_C___ATTRIBUTE__

AC_CHECK_FUNCS(setenv)
AC_CHECK_FUNCS(unsetenv)

AC_CHECK_HEADERS(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))

AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
if test "x$res" = "xno"; then
        AC_CHECK_LIB(fnmatch, fnmatch, res=yes, res=no)
	if test "x$res" = "xno"; then
		AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch])
        else
	        fnmatch_libs="-lfnmatch"
	fi
fi
				
AC_SUBST(fnmatch_libs)

# Setting have_valgrind to "no" seems pointless, but we just need to
# put something in as the 4th parameter, so configure doesn't abort
# when valgrind.pc isn't found.
have_valgrind="no"
PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0, have_valgrind=yes, have_valgrind=no)
AC_ARG_ENABLE(valgrind,
  [  --enable-valgrind               enable valgrind support], [
      if [ test "$enableval" = "yes" ]; then
        AC_MSG_RESULT(yes)
        have_valgrind="yes"
      else
        AC_MSG_RESULT(no)
		have_valgrind="no"
        VALGRIND_CFLAGS=""
        VALGRIND_LIBS=""
      fi
  ], [
    have_valgrind=$have_valgrind
  ]
)

if test x$have_valgrind = "xyes"; then
  AC_DEFINE(HAVE_VALGRIND, 1, [Valgrind support])
fi

MODULE_ARCH="$host_os-$host_cpu"
AC_SUBST(MODULE_ARCH)
AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")

if test "x${bindir}" = 'x${exec_prefix}/bin'; then
  if test "x${exec_prefix}" = "xNONE"; then
    if test "x${prefix}" = "xNONE"; then
      bindir="${ac_default_prefix}/bin";
    else
      bindir="${prefix}/bin";
    fi
  else
    if test "x${prefix}" = "xNONE"; then
      bindir="${ac_default_prefix}/bin";
    else
      bindir="${prefix}/bin";
    fi
  fi
fi

if test "x${libdir}" = 'x${exec_prefix}/lib'; then
  if test "x${exec_prefix}" = "xNONE"; then
    if test "x${prefix}" = "xNONE"; then
      libdir="${ac_default_prefix}/lib";
    else
      libdir="${prefix}/lib";
    fi
  else
    if test "x${prefix}" = "xNONE"; then
      libdir="${ac_default_prefix}/lib";
    else
      libdir="${prefix}/lib";
    fi
  fi
fi

dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", "Package installed binaries destination")
  else
    AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", "Package installed binaries destination")
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", "Package installed binaries destination")
fi

dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", "Package installed libraries destination")
  else
    AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", "Package installed libraries destination")
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", "Package installed libraries destination")
fi

dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", "Package installed data destination")
    AC_DEFINE_UNQUOTED(LOCALE_DIR, "${ac_default_prefix}/share/locale", "Locale directory")
  else
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", "Package installed data destination")
    AC_DEFINE_UNQUOTED(LOCALE_DIR, "${prefix}/share/locale", "Locale directory")
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", "Package installed data destination")
  AC_DEFINE_UNQUOTED(LOCALE_DIR, "${datadir}/locale", "Locale directory")
fi

x_dir=""
x_cflags=""
x_libs=""
AC_PATH_XTRA
AC_CHECK_HEADER(X11/X.h,
  [
    x_dir=${x_dir:-/usr/X11R6}
    x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
    x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
  ],[
    AC_MSG_ERROR([Cannot find X headers and libraries.])
  ]
)
AC_SUBST(x_cflags)
AC_SUBST(x_libs)

cf_cflags=""
cf_libs=""
PCPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I /System/Library/Frameworks/CoreFoundation.framework/Headers"
AC_CHECK_HEADERS(CFBase.h,
  [
    cf_cflags="-I /System/Library/Frameworks/CoreFoundation.framework/Headers"
    cf_cflags="${cf_cflags} -I /System/Library/Frameworks/IOKit.framework/Headers"
    cf_libs="-framework 'CoreFoundation' -framework 'IOKit'"
  ],[
    AC_MSG_WARN([Cannot find CoreFoundation headers and libraries.])
  ]
)
CPPFLAGS="${PCPPFLAGS}"
AC_SUBST(cf_cflags)
AC_SUBST(cf_libs)

ALL_LINGUAS="bg de es fi fr ja pl pt ru zh_CN hu sl it cs da sk sv"
AC_SUBST(ALL_LINGUAS)

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.12.1)
if test "x$LIBINTL" = "x"; then
  LIBINTL="$INTLLIBS"
fi

AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
AC_SUBST(dlopen_libs)

AC_ARG_WITH(evas-config,
[  --with-evas-config=EVAS_CONFIG    use evas-config specified ],
[
  EVAS_CONFIG=$withval;
  echo "using "$EVAS_CONFIG" for evas-config";
],[
  PROG="evas-config";
  AC_PATH_PROG(EVAS_CONFIG, $PROG, "", $PATH)
])
evas_cflags=`$EVAS_CONFIG --cflags`
evas_libs=`$EVAS_CONFIG --libs`
AC_SUBST(evas_cflags)
AC_SUBST(evas_libs)

AC_ARG_WITH(ecore-config,
[  --with-ecore-config=ECORE_CONFIG  use ecore-config specified ],
[
  ECORE_CONFIG=$withval;
  echo "using "$ECORE_CONFIG" for ecore-config";
],[
  PROG="ecore-config";
  AC_PATH_PROG(ECORE_CONFIG, $PROG, "", $PATH)
])
ecore_cflags=`$ECORE_CONFIG --cflags`
ecore_libs=`$ECORE_CONFIG --libs`
AC_SUBST(ecore_cflags)
AC_SUBST(ecore_libs)

AC_ARG_WITH(edje-config,
[  --with-edje-config=EDJE_CONFIG    use edje-config specified ],
[
  EDJE_CONFIG=$withval;
  echo "using "$EDJE_CONFIG" for edje-config";
],[
  PROG="edje-config";
  AC_PATH_PROG(EDJE_CONFIG, $PROG, "", $PATH)
])
edje_cflags=`$EDJE_CONFIG --cflags`
edje_libs=`$EDJE_CONFIG --libs`

AC_ARG_WITH(eet-config,
[  --with-eet-config=EET_CONFIG      use eet-config specified ],
[
  EET_CONFIG=$withval;
  echo "using "$EET_CONFIG" for eet-config";
],[
  PROG="eet-config";
  AC_PATH_PROG(EET_CONFIG, $PROG, "", $PATH)
])
eet_cflags=`$EET_CONFIG --cflags`
eet_libs=`$EET_CONFIG --libs`

AC_ARG_WITH(embryo-config,
[  --with-embryo-config=EMBRYO_CONFIG use embryo-config specified ],
[
  EMBRYO_CONFIG=$withval;
  echo "using "$EMBRYO_CONFIG" for embryo-config";
],[
  PROG="embryo-config";
  AC_PATH_PROG(EMBRYO_CONFIG, $PROG, "", $PATH)
])
embryo_cflags=`$EMBRYO_CONFIG --cflags`
embryo_libs=`$EMBRYO_CONFIG --libs`

e_libs=$evas_libs" "$ecore_libs" "$edje_libs" "$eet_libs" "$embryo_libs" "$LIBINTL" "$fnmatch_libs" "
e_cflags="-DUSE_E_CONFIG_H "$evas_cflags" "$ecore_cflags" "$edje_cflags" "$eet_cflags" "$embryo_cflags" "
AC_SUBST(e_libs)
AC_SUBST(e_cflags)

profile="FAST_PC"
AC_ARG_WITH(profile,
[  --with-profile=TARGET_PROFILE    specify a target format profile of:
                                    LOWRES_PDA, MEDIUMRES_PDA, HIRES_PDA, 
				    SLOW_PC, MEDIUM_PC, FAST_PC ],
[
  v=$withval;
  profile=$v
  echo "  Enlightenment build profile set to "$profile;
],[
  profile="FAST_PC"
])
EDJE_DEF="-DLOWRES_PDA=1 -DMEDIUMRES_PDA=2 -DHIRES_PDA=3 -DSLOW_PC=4 -DMEDIUM_PC=5 -DFAST_PC=6"
EDJE_DEF=$EDJE_DEF" -DE17_PROFILE"=$profile
AC_SUBST(EDJE_DEF)

edje_cc="`$EDJE_CONFIG --prefix`/bin/edje_cc"
AC_ARG_WITH(edje-cc,
[  --with-edje-cc=PATH              specify a specific path to edje_cc],
[
  v=$withval;
  edje_cc=$v
  echo "  Enlightenment edje_cc explicitly set to "$edje_cc;
],[
  edje_cc="`$EDJE_CONFIG --prefix`/bin/edje_cc"
])
AC_SUBST(edje_cc)

AC_OUTPUT([
Makefile
src/Makefile
src/lib/Makefile
src/bin/Makefile
src/modules/Makefile
src/modules/test/Makefile
src/modules/ibar/Makefile
src/modules/dropshadow/Makefile
src/modules/clock/Makefile
src/modules/pager/Makefile
src/modules/battery/Makefile
src/modules/temperature/Makefile
src/modules/cpufreq/Makefile
src/modules/ibox/Makefile
src/modules/start/Makefile
src/modules/randr/Makefile
src/preload/Makefile
data/Makefile
data/fonts/Makefile
data/images/Makefile
data/init/Makefile
data/init/images/Makefile
data/themes/Makefile
data/themes/images/Makefile
data/other/Makefile
data/xsession/Makefile
data/xsession/enlightenment.desktop
doc/Makefile
po/Makefile
intl/Makefile
enlightenment-config
],[
chmod +x enlightenment-config
])