[go: up one dir, main page]

File: configure.ac

package info (click to toggle)
tilp 5.03-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,644 kB
  • ctags: 2,303
  • sloc: ansic: 17,968; sh: 9,432; makefile: 386; sed: 93; cpp: 61
file content (280 lines) | stat: -rw-r--r-- 8,100 bytes parent folder | download
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
dnl Process this file with autoconf to produce a configure script.

dnl Init autoconf
AC_INIT(src/sub_main.c)
AC_PREREQ(2.52)

dnl Propagate some vars in sub-Makefile
VERSION=5.03
PACKAGE=tilp
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)

dnl Set library version number
MAJOR_VERSION=5
MINOR_VERSION=0
MICRO_VERSION=2
dnl VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION

dnl Pass variables
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
dnl AC_SUBST(VERSION)

dnl libtool versioning
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=`expr $MINOR_VERSION + $MAJOR_VERSION`
LT_REVISION=$MICRO_VERSION
LT_AGE=$MINOR_VERSION
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

dnl Determine the system type
AC_CANONICAL_SYSTEM
dnl Determine the host type
dnl AC_CANONICAL_HOST

dnl Initialize libtool
AM_PROG_LIBTOOL

dnl Change the default prefix (/usr/local) to /usr
AC_PREFIX_DEFAULT('/usr')

dnl Create the config.h file and set version & package name
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AM_CONFIG_HEADER(config.h)

dnl Substitue the options variable
dnl AC_SUBST_FILE(options)
dnl options="-DGTK -DVERBOSE"

# Build time sanity check...
AM_SANITY_CHECK

dnl Just for fun :)
echo -n "checking for something to drink while compiling..."
echo " err: no fridge found"

dnl Checks for programs.
dnl AC_ARG_PROGRAM
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_ISC_POSIX
AC_PROG_LIBTOOL

dnl Checks for libraries.
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(curses, initscr)
AC_CHECK_LIB(ticables, ticable_get_version)
AC_CHECK_LIB(ticalcs, ticalc_get_version)
AC_CHECK_LIB(tiffep, tiffep_get_version)
AC_CHECK_LIB(jpeg, jpeg_std_error)
AC_CHECK_LIB(Ilib, ICreateImage)
AC_CHECK_LIB(m, pow)

dnl Checks for ticables-config
AC_CHECK_PROG(TICABLES_CONFIG, ticables-config, yes, no)
if test "$TICABLES_CONFIG" = "no"; then
        echo ;
        echo "Error: cannot find ticables-config. Do you have libticables installed ?" ; 
	echo "You can download it from" ;
        echo "<http://lpg.ticalc.org/prj_tilp/download-en.html> ..." ;
        echo ;
        exit
else
        TICABLES_LIBS=`ticables-config --libs`
        TICABLES_CFLAGS=`ticables-config --cflags`
        TICABLES_VERSION=`ticables-config --version`

        LIBS="$LIBS $TICABLES_LIBS"
        CFLAGS="$CFLAGS $TICABLES_CFLAGS"
fi

CFLAGS="$CFLAGS"
AC_SUBST(CFLAGS)

dnl Checks for ticalcs-config
AC_CHECK_PROG(TICALCS_CONFIG, ticalcs-config, yes, no)
if test "$TICALCS_CONFIG" = "no"; then
        echo ;
        echo "Error: cannot find ticables-config. Do you have libticables installed ?" ; 
	echo "You can download it from" ;
        echo "<http://lpg.ticalc.org/prj_tilp/download-en.html> ..." ;
        echo ;
        exit
else
        TICALCS_LIBS=`ticalcs-config --libs`
        TICALCS_CFLAGS=`ticalcs-config --cflags`
        TICALCS_VERSION=`ticalcs-config --version`

        LIBS="$LIBS $TICALCS_LIBS"
        CFLAGS="$CFLAGS $TICALCS_CFLAGS"
fi

CFLAGS="$CFLAGS"
AC_SUBST(CFLAGS)

dnl Checks for tiffep-config
AC_CHECK_PROG(TIFFEP_CONFIG, tiffep-config, yes, no)
if test "$TIFFEP_CONFIG" = "no"; then
        echo ;
        echo "Warning: cannot find tiffep-config. Do you have libtiffep installed ?" ;
	echo "Some new functionnalities of TiLP (such as GFM) will not be available." ; 
	echo "You can download it from" ;
        echo "<http://lpg.ticalc.org/prj_tiffep/index.html> ..." ;
        echo ;
else
        TIFFEP_LIBS=`tiffep-config --libs`
        TIFFEP_CFLAGS=`tiffep-config --cflags`
        TIFFEP_VERSION=`tiffep-config --version`

        LIBS="$LIBS $TIFFEP_LIBS"
        CFLAGS="$CFLAGS $TIFFEP_CFLAGS"
fi

CFLAGS="$CFLAGS"
AC_SUBST(CFLAGS)

dnl Checks for gtk-config
AC_CHECK_PROG(GTK_CONFIG, gtk-config, yes, no)
if test "$GTK_CONFIG" = "no"; then
        echo ;
        echo "Error: cannot find gtk-config. Do you have gtk installed ?";
	echo "You can download it from ftp://ftp.gtk.org/pub/gtk/v1.2";
	echo "Make sure to also download the same version" ;
        echo "of glib too from that same directory" ;
        echo ;
        exit
