File: configure.in

package info (click to toggle)
gwhere 0.2.3.dfsg.1-3
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 7,388 kB
  • ctags: 3,161
  • sloc: ansic: 38,143; sh: 7,800; perl: 336; makefile: 325; sed: 93
file content (449 lines) | stat: -rw-r--r-- 12,193 bytes parent folder | download | duplicates (2)
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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
dnl Process this file with  autoconf to produce a configure script.
dnl ================================================
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(gwhere, 0.2.3)
AC_DEFINE(PROJECT_NAME, "GWhere")
AM_CONFIG_HEADER(config.h)


dnl It is used for the NSIS file autogeneration
dnl ===========================================
PROJECT_NAME="GWhere"
AC_SUBST(PROJECT_NAME)


AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_GCC_TRADITIONAL
AC_PROG_LN_S
AC_PROG_AWK
AM_PROG_CC_STDC
AC_HEADER_STDC


dnl For future use with libgwcatalog
dnl ================================
dnl AC_PROG_RANLIB
AC_PROG_LIBTOOL
AC_ENABLE_SHARED(yes)

CFLAGS="$CFLAGS -fno-strict-aliasing"

dnl Checks GTK+ version
dnl ===================
AC_ARG_ENABLE(gtk20,
	[  --enable-gtk20          compile for GTK+ 2.0 instead of GTK+ 1.2. [default=auto]],
	USE_GTK=20,
	USE_GTK=auto)

if test "x$USE_GTK" = "x20" ; then
  AM_PATH_GTK_2_0(1.3.0, GTK_VERSION="1.3.0 or 2.0.0",AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?))
  CFLAGS="$CFLAGS -DGTK_ENABLE_BROKEN"
  AC_DEFINE(HAVE_GTK20)
else
  AC_ARG_ENABLE(gtk12,
  	[  --enable-gtk12          compile for GTK+ 1.2. [default=auto]],
  	USE_GTK=12,
  	USE_GTK=auto)

  case $USE_GTK in
    12)
      AM_PATH_GTK(1.2.0, GTK_VERSION="1.2.0",AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?))
      AC_DEFINE(HAVE_GTK12)
    ;;

    auto)
      AM_PATH_GTK(1.2.0, GTK_VERSION="1.2.0",AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?))
      AC_DEFINE(HAVE_GTK12)
  esac
fi


dnl Checks for libraries.
dnl =====================
dnl AC_CHECK_LIB([z], [zlibVersion], CFLAGS="$CFLAGS -lz", AC_MSG_ERROR(Cannot find zlib))
AC_CHECK_LIB([z], [zlibVersion], , AC_MSG_ERROR(Cannot find zlib))


dnl Checks functions
dnl ==============
AC_FUNC_FNMATCH
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(dup2 getmntent getwd hasmntopt memset regcomp strerror strstr mempcpy mkdir getfsent strftime strptime)


dnl Checks headers
dnl =============
AC_CHECK_HEADERS(fcntl.h libintl.h mntent.h sys/ioctl.h sys/mount.h sys/vfs.h stddef.h string.h unistd.h)
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_HEADER_STDC


dnl Checks for typedefs, structures, and compiler characteristics
dnl =============================================================
AC_C_CONST
AC_STRUCT_TM
AC_TYPE_UID_T


dnl Add the languages which your application supports here
dnl ======================================================
ALL_LINGUAS="ar cs cs-windows-1250 de fr el es hu it nl pl pt ru sr"
AM_GNU_GETTEXT


