~ubuntu-branches/ubuntu/breezy/tiemu/breezy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2005-06-02 16:50:15 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050602165015-59ab24414tl2wzol
Tags: 1.99+svn1460-1
* New snapshot.
* debian/control:
  + Updated build-depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl Process this file with autoconf to produce a configure script.
 
2
dnl $Id: configure.in 409 2004-06-07 21:10:20Z roms $
2
3
 
3
 
dnl Process this file with autoconf to produce a configure script.
4
 
AC_INIT(src/hid/ticalc.c)
 
4
dnl Init.
5
5
AC_PREREQ(2.57)
6
 
 
7
 
dnl Propagate some vars in sub-Makefile
8
 
VERSION=1.65
9
 
PACKAGE=tiemu
10
 
AC_SUBST(VERSION)
11
 
AC_SUBST(PACKAGE)
12
 
 
13
 
dnl Determine the system type
14
 
AC_CANONICAL_SYSTEM
15
 
dnl Determine the host type
16
 
dnl AC_CANONICAL_HOST
17
 
 
 
6
AC_INIT(TiEmu, 2.00-rc2, [tiemu-users@lists.sourceforge.net])
 
7
 
 
8
AM_INIT_AUTOMAKE([dist-bzip2])
18
9
AM_MAINTAINER_MODE
19
10
 
20
 
dnl Initialize libtool
21
 
AM_PROG_LIBTOOL
22
 
 
23
 
dnl Change the default prefix (/usr/local) to /usr
24
 
AC_PREFIX_DEFAULT('/usr')
25
 
 
26
 
dnl Create the config.h file and set version & package name
27
 
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
28
 
AM_CONFIG_HEADER(config.h)
29
 
 
30
 
dnl Substitue the options variable
31
 
dnl AC_SUBST_FILE(options)
32
 
dnl options="-DGTK -DVERBOSE"
33
 
 
34
 
dnl Build time sanity check...
35
 
AM_SANITY_CHECK
36
 
 
37
 
dnl Just for fun :)
38
 
echo -n "checking for something to drink while compiling..."
39
 
echo " err: no fridge found"
40
 
 
41
 
dnl Checks for programs.
42
 
dnl AC_ARG_PROGRAM
 
11
AC_PREFIX_DEFAULT(/usr/local)
 
12
 
 
13
dnl Files to configure.
 
14
AC_CONFIG_SRCDIR([src/gui/main.c])
 
15
AC_CONFIG_HEADERS([config.h])
 
16
AC_CONFIG_FILES([
 
17
  Makefile
 
18
  build/Makefile
 
19
  glade/Makefile
 
20
  help/Makefile
 
21
  man/Makefile
 
22
  pedrom/Makefile
 
23
  pixmaps/Makefile
 
24
  skins/Makefile
 
25
  src/Makefile
 
26
  tiemu.lsm
 
27
  tiemu.spec
 
28
])
 
29
 
 
30
AC_MSG_CHECKING([for something to drink while compiling])
 
31
AC_MSG_RESULT([err: no fridge found!])
 
32
 
 
33
# Setup libtool.
 
34
AC_DISABLE_STATIC
 
35
AC_LIBTOOL_WIN32_DLL
 
36
AC_PROG_LIBTOOL
 
37
 
 
38
# Checks for programs.
43
39
AC_PROG_CC
44
40
AC_PROG_INSTALL
45
41
AC_PROG_MAKE_SET
46
42
AC_PROG_LN_S
47
43
AC_ISC_POSIX
48
 
AC_PROG_LIBTOOL
49
 
 
50
 
dnl Checks for header files.
51
 
AC_PATH_X
52
 
AC_HEADER_DIRENT
53
 
AC_HEADER_STDC
54
 
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/time.h unistd.h \
55
 
        alloca.h errno.h libintl.h sys/timeb.h)
56
 
AC_CHECK_HEADERS(jpeglib.h)
57
 
