~ubuntu-branches/ubuntu/maverick/gpsdrive/maverick

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Frank Kirschner
  • Date: 2004-05-25 11:44:03 UTC
  • Revision ID: james.westby@ubuntu.com-20040525114403-j3rsu57cavfax6z8
Tags: upstream-2.09
ImportĀ upstreamĀ versionĀ 2.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 $
 
4
 
 
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')
 
9
 
 
10
AC_CONFIG_SRCDIR(src/gpsdrive.c)
 
11
AC_CONFIG_HEADER(config.h)
 
12
 
 
13
ALL_LINGUAS="de es fr it da nl tr de_AT hu sk sv no pt_BR gr ja"
 
14
 
 
15
 
 
16
dnl ************************
 
17
dnl Compiler options
 
18
dnl ************************
 
19
AC_PROG_LIBTOOL
 
20
 
 
21
AC_PROG_CC
 
22
AC_ISC_POSIX
 
23
AC_C_INLINE
 
24
AC_PROG_INSTALL
 
25
AC_PROG_CXX
 
26
AC_HEADER_STDC
 
27
AC_PROG_AWK
 
28
AC_PROG_INSTALL
 
29
AC_PROG_LN_S
 
30
 
 
31
echo "Using $CC compiler"
 
32
 
 
33
if test "$CC" = "gcc" ; then
 
34
 
 
35
if $CC -dumpversion|egrep -q "^3\.*"; then
 
36
echo "GCC ok"
 
37
else
 
38
echo "*****************************************"
 
39
echo "You need a gcc >= 3.x to compile GpsDrive"
 
40
echo "*****************************************"
 
41
exit
 
42
fi
 
43
 
 
44
fi
 
45
 
 
46
 
 
47
UNAMEP=`uname -p`
 
48
ARCHP=`arch`
 
49
CFLAGS="$CFLAGS"
 
50
 
 
51
AC_ARG_WITH(debug,
 
52
[  --with-debug            compiles with -g],[
 
53
        OPT_CFLAGS=""
 
54
        CFLAGS=""
 
55
        echo "Ignoring optimizing flags; using debugging flags: $OPT_CFLAGS"
 
56
])
 
57
 
 
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]),
 
61
 
 
62
                UNAMEP=`uname -p`
 
63
                if test "x$UNAMEP" = "xunknown"; then
 
64
                        UNAMEP=`grep "model name" /proc/cpuinfo | cut -d: -f2`
 
65
                fi
 
66
 
 
67
echo $UNAMEP
 
68
                if $CC -dumpversion|egrep -q "^3\.3.*"; then
 
69
# gcc-3.3
 
70
                        if echo $UNAMEP|grep -q "Intel(R) Pentium(R) 4 CPU"; then
 
71
                                MARCH=-march=pentium4
 
72
                        elif echo $UNAMEP|grep -q "Pentium III"; then
 
73
                                MARCH=-march=pentium3
 
74
                        elif echo $UNAMEP|grep -q "AMD-K6(tm) 3D"; then
 
75
                                MARCH=-march=k6-2
 
76
                        elif echo $UNAMEP|grep -q "Pentium 75 - 200"; then
 
77
                                MARCH=-march=pentium
 
78
                        elif echo $UNAMEP|grep -q "Pentium II"; then
 
79
                                MARCH=-march=pentium2
 
80
                        elif echo $UNAMEP|grep -q "AMD Athlon(..) XP"; then
 
81
                                MARCH=-march=athlon-xp
 
82
                        else
 
83
                                MARCH=""
 
84
                        fi
 
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
 
87
# gcc-3.0
 
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
 
90
# gcc-2.95
 
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
 
94
                                MARCH=-march=k6
 
95
                        elif echo $UNAMEP|grep -q "Pentium 75 - 200"; then
 
96
                                MARCH=-march=pentium
 
97
                        else 
 
98
                                MARCH=""
 
99
                        fi
 
100
                        OPT_CFLAGS="$MARCH -O3 -fomit-frame-pointer -fno-exceptions  -pipe -s -ffast-math -fexpensive-optimizations"
 
101
                else
 
102
                        echo "warning: compiler is not known: not optimizing!"
 
103
                fi
 
104
                echo "compiler optimizing flags: $OPT_CFLAGS"
 
105
)
 
106
 
 
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"
 
113
                else
 
114
                        echo "warning: compiler is not gcc3: not optimizing!"
 
115
                fi
 
116
)
 
117
 
 
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"
 
124
                else 
 
125
                        echo "warning: compiler is not gcc2: not optimizing!"
 
126
                fi
 
127
)
 
128
 
 
129
AC_PROG_INSTALL
 