dnl Check for host OS
dnl =================
HOST_OS=""
HOST_OS_FULLNAME=""
case "$host" in
  *-*-windows*)
    HOST_OS="OS_WINDOWS"
    HOST_OS_FULLNAME="MS Windows"
  ;;
  *-*-cygwin*)
    HOST_OS="OS_CYGWIN"
    HOST_OS_FULLNAME="GNU/Cygwin"
  ;;
  *-*-linux*)
    HOST_OS="OS_LINUX"
    HOST_OS_FULLNAME="GNU/Linux"
  ;;
  *-*-freebsd*)
    HOST_OS="OS_FREEBSD"
    HOST_OS_FULLNAME="FreeBSD"
  ;;
  *-*-openbsd*)
    HOST_OS="OS_OPENBSD"
    HOST_OS_FULLNAME="OpenBSD"
  ;;
  *-*-netbsd*)
    HOST_OS="OS_NETBSD"
    HOST_OS_FULLNAME="NetBSD"
  ;;
  *-*-macosx*)
    HOST_OS="OS_MACOSX"
    HOST_OS_FULLNAME="MacOS X"
  ;;
  *-*-macos*)
    HOST_OS="OS_MACOS"
    HOST_OS_FULLNAME="MacOS"
  ;;
  *-*-darwin*)
    HOST_OS="OS_DARWIN"
    HOST_OS_FULLNAME="Darwin"
  ;;
  *)
    HOST_OS="OS_UNKNOWN"
    HOST_OS_FULLNAME="Unknown"
esac
AC_SUBST(HOST_OS)
echo "checking for host... $HOST_OS_FULLNAME"


dnl Set PACKAGE_LOCALE_DIR in config.h
dnl ==================================
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
else
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
fi


dnl Set PACKAGE_DATA_DIR in config.h
dnl ================================
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}")
  else
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}")
fi


dnl Set PACKAGE_PLUGINS_DIR in config.h
dnl ================================
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "${ac_default_prefix}/share/${PACKAGE}/plugins")
else
  AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DIR, "${prefix}/share/${PACKAGE}/plugins")
fi


dnl Set PACKAGE_PLUGINS_CATALOG_DIR in config.h
dnl ================================
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_CATALOG_DIR, "${ac_default_prefix}/share/${PACKAGE}/plugins/catalog")
else
  AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_CATALOG_DIR, "${prefix}/share/${PACKAGE}/plugins/catalog")
fi


dnl Set PACKAGE_PLUGINS_DESCRIPTION_DIR in config.h
dnl ================================
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DESCRIPTION_DIR, "${ac_default_prefix}/share/${PACKAGE}/plugins/descr")
else
  AC_DEFINE_UNQUOTED(PACKAGE_PLUGINS_DESCRIPTION_DIR, "${prefix}/share/${PACKAGE}/plugins/descr")
fi


dnl Set PACKAGE_SOURCE_DIR in config.h
dnl ==================================
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")


dnl Use -Wall if we have gcc
dnl ========================
changequote(,)dnl
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac
fi
changequote([,])dnl


dnl Use -pedantic if we have gcc (not use this option due GTK+ is not C ANSI)
dnl =========================================================================
dnl changequote(,)dnl
dnl if test "x$GCC" = "xyes"; then
dnl   case " $CFLAGS " in
dnl     *[\ \	]-pedantic[\ \	]*) ;;
dnl     *) CFLAGS="$CFLAGS -pedantic" ;;
dnl   esac
dnl fi
dnl changequote([,])dnl


dnl Use --enable-debug for debug mode
dnl =================================
AC_ARG_ENABLE(debug,
	[  --enable-debug          use GWhere in debugging mode. [default=no]],
	GW_DEBUG_MODE=yes,
	GW_DEBUG_MODE=no)
	GMLLIB=
if test "x$GW_DEBUG_MODE" = "xyes" ; then
	AC_DEFINE(GW_DEBUG_MODE)
	echo checking for debug mode... yes
else
	echo checking for debug mode... no
fi


dnl Use --enable-debug-time for debug time
dnl ======================================
AC_ARG_ENABLE(debug-time,
	[  --enable-debug-time          use GWhere in debugging time. [default=no]],
	GW_DEBUG_TIME=yes,
	GW_DEBUG_TIME=no)
	GMLLIB=
