1
dnl configure.ac for Gpsdrive
2
dnl Copyright (c) 2001-2004 Fritz Ganter <ganter@ganter.at>
3
dnl $Id: configure.ac,v 1.62 2004/03/03 20:46:47 ganter Exp $
5
AC_INIT(gpsdrive, 2.09, ganter@ganter.at)
6
AC_CONFIG_SRCDIR(foo.c)
7
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
8
AC_SUBST(FRIENDSSERVERVERSION,'2')
10
AC_CONFIG_SRCDIR(src/gpsdrive.c)
11
AC_CONFIG_HEADER(config.h)
13
ALL_LINGUAS="de es fr it da nl tr de_AT hu sk sv no pt_BR gr ja"
16
dnl ************************
18
dnl ************************
31
echo "Using $CC compiler"
33
if test "$CC" = "gcc" ; then
35
if $CC -dumpversion|egrep -q "^3\.*"; then
38
echo "*****************************************"
39
echo "You need a gcc >= 3.x to compile GpsDrive"
40
echo "*****************************************"
52
[ --with-debug compiles with -g],[
55
echo "Ignoring optimizing flags; using debugging flags: $OPT_CFLAGS"
58
AC_ARG_ENABLE(auto-optimization,
59
AC_HELP_STRING([--enable-auto-optimization],
60
[try to automatically determine the most optimal build options for your architecture]),
63
if test "x$UNAMEP" = "xunknown"; then
64
UNAMEP=`grep "model name" /proc/cpuinfo | cut -d: -f2`
68
if $CC -dumpversion|egrep -q "^3\.3.*"; then
70
if echo $UNAMEP|grep -q "Intel(R) Pentium(R) 4 CPU"; then
72
elif echo $UNAMEP|grep -q "Pentium III"; then
74
elif echo $UNAMEP|grep -q "AMD-K6(tm) 3D"; then
76
elif echo $UNAMEP|grep -q "Pentium 75 - 200"; then
78
elif echo $UNAMEP|grep -q "Pentium II"; then
80
elif echo $UNAMEP|grep -q "AMD Athlon(..) XP"; then
81
MARCH=-march=athlon-xp
85
OPT_CFLAGS="-O3 $MARCH -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations -falign-functions -falign-loops -funroll-loops -mfpmath=sse"
86
elif $CC -dumpversion|egrep -q "^3\.0.*"; then
88
OPT_CFLAGS="-O3 -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations -falign-functions -falign-loops "
89
elif $CC -dumpversion | egrep -q "^2\.95.*" ; then
91
if echo $UNAMEP|egrep -q "(Pentium III|Pentium II|Pentium\(R\) 4|Athlon)"; then
92
MARCH=-march=pentiumpro
93
elif echo $UNAMEP|grep -q "AMD-K6"; then
95
elif echo $UNAMEP|grep -q "Pentium 75 - 200"; then
100
OPT_CFLAGS="$MARCH -O3 -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations"
102
echo "warning: compiler is not known: not optimizing!"
104
echo "compiler optimizing flags: $OPT_CFLAGS"
107
AC_ARG_ENABLE(gcc3-optimization,
108
AC_HELP_STRING([--enable-gcc3-optimization=type],
109
[gcc3 can optimize for: i386, i486, pentium, pentium-mmx, pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-4, athlon-xp, athlon-mp, winchip-c6, winchip2, c3]),
110
if $CC -dumpversion|egrep -q "^3\..*"; then
111
OPT_CFLAGS="-O3 -march=$enableval -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations -falign-functions -falign-loops"
112
echo "compiler optimizing flags: $OPT_CFLAGS"
114
echo "warning: compiler is not gcc3: not optimizing!"
118
AC_ARG_ENABLE(gcc2-optimization,
119
AC_HELP_STRING([--enable-gcc2-optimization=type],
120
[gcc2 can optimize for: i386, i486, pentium, pentiumpro, k6]),
121
if $CC -dumpversion | egrep -q "^2\..*" ; then
122
OPT_CFLAGS="-O3 -march=$enableval -fomit-frame-pointer -fno-exceptions -pipe -s -ffast-math -fexpensive-optimizations"
123
echo "compiler optimizing flags: $OPT_CFLAGS"
125
echo "warning: compiler is not gcc2: not optimizing!"
131
CFLAGS="$CFLAGS -g -Wall -Wno-format-y2k -pipe $OPT_CFLAGS"
133
dnl ************************
134
dnl Check for standard headers
135
dnl ************************
140
dnl ************************
141
dnl Checks for libraries
142
dnl ************************
144
PKG_CHECK_MODULES(PKGCONFIG, gtk+-2.0 >= 2.0.6 gthread-2.0)
145
LIBS="$LIBS $PKGCONFIG_LIBS"
146
CFLAGS="$CFLAGS $PKGCONFIG_CFLAGS"
148
AC_PATH_PROG(PCRE_CONFIG, pcre-config, no)
149
if test "x$PCRE_CONFIG" = "xno" ; then
150
AC_MSG_ERROR(pcre-config not found please install libpcre3-dev or similar)
152
LIBS="$LIBS `$PCRE_CONFIG --libs`"
153
CFLAGS="$CFLAGS `$PCRE_CONFIG --cflags`"
157
localedir='${prefix}/share/locale'
160
dnl ************************
161
dnl Checks for header files.
162
dnl ************************
163
AC_CHECK_HEADERS(sys/types.h sys/termios.h termio.h termios.h sys/stat.h fcntl.h stdio.h unistd.h netdb.h X11/X.h linux/inet.h sys/ioctl.h)
165
dnl ************************
166
dnl crypt.h and libcrypt
167
dnl ************************
168
AC_CHECK_HEADERS(crypt.h)
169
AC_CHECK_LIB(crypt,crypt)
171
dnl ************************
172
dnl check dynamic loading flags
173
dnl ************************
176
# putting this here gets the option enabled, but program segfaults
177
# putting a non-conditional CFLAGS="$CFLAGS -Ddlsym..." early in
178
# configure.ac works correctly, but putting the two AC_ and the
179
# conditional CFLAGS= does not.
180
#if test x"$libltdl_cv_need_uscore" = xyes; then
181
# AC_SUBST(DLSYM_CFLAGS,'-Ddlsym=dlsym_prepend_underscore')
184
dnl Checks select argument types
185
AC_FUNC_SELECT_ARGTYPES
188
dnl ************************
189
dnl Program locations
190
dnl ************************
192
AC_PREFIX_DEFAULT("/usr/local")
194
if test "${prefix}" == "NONE"; then
195
prefix=${ac_default_prefix}
199
pkgdatadir=${datadir}/${PACKAGE}/
202
dnl *******************************
204
dnl *******************************
206
AC_PATH_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
207
GETTEXT_PACKAGE=gpsdrive
208
AC_SUBST(GETTEXT_PACKAGE)
209
dnl AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
210
AC_DEFINE([GETTEXT_PACKAGE],"gpsdrive", this is the gettext domain name)
211
if test "$GMSGFMT" = "no"; then
212
echo "no gmsgfmt - NLS disabled"
215
if test "$MSGFMT" = "no" ; then
216
echo "no msfmt - NLS disabled"
219
if test "$USE_NLS" = "yes" ; then
220
AC_DEFINE(ENABLE_NLS)
223
AC_ARG_ENABLE(garmin,
224
[ --disable-garmin compiles without GARMIN protocol support],[
225
case "${enableval}" in
226
yes) echo "enable GARMIN protocol support" ;;
227
no) echo "disable GARMIN protocol support"
228
AC_SUBST(NOGARMIN,'-DNOGARMIN')
231
*) AC_MSG_ERROR(bad value ${enableval} for --enable-garmin) ;;
234
AM_CONDITIONAL(DISABLEGARMIN, test x$disablegarmin = xtrue)
236
AC_ARG_ENABLE(plugins,
237
[ --disable-plugins disable use of plugin modules],[
238
case "${enableval}" in
239
yes) echo "enable plugin support" ;;
240
no) echo "disable plugin support"
241
AC_SUBST(NOPLUGINS,'-DNOPLUGINS')
242
disableplugins=true ;;
243
*) AC_MSG_ERROR(bad value ${enableval} for --enable-plugins) ;;
246
AM_CONDITIONAL(DISABLEPLUGINS, test x$disableplugins = xtrue)
249
AC_ARG_ENABLE(teleatlas,
250
AC_HELP_STRING([--enable-teleatlas],[enable street navigation using Teleatlas maps, needs gpsnavlib. Ignore this option until announced at www.gpsdrive.cc ]),[
251
case "${enableval}" in
252
no) echo "disable street navigation support" ;;
253
yes) echo "enable street navigation using Teleatlas maps, needs gpsnavlib"
254
AC_SUBST(USETELEATLAS,'-DUSETELEATLAS')
255
enableteleatlas=true ;;
256
*) AC_MSG_ERROR(bad value ${enableval} for --enable-teleatlas) ;;
259
AM_CONDITIONAL(ENABLETELEATLAS, test x$enableteleatlas = xtrue)
263
dnl ************************
264
dnl crypt.h and libcrypt
265
dnl ************************
266
AC_CHECK_HEADERS(crypt.h)
267
AC_CHECK_LIB(crypt,crypt)
269
dnl ************************
271
dnl ************************
272
AC_CHECK_DECLS(getopt)
274
dnl ************************
275
dnl check dynamic loading flags
276
dnl ************************
279
# putting this here gets the option enabled, but program segfaults
280
# putting a non-conditional CFLAGS="$CFLAGS -Ddlsym..." early in
281
# configure.ac works correctly, but putting the two AC_ and the
282
# conditional CFLAGS= does not.
283
#if test x"$libltdl_cv_need_uscore" = xyes; then
284
# AC_SUBST(DLSYM_CFLAGS,'-Ddlsym=dlsym_prepend_underscore')
287
CFLAGS="$CFLAGS -Imysql"
289
CFLAGS="$CFLAGS $OPT_CFLAGS"
290
CXXFLAGS="$CXXFLAGS $OPT_CFLAGS"
292
AC_CONFIG_FILES(Makefile src/Makefile man/Makefile man/de/Makefile man/es/Makefile po/Makefile.in)