AC_CHECK_HEADERS(pthread.h SDL/SDL.h)
58
 
AC_CHECK_HEADERS(stdint.h)
59
 
AC_CHECK_HEADERS(tilp/cabl_int.h tilp/cabl_def.h tilp/typedefs.h tilp/export.h)
60
 
AC_CHECK_HEADERS(tilp/file_int.h tilp/file_def.h tilp/macros.h)
61
 
AC_CHECK_HEADERS(tilp/calc_int.h tilp/calc_def.h)
62
 
 
63
 
AM_PATH_SDL(1.2.0)
64
 
 
65
 
dnl Checks for libraries.
66
 
AC_CHECK_LIB(glib, main)
67
 
AC_CHECK_LIB(m, pow)
68
 
AC_CHECK_LIB(ticables, ticable_get_version)
69
 
AC_CHECK_LIB(tifiles, tifiles_get_version)
70
 
AC_CHECK_LIB(ticalcs, ticalc_get_version)
71
 
AC_CHECK_LIB(jpeg, jpeg_destroy_compress)
72
 
AC_CHECK_LIB(pthread, pthread_create) dnl needed by SDL
73
 
AC_CHECK_LIB(SDL, SDL_Init)
74
 
 
75
 
PKG_CHECK_MODULES(TICABLES, ticables >= 3.8.0)
 
44
AC_CHECK_PROG(GROFF, groff, yes, no)
 
45
AM_CONDITIONAL(USE_GROFF, test "$GROFF" != "no")
 
46
 
 
47
# Checks for libraries.
 
48
AM_GNU_GETTEXT
 
49
AM_GNU_GETTEXT_VERSION(0.13.1)
 
50
 
 
51
PKG_CHECK_MODULES(TICABLES, ticables >= 3.9.1)
76
52
AC_SUBST(TICABLES_CFLAGS)
77
53
AC_SUBST(TICABLES_LIBS)
78
54
 
79
 
PKG_CHECK_MODULES(TIFILES, tifiles >= 0.6.1)
 
55
PKG_CHECK_MODULES(TIFILES, tifiles >= 0.6.4)
80
56
AC_SUBST(TIFILES_CFLAGS)
81
57
AC_SUBST(TIFILES_LIBS)
82
58
 
83
 
PKG_CHECK_MODULES(TICALCS, ticalcs >= 4.5.4)
 
59
PKG_CHECK_MODULES(TICALCS, ticalcs >= 4.5.9)
84
60
AC_SUBST(TICALCS_CFLAGS)
85
61
AC_SUBST(TICALCS_LIBS)
86
62
 
87
 
dnl Checks for gtk-config
88
 
AC_CHECK_PROG(GTK_CONFIG, gtk-config, yes, no)
89
 
if test "$GTK_CONFIG" = "no"; then
90
 
        echo ;
91
 
        echo "Error: cannot find gtk-config. Do you have gtk installed ?";
92
 
        echo "You can download it from ftp://ftp.gtk.org/pub/gtk/v1.2";
93
 
        echo "Make sure to also download the same version" ;
94
 
        echo "of glib too from that same directory" ;
95
 
        echo ;
96
 
        exit
97
 
else
98
 
        GTK_LIBS=`gtk-config --libs`
99
 
        GTK_CFLAGS=`gtk-config --cflags`
100
 
        GTK_VERSION=`gtk-config --version`
101
 
 
102
 
        LIBS="$LIBS $GTK_LIBS"
103
 
        CFLAGS="$CFLAGS $GTK_CFLAGS"
104
 
fi
105
 
 
106
 
CFLAGS="$CFLAGS"
107
 
AC_SUBST(CFLAGS)
108
 
 
109
 
dnl Make sure we are using gtk+ 1.1.x or higher
110
 
AC_MSG_CHECKING(version of gtk+...)
111
 
gtk_maj_rev=`echo $GTK_VERSION | cut -f1-2 -d.`
112
 
