1dnl    This file is part of the KDE libraries/packages
2dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
3dnl                       modified by Walter Tasin (tasin@kdevelop.org)
4dnl                       for c++ console applications
5
6dnl    This file is free software; you can redistribute it and/or
7dnl    modify it under the terms of the GNU Library General Public
8dnl    License as published by the Free Software Foundation; either
9dnl    version 2 of the License, or (at your option) any later version.
10
11dnl    This library is distributed in the hope that it will be useful,
12dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
13dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14dnl    Library General Public License for more details.
15
16dnl    You should have received a copy of the GNU Library General Public License
17dnl    along with this library; see the file COPYING.LIB.  If not, write to
18dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19dnl    Boston, MA 02111-1307, USA.
20
21# Original Author was Kalle@kde.org
22# I lifted it in some mater. (Stephan Kulow)
23# I used much code from Janos Farkas
24
25dnl Process this file with autoconf to produce a configure script.
26
27AC_INIT(acinclude.m4) dnl a source file from your sub dir
28
29dnl This is so we can use kde-common
30AC_CONFIG_AUX_DIR(admin)
31
32dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
33unset CDPATH
34
35dnl Checking host/target/build systems, for make, install etc.
36AC_CANONICAL_SYSTEM
37dnl Perform program name transformation
38AC_ARG_PROGRAM
39
40dnl Automake doc recommends to do this only here. (Janos)
41AM_INIT_AUTOMAKE(apricots,0.2.6)
42
43dnl almost the same like KDE_SET_PEFIX but the path is /usr/local
44dnl
45unset CDPATH
46dnl make /usr/local the default for the installation
47AC_PREFIX_DEFAULT(/usr/local)
48
49if test "x$prefix" = "xNONE"; then
50  prefix=$ac_default_prefix
51  ac_configure_args="$ac_configure_args --prefix $prefix"
52fi
53KDE_FAST_CONFIGURE
54KDE_CONF_FILES
55
56dnl without this order in this file, automake will be confused!
57dnl
58AM_CONFIG_HEADER(config.h)
59
60dnl checks for programs.
61dnl first check for c/c++ compilers
62AC_CHECK_COMPILERS
63
64dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
65dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
66dnl CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
67
68dnl create only shared libtool-libraries
69AC_ENABLE_SHARED(yes)
70
71dnl set the following to yes, if you want to create static
72dnl libtool-libraries, too.
73AC_ENABLE_STATIC(no)
74
75dnl create a working libtool-script
76KDE_PROG_LIBTOOL
77
78dnl activate the next macro call for DLOPEN tests and setting LIBDL
79dnl   (n.b. KDE_MISC_TESTS does the same to you, so use either this or the next one)
80dnl KDE_CHECK_DLOPEN
81
82dnl activate the next macro call for some additional tests
83dnl   (compat, crypt, socket, nsl, dlopen, ...)
84dnl KDE_MISC_TESTS dnl __kdevelop__
85
86dnl KDE_NEED_FLEX dnl __kdevelop__
87dnl AC_PROG_YACC dnl __kdevelop__
88
89dnl Check for SDL
90SDL_VERSION=1.2.0
91AM_PATH_SDL($SDL_VERSION,
92         :,
93         AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
94)
95CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
96LIBS="$LIBS $SDL_LIBS"
97
98dnl Set up the AP_PATH data path for the application
99CXXFLAGS="$CXXFLAGS -DAP_PATH=\\\"$prefix/share/apricots/\\\""
100
101dnl Check for OpenAL
102AC_CHECK_HEADER(AL/al.h,[CXXFLAGS="$CXXFLAGS -DAP_AUDIO_OPENAL"])
103AC_CHECK_LIB( openal, alutInit)
104
105KDE_CHECK_EXTRA_LIBS
106all_libraries="$all_libraries $USER_LDFLAGS"
107all_includes="$all_includes $USER_INCLUDES"
108AC_SUBST(all_includes)
109AC_SUBST(all_libraries)
110
111AC_SUBST(AUTODIRS)
112
113KDE_CREATE_SUBDIRSLIST
114AC_CONFIG_FILES([ Makefile ])
115AC_CONFIG_FILES([ apricots/Makefile ])
116AC_CONFIG_FILES([ apricots/docs/Makefile ])
117AC_CONFIG_FILES([ apricots/docs/en/Makefile ])
118AC_OUTPUT
119if test "$all_tests" = "bad"; then
120  if test ! "$cache_file" = "/dev/null"; then
121    echo ""
122    echo "Please remove the file $cache_file after changing your setup"
123    echo "so that configure will find the changes next time."
124    echo ""
125  fi
126else
127  echo ""
128  echo "Good - your configure finished. Start make now"
129  echo ""
130fi
131