[go: up one dir, main page]

File: configure.in

package info (click to toggle)
thoughttracker 0.5.6-11
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,392 kB
  • ctags: 977
  • sloc: cpp: 4,449; sh: 2,646; ansic: 2,262; makefile: 255; sed: 93
file content (156 lines) | stat: -rw-r--r-- 3,435 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
dnl Process this file with autoconf to produce a configure script.

AC_INIT(configure.in)
AM_INIT_AUTOMAKE(thoughttracker, 0.5.6)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_ISC_POSIX

dnl i18n support
dnl (running this with AC_LANG_CPLUSPLUS results i.a. const, inline checks to
dnl  fail, so we do it here)
ALL_LINGUAS="de fr"
AM_GNU_GETTEXT
AC_OUTPUT_COMMANDS([sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile])

dnl set PACKAGE_LOCALE_DIR in config.h
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
else
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
fi

dnl check for C headers and functions; note that AM_GNU_GETTEXT already checks
dnl for a whole bunch of such, so we don't repeat that here
AC_FUNC_STRCOLL

AC_PROG_CXX
AC_LANG_CPLUSPLUS

dnl check for GTKMM
AM_PATH_GTKMM(1.1.6,
  [LIBS="$LIBS $GTKMM_LIBS" CXXFLAGS="$CXXFLAGS $GTKMM_CFLAGS"],
  AC_MSG_ERROR(The GTK-- library wasn't found.))

dnl check for gdbm
AC_CHECK_LIB(gdbm, main, AC_DEFINE(HAVE_GDBM),
    AC_MSG_ERROR(The gdbm library wasn't found.))

AC_CHECK_LIB(ife, sense)

dnl extended C++ checks borrowed from GTK--'s configure.in
AC_MSG_CHECKING(if C++ compiler supports namespaces)
AC_TRY_COMPILE(
[   
#include <iostream>
namespace std{}
using namespace std;
],[ 
cout << "test" << endl;
],[
 ac_namespaces=yes
 AC_DEFINE(HAVE_NAMESPACES)
],[
 ac_namespaces=maybe
])
AC_MSG_RESULT([$ac_namespaces])


if test "x$ac_namespaces" = xmaybe ; then
AC_MSG_CHECKING(if C++ has namespaces - 2nd try)
AC_TRY_COMPILE(
[
#include <iostream.h>
namespace std{}
using namespace std;
],[
cout << "test" << endl;
],[
 ac_namespaces=yes
 AC_DEFINE(HAVE_NAMESPACES)
],[
 ac_namespaces=no
])
AC_MSG_RESULT([$ac_namespaces])
fi
if test x$ac_namespaces != xyes; then
  AC_MSG_ERROR(Your C++ compiler doesn't support namespaces.)
fi

AC_MSG_CHECKING(if C++ environment has working string class)
AC_TRY_LINK(
[
#include <string>
using namespace std;
  class foo {
  public:
    void f(const string &s);
  };
  void foo::f(const string &s) {
    f(s.c_str());
  }
],[
   foo f1;
   f1.f("test");
],[
  string_ok=yes
],[
  string_ok=no
])
AC_MSG_RESULT([$string_ok])
if test x$string_ok != xyes; then
  AC_MSG_ERROR(Your C++ environment doesn't provide a working string class.)
fi

AC_MSG_CHECKING(if C++ compiler supports bool)
AC_TRY_COMPILE(
[
],[
   bool b=true;
   bool b1=false;
],[
  ac_bool=yes
],[
  config_error=yes
  AC_WARN(bool type is not supported by your compiler)
]) 
AC_MSG_RESULT([$ac_bool])
if test x$ac_bool = xyes; then
  AC_DEFINE(HAVE_BOOL)
fi

dnl additional compile flags when using gcc
if test x"$GXX" = xyes; then
  CXXFLAGS="$CXXFLAGS -Wall -ansi"
fi

dnl enable debugging?
AC_ARG_ENABLE(debug,
[  --enable-debug          enable debugging output],
[case "${enableval}" in
	yes) debug=true ;;
	no)  debug=false ;;
	*) AC_MSG_ERROR(Bad value ${enableval} for --enable-debug.) ;;
esac], [debug=false])

if test x"$debug" = xtrue; then
  if test x"$GXX" = xyes; then
    # adding -pedantic causes linking errors with respect to SigC::bind
    # with EGCS 2.95.2
    CXXFLAGS="$CXXFLAGS"
  fi
  AC_DEFINE(ENABLE_DEBUG)
fi
# -g produces HUGE object files (and executables) with GTK--
CXXFLAGS=`echo "$CXXFLAGS"|sed 's/\(^\| \)-g\($\| \)/ /g'`

AC_OUTPUT([
Makefile
src/Makefile
intl/Makefile
po/Makefile.in
man/Makefile
thoughttracker.spec
])