if test "$gtk_maj_rev" = "1.2" ; then
113
 
   AC_MSG_RESULT(($GTK_VERSION))
114
 
else
115
 
   AC_MSG_RESULT(($GTK_VERSION))
116
 
   if test "$gtk_maj_rev" = "1.1" ; then
117
 
        AC_WARN(You have gtk+ 1.1 installed on your machine. I would)
118
 
        AC_WARN(recommend upgrading to the stable 1.2 series)
119
 
        AC_WARN(You can download it from ftp://ftp.gtk.org/pub/gtk/v1.2)
120
 
        AC_WARN(Make sure to also download the same version of glib too)
121
 
   else
122
 
        echo ;
123
 
        echo "Error: You need gtk+ 1.1.x or higher to install tilp. You can download it from" ;
124
 
        echo "ftp://ftp.gtk.org/pub/gtk/v1.2 I would recommend downloading the stable 1.2" ;
125
 
        echo "series. Make sure to also download the same version of glib too from that same" ;
126
 
        echo "directory" ;
127
 
        echo ;
128
 
        exit
129
 
   fi
130
 
fi
131
 
 
132
 
CFLAGS="$CFLAGS"
133
 
AC_SUBST(CFLAGS)
134
 
 
135
 
dnl Checks for typedefs, structures, and compiler characteristics.
136
 
AC_C_CONST
137
 
AC_C_INLINE
138
 
AC_TYPE_SIZE_T
139
 
AC_HEADER_TIME
140
 
AC_FUNC_MALLOC
141
 
AC_FUNC_MEMCMP
142
 
AC_HEADER_DIRENT
143
 
AC_FUNC_STAT
144
 
AC_TYPE_MODE_T
145
 
AC_TYPE_UID_T
146
 
 
147
 
dnl Checks for library functions.
148
 
AC_FUNC_ALLOCA
149
 
AC_FUNC_MEMCMP
150
 
AC_FUNC_MMAP
151
 
AC_FUNC_MALLOC
152
 
AC_FUNC_STAT
153
 
AC_TYPE_MODE_T
154
 
AC_TYPE_UID_T
155
 
AC_STRUCT_TM
156
 
AC_CHECK_FUNCS(getcwd getwd putenv strdup strstr strtol atexit ftime memchr memset strrchr mkdir pow)
157
 
 
158
 
dnl Internationalization (i18n)
159
 
ALL_LINGUAS="fr de it es nl"
160
 
AM_GNU_GETTEXT
161
 
 
162
 
dnl Pass locale directory
163
 
PACKAGE_LOCALE_DIR=${datadir}/locale
164
 
AC_SUBST(PACKAGE_LOCALE_DIR)
165
 
 
166
 
dnl Define a macro according to the system type
167
 
case "$target" in
168
 
  i[[34]]86-*-linux-*) ARCH="-D__I386__ -D__LINUX__" ;;
169
 
  i[[56]]86-*-linux-*) ARCH="-O3 -mcpu=pentium -DPENT_COUNTER -DX86_ASSEMBLY -D__LINUX__" ;;
170
 
  sparc-*-linux-*) ARCH="-D__SPARC__ -D__LINUX__" ;;
171
 
  sparc*-sun-solaris*) ARCH="-D__SPARC__ -D__SOL__" ;; dnl sparc-sun-solaris2.7
172
 
  alpha*-*-*-*) ARCH="-D__ALPHA__ -D__LINUX__" ;;
173
 
  arm*-*-linux-*) ARCH="-D__ARM__ -D__LINUX__" ;;
174
 
  hppa*-*-linux-*) ARCH="-D__LINUX__" ;;
175
 
  parisc*-*-linux-*) ARCH="-D__LINUX__" ;;
176
 
  ia64-*-linux-*) ARCH="-D__LINUX__" ;;
177
 
  m68k-*-linux-*) ARCH="-D__M68K__ -D__LINUX__" ;;
