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 $
3
dnl Process this file with autoconf to produce a configure script.
4
AC_INIT(src/hid/ticalc.c)
7
dnl Propagate some vars in sub-Makefile
13
dnl Determine the system type
15
dnl Determine the host type
6
AC_INIT(TiEmu, 2.00-rc2, [tiemu-users@lists.sourceforge.net])
8
AM_INIT_AUTOMAKE([dist-bzip2])
20
dnl Initialize libtool
23
dnl Change the default prefix (/usr/local) to /usr
24
AC_PREFIX_DEFAULT('/usr')
26
dnl Create the config.h file and set version & package name
27
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
28
AM_CONFIG_HEADER(config.h)
30
dnl Substitue the options variable
31
dnl AC_SUBST_FILE(options)
32
dnl options="-DGTK -DVERBOSE"
34
dnl Build time sanity check...
38
echo -n "checking for something to drink while compiling..."
39
echo " err: no fridge found"
41
dnl Checks for programs.
11
AC_PREFIX_DEFAULT(/usr/local)
13
dnl Files to configure.
14
AC_CONFIG_SRCDIR([src/gui/main.c])
15
AC_CONFIG_HEADERS([config.h])
30
AC_MSG_CHECKING([for something to drink while compiling])
31
AC_MSG_RESULT([err: no fridge found!])
38
# Checks for programs.
50
dnl Checks for header files.
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)
65
dnl Checks for libraries.
66
AC_CHECK_LIB(glib, main)
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)
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")
47
# Checks for libraries.
49
AM_GNU_GETTEXT_VERSION(0.13.1)
51
PKG_CHECK_MODULES(TICABLES, ticables >= 3.9.1)
76
52
AC_SUBST(TICABLES_CFLAGS)
77
53
AC_SUBST(TICABLES_LIBS)
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)
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)
87
dnl Checks for gtk-config
88
AC_CHECK_PROG(GTK_CONFIG, gtk-config, yes, no)
89
if test "$GTK_CONFIG" = "no"; then
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" ;
98
GTK_LIBS=`gtk-config --libs`
99
GTK_CFLAGS=`gtk-config --cflags`
100
GTK_VERSION=`gtk-config --version`
102
LIBS="$LIBS $GTK_LIBS"
103
CFLAGS="$CFLAGS $GTK_CFLAGS"
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))
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)
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" ;
135
dnl Checks for typedefs, structures, and compiler characteristics.
147
dnl Checks for library functions.
156
AC_CHECK_FUNCS(getcwd getwd putenv strdup strstr strtol atexit ftime memchr memset strrchr mkdir pow)
158
dnl Internationalization (i18n)
159
ALL_LINGUAS="fr de it es nl"
162
dnl Pass locale directory
163
PACKAGE_LOCALE_DIR=${datadir}/locale
164
AC_SUBST(PACKAGE_LOCALE_DIR)
166
dnl Define a macro according to the system type
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__" ;;
185
CFLAGS="$CFLAGS $ARCH -Wall -DDEBUGGER"
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])
193
dnl AC_OUTPUT([man/Makefile])
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
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].
206
echo Now, you can type 'make' and 'make install'
63
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.4.0)
67
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0)
71
PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.4.0)
72
AC_SUBST(GLADE_CFLAGS)
75
# Checks for header files.
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)
82
# Checks for typedefs, structures, and compiler characteristics.
87
# Checks for libraries.
89
AC_CHECK_LIB(pthread, pthread_create) dnl needed by GThread
90
#AC_CHECK_LIB(comdlg32, GetOpenFileName)
93
AC_CHECK_HEADER(zlib.h,[
94
AC_CHECK_LIB(z, compress,,)
100
# Checks for library functions.
101
AC_FUNC_SELECT_ARGTYPES
104
AC_CHECK_FUNCS([bzero ftime memset mkdir select strchr strrchr strstr])
106
# Platform specific tests.
107
dnl AC_CANONICAL_HOST
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__" ;;
117
CFLAGS="$CFLAGS $ARCH"
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
124
AC_DEFINE(WITH_KDE, 1, [Use KDE support])
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".
134
if test x$GCC = xyes; then
136
AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
137
if test -z "$ac_cv_prog_CC"; then
140
our_gcc="$ac_cv_prog_CC"
142
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
144
if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
145
msnative_struct='-fnative-struct'
149
if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
150
msnative_struct='-mms-bitfields'
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])
158
CFLAGS="$CFLAGS $msnative_struct"
159
AC_MSG_RESULT([${msnative_struct}])
165
#AM_CONDITIONAL(OS_WIN32, test "$msnative_struct")
168
CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED -DDEBUGGER"
170
CXXFLAGS="$CFLAGS -fno-rtti -fno-exceptions"
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"
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."
189
echo "Note: TiLP is available at [http://lpg.ticalc.org/prj_tilp]."
191
echo "Now, you can type 'make' and 'make install'"