if test "x$GW_DEBUG_TIME" = "xyes" ; then
	if test "x$GW_DEBUG_MODE" = "xyes" ; then
		AC_DEFINE(GW_DEBUG_TIME)
		echo checking for debug time... yes
	else
		echo checking for debug time... no
	fi
fi


dnl Use --enable-debug-data-component for debug data component
dnl ==========================================================
AC_ARG_ENABLE(debug-data-component,
	[  --enable-debug-data-component          use GWhere in debugging data component. [default=no]],
	GW_DEBUG_DATA_COMPONENT=yes,
	GW_DEBUG_DATA_COMPONENT=no)
	GMLLIB=
if test "x$GW_DEBUG_DATA_COMPONENT" = "xyes" ; then
	if test "x$GW_DEBUG_MODE" = "xyes" ; then
		AC_DEFINE(GW_DEBUG_DATA_COMPONENT)
		echo checking for debug data component... yes
	else
		echo checking for debug data component... no
	fi
fi


dnl Use --enable-debug-tools-component for debug data component
dnl ==========================================================
AC_ARG_ENABLE(debug-tools-component,
	[  --enable-debug-tools-component          use GWhere in debugging tools component. [default=no]],
	GW_DEBUG_TOOLS_COMPONENT=yes,
	GW_DEBUG_TOOLS_COMPONENT=no)
	GMLLIB=
if test "x$GW_DEBUG_TOOLS_COMPONENT" = "xyes" ; then
	if test "x$GW_DEBUG_MODE" = "xyes" ; then
		AC_DEFINE(GW_DEBUG_TOOLS_COMPONENT)
		echo checking for debug tools component... yes
	else
		echo checking for debug tools component... no
	fi
fi


dnl Use --enable-debug-gui-component for debug GUI component
dnl ========================================================
AC_ARG_ENABLE(debug-gui-component,
	[  --enable-debug-gui-component          use GWhere in debugging GUI component. [default=no]],
	GW_DEBUG_GUI_COMPONENT=yes,
	GW_DEBUG_GUI_COMPONENT=no)
	GMLLIB=
if test "x$GW_DEBUG_GUI_COMPONENT" = "xyes" ; then
	if test "x$GW_DEBUG_MODE" = "xyes" ; then
		AC_DEFINE(GW_DEBUG_GUI_COMPONENT)
		echo checking for debug gui component... yes
	else
		echo checking for debug gui component... no
	fi
fi


dnl Use --enable-debug-gui-callback-component for debug GUI callback component
dnl ==========================================================================
AC_ARG_ENABLE(debug-gui-callback-component,
	[  --enable-debug-gui-callback-component          use GWhere in debugging GUI callback component. [default=no]],
	GW_DEBUG_GUI_CALLBACK_COMPONENT=yes,
	GW_DEBUG_GUI_CALLBACK_COMPONENT=no)
	GMLLIB=
if test "x$GW_DEBUG_GUI_CALLBACK_COMPONENT" = "xyes" ; then
	if test "x$GW_DEBUG_MODE" = "xyes" ; then
		AC_DEFINE(GW_DEBUG_GUI_CALLBACK_COMPONENT)
		echo checking for debug gui callback component... yes
	else
		echo checking for debug gui callback component... no
	fi
fi


dnl Use --enable-debug-all for debug mode
dnl =================================
AC_ARG_ENABLE(debug-all,
	[  --enable-debug-all          use GWhere in debugging mode with debug. [default=no]],
	GW_DEBUG_ALL=yes,
	GW_DEBUG_ALL=no)
	GMLLIB=
