~ubuntu-branches/ubuntu/edgy/tilp/edgy

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2004-05-22 21:12:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040522211203-awg2cuw03guyvyz9
Tags: 6.72-2
* debian/control
  + Build-Depends: libticables3 (>= 3.8.4-1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 $
 
3
 
 
4
# requires autoconf
 
5
AC_PREREQ(2.52)
 
6
 
 
7
# init autoconf
 
8
AC_INIT(src/tilp_main.c)
 
9
 
 
10
# set program version number
 
11
VERSION=6.72
 
12
PACKAGE=tilp
 
13
AC_SUBST(VERSION)
 
14
AC_SUBST(PACKAGE)
 
15
 
 
16
# specify a config file
 
17
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
 
18
AM_MAINTAINER_MODE
 
19
 
 
20
AM_CONFIG_HEADER(config.h)
 
21
 
 
22
# determine the system type
 
23
dnl AC_CANONICAL_SYSTEM
 
24
# determine the host type
 
25
AC_CANONICAL_HOST
 
26
 
 
27
# change the default prefix (/usr/local) to /usr
 
28
AC_PREFIX_DEFAULT('/usr')
 
29
 
 
30
# build time sanity check...
 
31
AM_SANITY_CHECK
 
32
 
 
33
# Just for fun :)
 
34
echo -n "checking for something to drink while compiling..."
 
35
echo " err: no fridge found"
 
36
 
 
37
# Checks for programs.
 
38
AC_PROG_CC
 
39
AC_PROG_CXX
 
40
AC_PROG_INSTALL
 
41
AC_PROG_MAKE_SET
 
42
AC_PROG_LN_S
 
43
AC_ISC_POSIX
 
44
AC_PROG_AWK
 
45
 
 
46
# gettext support (must be set here; before libti* dependancy checks)
 
47
ALL_LINGUAS="fr de"
 
48
AM_GNU_GETTEXT
 
49
 
 
50
# find pkg-config
 
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/])
 
54
fi
 
55
 
 
56
# checks for libraries.
 
57
AC_CHECK_LIB(dl, dlopen)
 
58
AC_CHECK_LIB(m, pow)
 
59
AC_CHECK_LIB(jpeg, jpeg_std_error)
 
60
 
 
61
# checks for header files.
 
62
AC_PATH_X
 
63
AC_HEADER_DIRENT
 
64
AC_HEADER_STDC
 
65
AC_HEADER_STAT
 
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)
 
71
 
 
72
# checks for typedefs, structures, and compiler characteristics.
 
73
AC_C_CONST
 
74
AC_TYPE_UID_T
 
75
AC_C_INLINE
 
76
AC_TYPE_MODE_T
 
77
AC_TYPE_OFF_T
 
78
AC_TYPE_SIZE_T
 
79
AC_TYPE_PID_T
 
80
AC_TYPE_SIGNAL
 
81
AC_FUNC_ERROR_AT_LINE
 
82
AC_HEADER_MAJOR
 
83
AC_STRUCT_TM
 
84
 
 
85
# checks for library functions.
 
86
AC_FUNC_ALLOCA
 
87
AC_FUNC_VPRINTF
 
88
AC_FUNC_MALLOC
 
89
AC_FUNC_STAT
 
90
AC_CHECK_FUNCS(getcwd mkdir strstr strtol dup2 getwd memchr memset strrchr pow setlocale strcasecmp strchr)
 
91
 
 
92
# Win32 stuffs
 
93
AC_MSG_CHECKING([for Win32])
 
94
case "$host" in
 
95
  *-*-mingw*)   tilp_native_win32=yes ;;
 
96
  *-*-cygwin)   tilp_native_win32=yes ;;
 
97
  *)            tilp_native_win32=no  ;;
 
98
esac
 
99
AC_MSG_RESULT([$tilp_native_win32])
 
100
AM_CONDITIONAL(OS_WIN32, test "$tilp_native_win32" = "yes")
 
101
 
 
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
 
108
    msnative_struct=''
 
109
    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
 
110
    if test -z "$ac_cv_prog_CC"; then
 
111
      our_gcc="$CC"
 
112
    else
 
113
      our_gcc="$ac_cv_prog_CC"
 
114
    fi
 
115
    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
 
116
      2.)
 
117
        if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
 
118
          msnative_struct='-fnative-struct'
 
119
        fi
 
120
        ;;
 
121
      *)
 