130
 
 
131
CFLAGS="$CFLAGS -g -Wall -Wno-format-y2k -pipe $OPT_CFLAGS"
 
132
 
 
133
dnl ************************
 
134
dnl Check for standard headers
 
135
dnl ************************
 
136
 
 
137
AC_HEADER_STDC
 
138
AC_CHECK_SOCKLEN_T
 
139
 
 
140
dnl ************************
 
141
dnl Checks for libraries
 
142
dnl ************************
 
143
 
 
144
PKG_CHECK_MODULES(PKGCONFIG, gtk+-2.0 >= 2.0.6  gthread-2.0)
 
145
LIBS="$LIBS $PKGCONFIG_LIBS"
 
146
CFLAGS="$CFLAGS $PKGCONFIG_CFLAGS"
 
147
 
 
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)
 
151
else 
 
152
        LIBS="$LIBS `$PCRE_CONFIG --libs`"
 
153
        CFLAGS="$CFLAGS `$PCRE_CONFIG --cflags`"
 
154
fi
 
155
 
 
156
 
 
157
localedir='${prefix}/share/locale'
 
158
AC_SUBST(localedir)
 
159
 
 
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)
 
164
 
 
165
dnl ************************
 
166
dnl crypt.h and libcrypt
 
167
dnl ************************
 
168
AC_CHECK_HEADERS(crypt.h)
 
169
AC_CHECK_LIB(crypt,crypt)
 
170
 
 
171
dnl ************************
 
172
dnl check dynamic loading flags
 
173
dnl ************************
 
174
AC_LTDL_DLLIB
 
175
AC_LTDL_DLSYM_USCORE
 
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') 
 
182
#fi
 
183
 
 
184
dnl Checks select argument types
 
185
AC_FUNC_SELECT_ARGTYPES
 
186
AC_HEADER_TIME
 
187
 
 
188
dnl ************************
 
189
dnl Program locations
 
190
dnl ************************
 
191
 
 
192
AC_PREFIX_DEFAULT("/usr/local")
 
193
 
 
194
if test "${prefix}" == "NONE"; then
 
195
        prefix=${ac_default_prefix}
 
196
        AC_SUBST(prefix)
 
197
fi
 
198
 
 
199
pkgdatadir=${datadir}/${PACKAGE}/
 
200
AC_SUBST(pkgdatadir)
 
201
 
 
202
dnl *******************************
 
203
dnl   GETTEXT
 
204
dnl *******************************
 
205
AM_GLIB_GNU_GETTEXT
 
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"
 
213
        USE_NLS=no
 
214
fi
 
215
if test "$MSGFMT" = "no" ; then
 
216
        echo "no msfmt - NLS disabled"
 
217
        USE_NLS=no
 
218
fi
 
219
if test "$USE_NLS" = "yes" ; then
 
220
        AC_DEFINE(ENABLE_NLS)
 
221
fi
 
222
 
 
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') 
 
229
                        disablegarmin=true 
 
230
                        CXX=$CC ;;
 
231
                *) AC_MSG_ERROR(bad value ${enableval} for --enable-garmin) ;;
 
232
        esac
 
233
])
 
234
AM_CONDITIONAL(DISABLEGARMIN, test x$disablegarmin = xtrue)
 
235
 
 
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) ;;
 
244
        esac
 
245
])
 
246
AM_CONDITIONAL(DISABLEPLUGINS, test x$disableplugins = xtrue)
 
247
 
 
248
 
 
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) ;;
 
257
        esac
 
258
])
 
259
AM_CONDITIONAL(ENABLETELEATLAS, test x$enableteleatlas = xtrue)
 
260
 
 
261
 
 
262
 
 
263
dnl ************************
 
264
dnl crypt.h and libcrypt
 
265
dnl ************************
 
266
AC_CHECK_HEADERS(crypt.h)
 
267
AC_CHECK_LIB(crypt,crypt)
 
268
 
 
269
dnl ************************
 
270
dnl GNU getopt
 
271
dnl ************************
 
272
AC_CHECK_DECLS(getopt)
 
273
 
 
274
dnl ************************
 
275
dnl check dynamic loading flags
 
276
dnl ************************
 
277
AC_LTDL_DLLIB
 
278
AC_LTDL_DLSYM_USCORE
 
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') 
 
285
#fi
 
286
 
 
287
CFLAGS="$CFLAGS -Imysql"
 
288
 
 
289
CFLAGS="$CFLAGS $OPT_CFLAGS"
 
290
CXXFLAGS="$CXXFLAGS $OPT_CFLAGS"
 
291
 
 
292
AC_CONFIG_FILES(Makefile src/Makefile  man/Makefile man/de/Makefile man/es/Makefile po/Makefile.in)
 
293
AC_OUTPUT
 
294