178
 
  mips-*-linux-*) ARCH="-D__MIPS__ -D__LINUX__" ;;
179
 
  mipsel-*-linux-*) ARCH="-D__MIPS__ -D__LINUX__" ;;
180
 
  powerpc-*-linux-*) ARCH="-D__PPC__ -D__LINUX__" ;;
181
 
  s390-*-linux-*) ARCH="-D__LINUX__" ;;
182
 
  sh-*-linux-*) ARCH="-D__LINUX__" ;;
183
 
esac
184
 
 
185
 
CFLAGS="$CFLAGS $ARCH -Wall -DDEBUGGER"
186
 
AC_SUBST(CFLAGS)
187
 
 
188
 
AC_OUTPUT([Makefile help/Makefile intl/Makefile man/Makefile \
189
 
        misc/Makefile pixmaps/Makefile po/Makefile.in ROMs/Makefile \
190
 
        skins/Makefile src/Makefile win32/Makefile \
191
 
        tiemu.lsm tiemu.spec])
192
 
 
193
 
dnl AC_OUTPUT([man/Makefile])
194
 
 
195
 
echo
196
 
echo To run the TiEmu emulator, you need a ROM dump. As this file is
197
 
echo copyrighted by Texas Instruments it will never be distributed with
198
 
echo the emulator.
199
 
echo
200
 
echo If you already have some ROMs, place them in the ./ROMs directory
201
 
echo so that they can be installed with TiEmu.
202
 
echo It you have no ROM, you can get a ROM image of your calculator
203
 
echo with the "ROM dump" function of TiLP.
204
 
echo TiLP is available at [http://lpg.ticalc.org/prj_tilp].
205
 
echo
206
 
echo Now, you can type 'make' and 'make install'
 
63
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.4.0)
 
64
AC_SUBST(GLIB_CFLAGS)
 
65
AC_SUBST(GLIB_LIBS)
 
66
 
 
67
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0)
 
68
AC_SUBST(GTK_CFLAGS)
 
69
AC_SUBST(GTK_LIBS)
 
70
 
 
71
PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.4.0)
 
72
AC_SUBST(GLADE_CFLAGS)
 
73
AC_SUBST(GLADE_LIBS)
 
74
 
 
75
# Checks for header files.
 
76
AC_HEADER_STDBOOL
 
77
AC_CHECK_HEADERS([fcntl.h])
 
78
AC_CHECK_HEADERS([libintl.h])
 
79
AC_CHECK_HEADERS([sys/timeb.h])
 
80
AC_CHECK_HEADERS(stdint.h)
 
81
 
 
82
# Checks for typedefs, structures, and compiler characteristics.
 
83
AC_FUNC_MEMCMP
 
84
#AC_C_RESTRICT
 
85
AC_C_VOLATILE
 
86
 
 
87
# Checks for libraries.
 
88
AC_CHECK_LIB(m, pow)
 
89
AC_CHECK_LIB(pthread, pthread_create) dnl needed by GThread
 
90
#AC_CHECK_LIB(comdlg32, GetOpenFileName)
 
91
 
 
92
# Check for zlib
 
93
AC_CHECK_HEADER(zlib.h,[
 
94
        AC_CHECK_LIB(z, compress,,)
 
95
],)
 
96
LIBZ="$LIBS"
 
97
LIBS=""
 
98
AC_SUBST(LIBZ)
 
99
 
 
100
# Checks for library functions.
 
101
AC_FUNC_SELECT_ARGTYPES
 
102
AC_FUNC_STAT 
 
103
AC_FUNC_VPRINTF
 
104
AC_CHECK_FUNCS([bzero ftime memset mkdir select strchr strrchr strstr])
 
105
 
 
106
# Platform specific tests.
 
107
dnl AC_CANONICAL_HOST
 
108
case $host in
 