122
        if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
 
123
          msnative_struct='-mms-bitfields'
 
124
        fi
 
125
        ;;
 
126
    esac
 
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])
 
130
    else
 
131
      CFLAGS="$CFLAGS $msnative_struct"
 
132
      AC_MSG_RESULT([${msnative_struct}])
 
133
    fi
 
134
  fi
 
135
fi
 
136
 
 
137
#AC_MINGW32
 
138
#AC_EXEEXT
 
139
 
 
140
case $host in
 
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__" ;;
 
145
esac
 
146
 
 
147
# check for ticables presence
 
148
PKG_CHECK_MODULES(TICABLES, ticables >= 3.8.0)
 
149
AC_SUBST(TICABLES_CFLAGS)
 
150
AC_SUBST(TICABLES_LIBS)
 
151
 
 
152
# check for tifiles presence
 
153
PKG_CHECK_MODULES(TIFILES, tifiles >= 0.5.7)
 
154
AC_SUBST(TIFILES_CFLAGS)
 
155
AC_SUBST(TIFILES_LIBS)
 
156
 
 
157
# check for ticalcs presence
 
158
PKG_CHECK_MODULES(TICALCS, ticalcs >= 4.5.2)
 
159
AC_SUBST(TICALCS_CFLAGS)
 
160
AC_SUBST(TICALCS_LIBS)
 
161
 
 
162
# check for glib presence
 
163
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0)
 
164
AC_SUBST(GLIB_CFLAGS)
 
165
AC_SUBST(GLIB_LIBS)
 
166
 
 
167
# check for gdk-pixbuf presence
 
168
#PKG_CHECK_MODULES(GLIB, gdk_pixbuf-2.0 >= 2.0.0)
 
169
#AC_SUBST(GLIB_CFLAGS)
 
170
#AC_SUBST(GLIB_LIBS)
 
171
 
 
172
# check for gtk presence
 
173
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0)
 
174
AC_SUBST(GTK_CFLAGS)
 
175
AC_SUBST(GTK_LIBS)
 
176
 
 
177
# check for libglade presence
 
178
PKG_CHECK_MODULES(GTK, libglade-2.0 >= 1.99.0)
 
179
AC_SUBST(GTK_CFLAGS)
 
180
AC_SUBST(GTK_LIBS)
 
181
 
 
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"
 
184
 
 
185
# initialize libtool
 
186
AM_DISABLE_STATIC
 
187
AC_LIBTOOL_WIN32_DLL
 
188
AM_PROG_LIBTOOL
 
189
AC_PROG_LIBTOOL
 
190
 
 
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)
 
202
 
 
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)
 
205
 
 
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)
 
210
  AC_MSG_RESULT(yes)
 
211
else
 
212
  AC_MSG_RESULT(no)
 
213
fi
 
214
 
 
215
locale_dir='${prefix}/share/locale'
 
216
AC_SUBST(locale_dir)
 
217
 
 
218
# some extra flags
 
219
CFLAGS="$CFLAGS $ARCH -Wall"
 
220
LDFLAGS="$LDFLAGS $INTLLIBS -g"
 
221
 
 
222
# pass flags
 
223
AC_SUBST(CFLAGS)
 
224
AC_SUBST(LDFLAGS)
 
225
 
 
226
AC_OUTPUT([Makefile
 
227
build/Makefile
 
228
desktop/Makefile
 
229
glade/Makefile
 
230
help/Makefile
 
231
icons/Makefile
 
232
man/Makefile
 
233
misc/Makefile
 
234
pixmaps/Makefile
 
235
registry/Makefile
 
236
src/Makefile
 
237
plugins/Makefile
 
238
plugins/test/Makefile
 
239
plugins/nv82/Makefile
 
240
plugins/gfv/Makefile
 
241
tilp.lsm
 
242
tilp.spec
 
243
intl/Makefile
 
244
po/Makefile.in
 
245
])
 
246
 
 
247
if test "x$enable_exit_homedir" = "xno"; then
 
248
 echo ;
 
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 !" ;
 
253
else
 
254
 echo ;
 
255
 echo "The 'exit HOME dir' facility is now enabled as default behaviour. "
 
256
 echo "Please keep in mind tha this is not secure..." ;
 
257
fi
 
258
 
 
259
echo ;
 
260
 
 
261
 
 
262
 
 
263
 
 
264
 
 
265
 
 
266
 
 
267
 
 
268