summaryrefslogtreecommitdiff
path: root/legacy/edje/configure.in
blob: 7d9a29a630eba2476985941716fa206c22962212 (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
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(edje, 0.5.0.015)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
AC_FUNC_ALLOCA

AC_CHECK_FUNCS(realpath)

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)

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_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}", [Shared data directory])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", [Shared data directory])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", [Shared data directory])
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", [Installation directory for user executables])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", [Installation directory for user executables])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", [Installation directory for user executables])
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", [Installation directory for libraries])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", [Installation directory for libraries])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", [Installation directory for libraries])
fi

AC_MSG_CHECKING(whether to build edje_cc)
have_edje_cc="yes"
AC_ARG_ENABLE(edje-cc, [  --disable-edje-cc       disable building of edje_cc ], [
     if [ test "$enableval" = "yes" ]; then
       AC_MSG_RESULT(yes)
       have_edje_cc="yes"
     else
       AC_MSG_RESULT(no)
       have_edje_cc="no"
     fi
   ], [
      AC_MSG_RESULT($have_edje_cc)
   ]
)

AC_PATH_GENERIC(evas, 0.9.9,
  [ ],
  [ AC_MSG_ERROR(Evas isn't installed) ],
)

AC_PATH_GENERIC(ecore, 0.9.9,
  [ ],
  [ AC_MSG_ERROR(Ecore isn't installed) ],
)

CP=$CFLAGS
CFLAGS=$ECORE_CFLAGS
AC_CHECK_HEADER(Ecore_X.h, AC_DEFINE(HAVE_ECORE_X, 1, [Ecore_X.h exists]))
AC_CHECK_HEADER(Ecore_Fb.h, AC_DEFINE(HAVE_ECORE_FB, 1, [Ecore_Fb.h exists]))
CFLAGS=$CP

AC_PATH_GENERIC(eet, 0.9.10,
  [ ],
  [ AC_MSG_ERROR(Eet isn't installed) ],
)

AC_PATH_GENERIC(embryo, 0.9.1,
  [ ],
  [ AC_MSG_ERROR(Embryo isn't installed) ],
)
EMBRYO_PREFIX=`$EMBRYO_CONFIG --prefix`
AC_DEFINE_UNQUOTED(EMBRYO_PREFIX, "${EMBRYO_PREFIX}", [Embryo prefix])

if test "x$have_edje_cc" = "xyes"; then
  AC_PATH_GENERIC(imlib2, 1.0.0,
    [ have_imlib2="yes"],
    [ have_imlib2="no" ],
  )
  AC_DEFINE(HAVE_IMLIB, 1, [Imlib2 is installed])
fi

AC_MSG_CHECKING([for location of Vim data files])
install_vim="yes";
AC_ARG_WITH(vim,
    [  --with-vim=DIR          Location of Vim data files [[autodetect]]],
    [if test -d "${withval}"; then
       vimdir="${withval}"
    fi])

if test "x${vimdir}" = "x" ; then
   if test -d "${prefix}/share/vim"; then
      vimdir="${prefix}/share/vim"
   elif test -d "/usr/share/vim"; then
      vimdir="/usr/share/vim"
   elif test -d "/usr/local/share/vim"; then
      vimdir="/usr/local/share/vim"
   elif test -d "/opt/share/vim"; then
      vimdir="/opt/share/vim"
   else
      install_vim="no"
   fi
fi

if test "${install_vim}" = "yes"; then
   AC_MSG_RESULT([$vimdir])
else
   AC_MSG_RESULT([Not found, EDC syntax file will not be installed])
fi

AC_SUBST(vimdir)

EDJE_CC_PRG=""
EDJE_DECC_PRG=""
EDJE_RECC_PRG=""
EDJE_THUMB_PRG=""
if test "x$have_edje_cc" = "xyes"; then
  AM_CONDITIONAL(BUILD_EDJE_CC, true)
  AM_CONDITIONAL(BUILD_EDJE_DECC, true)
  AM_CONDITIONAL(BUILD_EDJE_THUMB, true)
  EDJE_CC_PRG="edje_cc"
  EDJE_DECC_PRG="edje_decc"
  EDJE_RECC_PRG="edje_recc"
  EDJE_THUMB_PRG="edje_thumb"
else
  AM_CONDITIONAL(BUILD_EDJE_CC, false)
  AM_CONDITIONAL(BUILD_EDJE_DECC, false)
  AM_CONDITIONAL(BUILD_EDJE_THUMB, false)
fi
AC_SUBST(EDJE_CC_PRG)
AC_SUBST(EDJE_DECC_PRG)
AC_SUBST(EDJE_RECC_PRG)
AC_SUBST(EDJE_THUMB_PRG)

AC_OUTPUT([
edje.pc
Makefile
data/Makefile
data/images/Makefile
data/include/Makefile
data/src/Makefile
data/template/Makefile
data/template/embryo/Makefile
data/template/fonts/Makefile
data/template/hashes/Makefile
data/template/images/Makefile
data/template/macros/Makefile
data/template/parts/Makefile
data/template/programs/Makefile
data/test/Makefile
data/test/fonts/Makefile
data/test/images/Makefile
src/Makefile
src/lib/Makefile
src/bin/Makefile
edje-config
],[
chmod +x edje-config
touch edje_docs.tar.gz
])

if test "x$have_edje_cc" = "xyes"; then
	if test "x$have_imlib2" = "xno"; then
		echo
		echo "WARNING: Building edje_cc without Imlib2 support!"
		echo
	fi
fi