if test "x$GW_DEBUG_ALL" = "xyes" ; then
	echo checking for debug all... yes
	AC_DEFINE(GW_DEBUG_MODE)
	AC_DEFINE(GW_DEBUG_TIME)
	AC_DEFINE(GW_DEBUG_DATA_COMPONENT)
	AC_DEFINE(GW_DEBUG_TOOLS_COMPONENT)
	AC_DEFINE(GW_DEBUG_GUI_COMPONENT)
	AC_DEFINE(GW_DEBUG_GUI_CALLBACK_COMPONENT)
	GW_DEBUG_MODE=yes
	GW_DEBUG_TIME=yes
	GW_DEBUG_DATA_COMPONENT=yes
	GW_DEBUG_TOOLS_COMPONENT=yes
	GW_DEBUG_GUI_COMPONENT=yes
	GW_DEBUG_GUI_CALLBACK_COMPONENT=yes

dnl	if test "x$USE_GTK" = "x12" ; then
dnl		echo checking for mem profile... yes
dnl		GTK_CFLAGS="$GTK_CFLAGS --enable-mem-profile=yes"
dnl	else if test "x$USE_GTK" = "xauto" ; then
dnl		echo checking for mem profile... yes
dnl		GTK_CFLAGS="$GTK_CFLAGS --enable-mem-profile=yes"
dnl	fi fi
else
	echo checking for debug all... no
fi


dnl Set GW_PROG_PATH_MOUNT (mount program path) in config.h
dnl =======================================================
AC_PATH_PROG(GW_PROG_PATH_MOUNT, mount)
AC_SUBST(GW_PROG_PATH_MOUNT)
if test "x$GW_PROG_PATH_MOUNT" != "x" ;
then
  AC_DEFINE_UNQUOTED(GW_PROG_PATH_MOUNT, "$GW_PROG_PATH_MOUNT")
fi


dnl Set GW_PROG_PATH_UMOUNT (umount program path) in config.h
dnl =======================================================
AC_PATH_PROG(GW_PROG_PATH_UMOUNT, umount)
AC_SUBST(GW_PROG_PATH_UMOUNT)
if test "x$GW_PROG_PATH_UMOUNT" != "x" ;
then
  AC_DEFINE_UNQUOTED(GW_PROG_PATH_UMOUNT, "$GW_PROG_PATH_UMOUNT")
fi


AC_OUTPUT([
Makefile
gwhere.spec
src/db/Makefile
src/data/Makefile
src/tools/Makefile
src/gui/Makefile
src/res/Makefile
src/plugins/Makefile
src/plugins/descr/Makefile
src/plugins/catalog/Makefile
src/plugins/catalog/gwcatalog/Makefile
src/plugins/catalog/csv/Makefile
src/Makefile
debian/Makefile
slackware/Makefile
doc/Doxyfile
doc/Makefile
doc/license/Makefile
doc/man/Makefile
intl/Makefile
po/Makefile.in
win32/Makefile
win32/config.h
win32/gwhere.nsi
])


echo ""
echo ""
echo "***************************************************"
echo "*          Configuring GWhere-$VERSION              *"
echo "***************************************************"
echo "*"
echo "*   Host OS : $HOST_OS_FULLNAME"
echo "*"
echo "*   GTK+ : $GTK_VERSION"
echo "*"
echo "*   Options :"

if test "x$GW_DEBUG_MODE" = "xyes" ; then
   echo "*        - Debug mode enabled"
fi

if test "x$GW_DEBUG_TIME" = "xyes" ; then
   echo "*        - Debug time enabled"
fi

if test "x$GW_DEBUG_DATA_COMPONENT" = "xyes" ; then
   echo "*        - Debug data components enabled"
fi

if test "x$GW_DEBUG_TOOLS_COMPONENT" = "xyes" ; then
   echo "*        - Debug tools components enabled"
fi

if test "x$GW_DEBUG_GUI_COMPONENT" = "xyes" ; then
   echo "*        - Debug GUI components enabled"
fi

if test "x$GW_DEBUG_GUI_CALLBACK_COMPONENT" = "xyes" ; then
   echo "*        - Debug GUI callback components enabled"
fi

echo "*"
echo "***************************************************"
echo ""
echo configure complete, type \'make\' to compile GWhere
echo ""