File: configure.in

package info (click to toggle)
gpsim 0.20.14-7.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,932 kB
  • ctags: 5,975
  • sloc: cpp: 25,431; ansic: 12,617; sh: 8,774; asm: 3,735; yacc: 678; lex: 432; makefile: 304
file content (193 lines) | stat: -rw-r--r-- 4,611 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(cli/cmd_attach.cc)
AM_CONFIG_HEADER(config.h)

dnl option for setting exdbm path prefix
dnl exdbm must be lowercase in --with option. sorry.
dnl this check must be done very early otherwise internal
dnl configure shell variables are set too late (CPPFLAGS)
dnl AC_ARG_WITH(exdbm,
dnl    [  --with-exdbm=PREFIX     where is exdbm installed],
dnl    [CPPFLAGS="$CPPFLAGS -I$with_exdbm/include"
dnl     LDFLAGS="$LDFLAGS -L$with_exdbm/lib"])

AC_CANONICAL_SYSTEM

GPSIM_MAJOR_VERSION=0
GPSIM_MINOR_VERSION=20
GPSIM_MICRO_VERSION=14
GPSIM_VERSION=$GPSIM_MAJOR_VERSION.$GPSIM_MINOR_VERSION.$GPSIM_MICRO_VERSION

AM_INIT_AUTOMAKE(gpsim, $GPSIM_VERSION)

AC_SUBST(GPSIM_MAJOR_VERSION)
AC_SUBST(GPSIM_MINOR_VERSION)
AC_SUBST(GPSIM_MICRO_VERSION)
AC_SUBST(GPSIM_VERSION)

dnl Checks for programs.
AC_PROG_YACC

dnl compilers
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP

dnl AC_PROG_LEX
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_MAKE_SET

dnl library tools
AM_PROG_LIBTOOL

dnl --disable-gui : turn off gui support (cli only)
dnl    The default is to have the gui. 

AC_ARG_ENABLE(gui,
     [  --disable-gui           Only use the cli and not the gui],
     [case "${enableval}" in
       yes) use_gui=yes ;;
       no)  use_gui=no ;;
       *) AC_MSG_ERROR(bad value ${enableval} for --disable-gui) ;;
     esac],[use_gui=yes])

if test "$use_gui" = "no"; then
	echo disabling gui support
else
	echo enabling gui support
	[
	 use_gui=yes
	]
	AC_DEFINE(HAVE_GUI)
fi



dnl Checks for libraries.
dnl Replace `main' with a function in -lfl:
dnl AC_CHECK_LIB(fl, main)
dnl Replace `main' with a function in -lreadline:
wi_LIB_READLINE
dnl AC_CHECK_LIB(readline, readline)
dnl AC_CHECK_LIB(ncurses, main)

dnl Replace `main' with a function in -ltermcap:
dnl AC_CHECK_LIB(termcap, main)

if test "$use_gui" = "no"; then

  dnl glib checks
  AC_PATH_PROG(GLIBCONFIG, glib-config, no, ${PATH})

  if test $GLIBCONFIG = "no"; then
    AC_MSG_ERROR(Cannot find glib-config: glib is needed even for non-gui version.)
  fi

  LDEXTRA=
  CFEXTRA=
  GTK=
  GDK=
  GLIB=
  X_LDFLAGS=`$GLIBCONFIG --libs`
  X_CFLAGS=`$GLIBCONFIG --cflags`
  Y_LDFLAGS=
  Y_CFLAGS=

else
  dnl gtk checks
  AC_PATH_PROG(GTKCONFIG, gtk-config, no, ${PATH})

  if test $GTKCONFIG = "no"; then
    AC_MSG_ERROR(Cannot find gtk-config)
  fi

  AC_PATH_PROG(GTKEXTRACONFIG, gtkextra-config, no, ${PATH})

  if test $GTKEXTRACONFIG = "no"; then
    AC_MSG_ERROR(Cannot find gtkextra-config)
  fi

  LDEXTRA=
  CFEXTRA=
  GTK=
  GDK=
  GLIB=
  X_LDFLAGS=`$GTKCONFIG --libs`
  X_CFLAGS=`$GTKCONFIG --cflags`
  Y_LDFLAGS=`$GTKEXTRACONFIG --libs`
  Y_CFLAGS=`$GTKEXTRACONFIG --cflags`

  dnl check that the eXdbm header can be found
  dnl AC_CHECK_HEADER(eXdbm/eXdbm.h,,[
  dnl AC_MSG_ERROR([eXdbm is needed. please use --with-exdbm option.
  dnl see ./configure --help for instructions])
  dnl ])

  dnl check that the eXdbm library can be linked, and add the link command
  dnl to the LIBS variable.
  dnl AC_CHECK_LIB(eXdbm,eXdbmInit,,[
  dnl AC_MSG_ERROR([eXdbm is needed. please use --with-exdbm option.
  dnl see ./configure --help for instructions])
  dnl ],-lm)

fi

AC_SUBST(Y_CFLAGS)
AC_SUBST(Y_LDFLAGS)
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LDFLAGS)
AC_SUBST(GTK)
AC_SUBST(GDK)
AC_SUBST(GLIB)
AC_SUBST(LIBREADLINE)

dnl Checks for header files.
AC_HEADER_STDC
dnl AC_CHECK_HEADERS(malloc.h sys/file.h unistd.h)
AC_CHECK_HEADERS(getopt.h)

dnl move the alloca check here since it doesn't produce valid C++
dnl code either
AC_FUNC_ALLOCA

dnl Set lang to C++ after checking for C Gtk; checks after this will use CXX 
dnl  instead of CC
AC_LANG_CPLUSPLUS


dnl Checks for typedefs, structures, and compiler characteristics.
dnl the const and inline checks produce illegal C++ code, skip them,
dnl C++ is required to have both, a working const and a working inline
dnl AC_C_CONST
dnl AC_C_INLINE
dnl AC_TYPE_SIZE_T

dnl Checks for library functions.
dnl AC_FUNC_ALLOCA
AC_TYPE_SIGNAL

AC_CHECK_FUNCS(strdup strstr strtod strtol strtoul)

AC_OUTPUT( src/Makefile cli/Makefile Makefile \
	gui/Makefile  xpms/Makefile eXdbm/Makefile \
	gpsim/Makefile examples/Makefile \
	modules/Makefile \
	examples/12bit/Makefile examples/14bit/Makefile examples/16bit/Makefile \
	doc/Makefile \
	rpm/Makefile )


AC_MSG_RESULT([

gpsim-$GPSIM_VERSION is now configured for $canonical_host_type

  Source directory:     $srcdir
  Installation prefix:  $prefix
  C compiler:           $CC $CPPFLAGS $XTRA_CFLAGS $CFLAGS
  C++ compiler:         $CXX $CPPFLAGS $XTRA_CXXFLAGS $CXXFLAGS

  gui:			$use_gui

])