else
        GTK_LIBS=`gtk-config --libs`
        GTK_CFLAGS=`gtk-config --cflags`
        GTK_VERSION=`gtk-config --version`

        LIBS="$LIBS $GTK_LIBS"
        CFLAGS="$CFLAGS $GTK_CFLAGS"
fi

CFLAGS="$CFLAGS"
AC_SUBST(CFLAGS)

dnl Make sure we are using gtk+ 1.1.x or higher
AC_MSG_CHECKING(version of gtk+...)
gtk_maj_rev=`echo $GTK_VERSION | cut -f1-2 -d.`
if test "$gtk_maj_rev" = "1.2" ; then
   AC_MSG_RESULT(($GTK_VERSION))
else
   AC_MSG_RESULT(($GTK_VERSION))
   if test "$gtk_maj_rev" = "1.1" ; then
        AC_WARN(You have gtk+ 1.1 installed on your machine. I would)
        AC_WARN(recommend upgrading to the stable 1.2 series)
        AC_WARN(You can download it from ftp://ftp.gtk.org/pub/gtk/v1.2)
        AC_WARN(Make sure to also download the same version of glib too)
   else
        echo ;
        echo "Error: You need gtk+ 1.1.x or higher to install tilp. You can dow\nload it from" ;
        echo "ftp://ftp.gtk.org/pub/gtk/v1.2 I would recommend downloading the \stable 1.2" ;
        echo "series. Make sure to also download the same version of glib too f\rom that same" ;
        echo "directory" ;
        echo ;
        exit
   fi
fi

CFLAGS="$CFLAGS -Wall"
AC_SUBST(CFLAGS)

dnl Checks for header files.
AC_PATH_X
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(strings.h unistd.h malloc.h sys/file.h fcntl.h direct.h alloca.h errno.h sys/time.h utime.h)
AC_CHECK_HEADERS(tilp/macros.h tilp/typedefs.h tilp/export.h tilp/cabl_def.h tilp/cabl_int.h tilp/calc_def.h tilp/calc_int.h)
AC_CHECK_HEADERS(tiffep/tiffep.h)
AC_CHECK_HEADERS(locale.h libintl.h)
AC_CHECK_HEADER(jpeglib.h)
AC_CHECK_HEADER(Ilib.h)
AC_CHECK_MEMBERS(struct stat.st_blksize)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_FUNC_ERROR_AT_LINE
AC_HEADER_MAJOR

dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MALLOC
AC_FUNC_STAT
AC_CHECK_FUNCS(getcwd mkdir strstr strtol dup2 getwd memchr memset strrchr pow)

dnl Internationalization (i18n)
ALL_LINGUAS="fr de it es nl"
AM_GNU_GETTEXT

dnl Pass locale directory
PACKAGE_LOCALE_DIR=${datadir}/locale
AC_SUBST(PACKAGE_LOCALE_DIR)

dnl Enable to exit HOME dir (piece of code borrowed from Gtktalog)
ENABLE_EXIT_HOMEDIR=no
   AC_ARG_ENABLE(exit-homedir,
        [  --enable-exit-homedir   allow user to exit home dir [default=no]],
        [case "x${enableval}" in
                 xyes)         ENABLE_EXIT_HOMEDIR=yes ;;
                 xno)          ENABLE_EXIT_HOMEDIR=no ;;
                 *)            ENABLE_EXIT_HOMEDIR=no ;;
             esac])
if test "x$ENABLE_EXIT_HOMEDIR" = "xyes" ;
then
        AC_DEFINE(ALLOW_EXIT_HOMEDIR)
fi

dnl Enable/disable TIFFEP server use
ENABLE_TIFFEP_SERVER=no
   AC_ARG_ENABLE(tiffep-server,
        [  --enable-tiffep   use the TIFFEP server [default=no]],
        [case "x${enableval}" in
                 xyes)         ENABLE_TIFFEP_SERVER=yes ;;
                 xno)          ENABLE_TIFFEP_SERVER=no ;;
                 *)            ENABLE_TIFFEP_SERVER=no ;;
             esac])
if test "x$ENABLE_TIFFEP_SERVER" = "xyes" ;
then
        AC_DEFINE(ALLOW_TIFFEP_SERVER)
fi

AC_OUTPUT([Makefile fonts/Makefile help/Makefile intl/Makefile \
	man/Makefile misc/Makefile pixmaps/Makefile po/Makefile.in \
	src/Makefile win32/Makefile \
	tilp.lsm tilp.spec])

echo ;
echo "If you are a single user and you want be able to move in your filesystem, " ;
echo "you can choose to add the '--enable-exit-homedir' option on the 'configure'" ;
echo "command line. By default, it is disabled for security reasons !" ;
echo ;
echo "If you want some applications to be able to use TiLP trough the TIFFEP server " ;
echo "(experimental), you can add the '--enable-tiffep-server' options on the" ;
echo "'configure' command line. By default, this option is disabled !" ;
echo "Nevertheless, if the TIFFEP library (libtiffep) is available, it will be used." ;
echo ;