1
dnl Process this file with autoconf to produce a configure script.
2
dnl $Id: configure.in 624 2004-04-19 21:12:22Z roms $
8
AC_INIT(src/tilp_main.c)
10
# set program version number
16
# specify a config file
17
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
20
AM_CONFIG_HEADER(config.h)
22
# determine the system type
23
dnl AC_CANONICAL_SYSTEM
24
# determine the host type
27
# change the default prefix (/usr/local) to /usr
28
AC_PREFIX_DEFAULT('/usr')
30
# build time sanity check...
34
echo -n "checking for something to drink while compiling..."
35
echo " err: no fridge found"
37
# Checks for programs.
46
# gettext support (must be set here; before libti* dependancy checks)
51
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
52
if test x$PKG_CONFIG = xno ; then
53
AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
56
# checks for libraries.
57
AC_CHECK_LIB(dl, dlopen)
59
AC_CHECK_LIB(jpeg, jpeg_std_error)
61
# checks for header files.
66
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 sys/param.h)
67
AC_CHECK_HEADERS(stdint.h)
68
AC_CHECK_HEADERS(locale.h libintl.h)
69
AC_CHECK_HEADER(jpeglib.h)
70
AC_CHECK_MEMBERS(struct stat.st_blksize)
72
# checks for typedefs, structures, and compiler characteristics.
85
# checks for library functions.
90
AC_CHECK_FUNCS(getcwd mkdir strstr strtol dup2 getwd memchr memset strrchr pow setlocale strcasecmp strchr)
93
AC_MSG_CHECKING([for Win32])
95
*-*-mingw*) tilp_native_win32=yes ;;
96
*-*-cygwin) tilp_native_win32=yes ;;
97
*) tilp_native_win32=no ;;
99
AC_MSG_RESULT([$tilp_native_win32])
100
AM_CONDITIONAL(OS_WIN32, test "$tilp_native_win32" = "yes")
102
# Ensure MSVC-compatible struct packing convention is used when
103
# compiling for Win32 with gcc.
104
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
105
# gcc2 uses "-fnative-struct".
106
if test x"$tilp_native_win32" = xyes; then
107
if test x"$GCC" = xyes; then
109
AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
110
if test -z "$ac_cv_prog_CC"; then
113
our_gcc="$ac_cv_prog_CC"
115
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
117
if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
118
msnative_struct='-fnative-struct'
122
if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
123
msnative_struct='-mms-bitfields'
127
if test x"$msnative_struct" = x ; then
128
AC_MSG_RESULT([no way])
129
AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
131
CFLAGS="$CFLAGS $msnative_struct"
132
AC_MSG_RESULT([${msnative_struct}])
141
*-*-mingw*) ARCH="-D__WIN32__ -D__MINGW32__ -Os -s" ;;
142
*-*-cygwin) ARCH="-D__WIN32__ -D__CYGWIN__ -mno-cygwin" ;;
143
*-*-*bsd*) ARCH="-D__BSD__" ;;
144
*) ARCH="-D__LINUX__" ;;
147
# check for ticables presence
148
PKG_CHECK_MODULES(TICABLES, ticables >= 3.8.0)
149
AC_SUBST(TICABLES_CFLAGS)
150
AC_SUBST(TICABLES_LIBS)
152
# check for tifiles presence
153
PKG_CHECK_MODULES(TIFILES, tifiles >= 0.5.7)
154
AC_SUBST(TIFILES_CFLAGS)
155
AC_SUBST(TIFILES_LIBS)
157
# check for ticalcs presence
158
PKG_CHECK_MODULES(TICALCS, ticalcs >= 4.5.2)
159
AC_SUBST(TICALCS_CFLAGS)
160
AC_SUBST(TICALCS_LIBS)
162
# check for glib presence
163
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0)
164
AC_SUBST(GLIB_CFLAGS)
167
# check for gdk-pixbuf presence
168
#PKG_CHECK_MODULES(GLIB, gdk_pixbuf-2.0 >= 2.0.0)
169
#AC_SUBST(GLIB_CFLAGS)
172
# check for gtk presence
173
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0)
177
# check for libglade presence
178
PKG_CHECK_MODULES(GTK, libglade-2.0 >= 1.99.0)
182
CFLAGS="$CFLAGS $TICABLES_CFLAGS $TIFILES_CFLAGS $TICALCS_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS"
183
LDFLAGS="$LDFLAGS $TICABLES_LIBS $TIFILES_LIBS $TICALCS_LIBS $GLIB_LIBS $GTK_LIBS"
191
# pass some variables to plugins
192
tilp_plugin_dir=$libdir/$PACKAGE
193
AC_SUBST(tilp_plugin_dir)
194
tilp_help_dir=$datadir/$PACKAGE/help
195
AC_SUBST(tilp_help_dir)
196
tilp_pixmap_dir=$datadir/$PACKAGE/pixmaps
197
AC_SUBST(tilp_pixmap_dir)
198
tilp_icon_dir=$datadir/$PACKAGE/icons
199
AC_SUBST(tilp_icon_dir)
200
tilp_glade_dir=$datadir/$PACKAGE/glade
201
AC_SUBST(tilp_glade_dir)
203
# exit HOME dir facility
204
AC_ARG_ENABLE(exit_homedir, [ --enable-exit-homedir allow user to exit home dir [default=yes]],,enable_exit_homedir=yes)
206
AC_MSG_CHECKING(whether authorizing user to go outside the HOME dir)
207
if test "x$enable_exit_homedir" = "xyes"; then
208
AC_DEFINE(ALLOW_EXIT_HOMEDIR, 1, [Whether allowing user to exit HOME dir])
209
AC_SUBST(ALLOW_EXIT_HOMEDIR)
215
locale_dir='${prefix}/share/locale'
219
CFLAGS="$CFLAGS $ARCH -Wall"
220
LDFLAGS="$LDFLAGS $INTLLIBS -g"
238
plugins/test/Makefile
239
plugins/nv82/Makefile
247
if test "x$enable_exit_homedir" = "xno"; then
249
echo "If you are a single user and you want to move in your filesystem, " ;
250
echo "you can choose to add the '--enable-exit-homedir' option on the" ;
251
echo 'configure'" command line." ;
252
echo "By default, it is disabled for security reasons !" ;
255
echo "The 'exit HOME dir' facility is now enabled as default behaviour. "
256
echo "Please keep in mind tha this is not secure..." ;