109
  *-*-mingw*)            ARCH="-D__WIN32__ -D__MINGW32__ -mwindows -D_WINDOWS" ;;
 
110
  *-*-*bsd*)             ARCH="-D__BSD__" ;;
 
111
  i[[3456]]86-*-linux-*) ARCH="-D__I386__ -D__LINUX__" ;; 
 
112
  arm*-*-linux-*)        ARCH="-D__IPAQ__ -D__LINUX__" ;;
 
113
  powerpc-*-linux-*)     ARCH="-D__PPC__  -D__LINUX__" ;;
 
114
  powerpc-apple-darwin*) ARCH="-D__PPC__  -D__MACOSX__" ;;
 
115
  *)                     ARCH="-D__LINUX__" ;;
 
116
esac
 
117
CFLAGS="$CFLAGS $ARCH"
 
118
 
 
119
# KDE dialogs support
 
120
AC_ARG_WITH(kde, AC_HELP_STRING([--with-kde], [Compile with KDE support]), [kde=$withval], [kde=no])
 
121
if test "x$kde" = "xyes"; then
 
122
        AC_PROG_CXX
 
123
        AC_PATH_KDE
 
124
        AC_DEFINE(WITH_KDE, 1, [Use KDE support])
 
125
fi
 
126
AC_SUBST(kde)
 
127
 
 
128
# Ensure MSVC-compatible struct packing convention is used when
 
129
# compiling for Win32 with gcc.
 
130
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
 
131
# gcc2 uses "-fnative-struct".
 
132
case $host_os in
 
133
*mingw*|*cygwin*)
 
134
  if test x$GCC = xyes; then
 
135
    msnative_struct=''
 
136
    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
 
137
    if test -z "$ac_cv_prog_CC"; then
 
138
      our_gcc="$CC"
 
139
    else
 
140
      our_gcc="$ac_cv_prog_CC"
 
141
    fi
 
142
    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
 
143
      2.)
 
144
        if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
 
145
          msnative_struct='-fnative-struct'
 
146
        fi
 
147
        ;;
 
148
      *)
 
149
        if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
 
150
          msnative_struct='-mms-bitfields'
 
151
        fi
 
152
        ;;
 
153
    esac
 
154
    if test x"$msnative_struct" = x ; then
 
155
      AC_MSG_RESULT([no way])
 
156
      AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
 
157
    else
 
158
      CFLAGS="$CFLAGS $msnative_struct"
 
159
      AC_MSG_RESULT([${msnative_struct}])
 
160
    fi
 
161
  fi
 
162
  ;;
 
163
esac
 
164
 
 
165
#AM_CONDITIONAL(OS_WIN32, test "$msnative_struct")
 
166
 
 
167
# some extra flags
 
168
CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED -DDEBUGGER"
 
169
LDFLAGS="$LDFLAGS"
 
170
CXXFLAGS="$CFLAGS -fno-rtti -fno-exceptions"
 
171
 
 
172
AC_SUBST(CFLAGS)
 
173
AC_SUBST(LDFLAGS)
 
174
AC_SUBST(CXXFLAGS)
 
175
 
 
176
# Output.
 
177
AC_OUTPUT
 
178
 
 
179
echo
 
180
echo "To run the TiEmu emulator, you will need a ROM dump. As those files are"
 
181
echo "copyrighted by Texas Instruments, they will never be distributed with"
 
182
echo "the emulator... In replacement, you can use PedRom which is provided"
 
183
echo "with TiEmu."
 
184
echo
 
185
echo "It you have no ROM, you can get an ROM dump of your calculator"
 
186
echo "with the 'ROM dump' function of TiLP."
 
187
echo "Otherwise, you can use a TI's FLASH OS upgrade (AMS) as image."
 
188
echo
 
189
echo "Note: TiLP is available at [http://lpg.ticalc.org/prj_tilp]."
 
190
echo
 
191
echo "Now, you can type 'make' and 'make install'"
207
192
echo ;
208
193