summaryrefslogtreecommitdiffstats
path: root/configure.in.in
blob: 0c34f736b4c27a9c2cd6dd715a3064d04831eae0 (plain)
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
#MIN_CONFIG

# Check for ECMA-335 image loader.

AC_DEFUN([KDE_CHECK_CLI],[
	AC_ARG_WITH(cli, [  --with-cli=FILE         ECMA 335 PE image loader is FILE ],
	[
		AC_MSG_CHECKING(for CLI image loader)

		if test -x "$with_cli"
		then
			CLI="$with_cli"
			AC_MSG_RESULT($CLI)
		fi
	],
	[
		AC_PATH_PROG(CLI, mono, [], $PATH:/usr/local/bin)

		if test -z "$CLI"
		then
			AC_PATH_PROG(CLI, ilrun, [], $PATH:/usr/local/bin)
		fi

		if test -z "$CLI"
		then
			AC_PATH_PROG(CLI, clix, [], $PATH:/usr/local/bin)
		fi
	])

	AC_SUBST(CLI)
])

# Pick a C# compiler.

# Check for Portable.NET's C# compiler

AC_DEFUN([KDE_CHECK_CSCC],[
	AC_ARG_WITH(cscc, [  --with-cscc=FILE        cscc executable is FILE ],
	[
		AC_MSG_CHECKING(for $with_cscc)

		if test -x $with_cscc
		then
			AC_MSG_RESULT(found)
			cscc="$with_cscc"
		else
			AC_MSG_RESULT(no)
		fi
	],
	[
		AC_PATH_PROG(cscc, cscc, [], $PATH:/usr/local/bin)
	])
])

# Check for Microsoft's C# compiler

AC_DEFUN([KDE_CHECK_CSC],[
	AC_ARG_WITH(csc, [  --with-csc=FILE         csc executable is FILE ],
	[
		AC_MSG_CHECKING(for $with_csc)

		if test -x $with_csc
		then
			AC_MSG_RESULT(found)
			csc="$with_csc"
		else
			AC_MSG_RESULT(no)
		fi
	],
	[
		AC_PATH_PROG(csc, csc.exe, [], $PATH:/usr/local/bin)

		if test -z "$csc"
		then
			AC_PATH_PROG(csc, csc, [], $PATH:/usr/local/bin)
		fi
	])
])

# Check for Mono's C# compiler

AC_DEFUN([KDE_CHECK_MCS],[
	dnl AC_RETQUIRE(KDE_CHECK_CLI)
	AC_ARG_WITH(mcs, [  --with-mcs=FILE         mcs executable is FILE ],
	[
		AC_MSG_CHECKING(for $with_mcs)

		if test -f $with_mcs
		then
			AC_MSG_RESULT(found)
			mcs="$with_mcs"
		else
			AC_MSG_RESULT(no)
		fi
	],
	[
		AC_PATH_PROG(mcs, mcs, [], $PATH:/usr/local/bin)

		if test -z "$mcs"
		then
			AC_PATH_PROG(mcs, mcs.exe, [], $PATH:/usr/local/bin)
		fi
	])

])

AM_PATH_GLIB([1.2.6])
AM_PATH_GTK([1.2.6])

# check for CSANT compiler

AC_DEFUN([KDE_CHECK_CSANT],[
])

# Pick one of the available C# compilers.

AC_DEFUN([KDE_CHECK_CS_COMPILER],[
	KDE_CHECK_CSANT
	KDE_CHECK_CSCC
	KDE_CHECK_CSC
	KDE_CHECK_MCS

	AC_MSG_CHECKING(for c-sharp compiler)

	AC_ARG_WITH(cs-compiler, [  --with-cs-compiler=NAME mcs, cscc, or csc ],
	[
		if test "$with_cs_compiler" = "cscc"
		then
			CSC="$cscc"
			CSC_NAME="cscc"
		fi

		if test "$with_cs_compiler" = "csc"
		then
			CSC="$csc"
			CSC_NAME="csc"
		fi

		if test "$with_cs_compiler" = "mcs"
		then
			CSC="$mono"
			CSC_NAME="mcs"
		fi

		if test -z "$CSC_NAME"
		then
			AC_MSG_RESULT(no)
			echo "ERROR: Unknown C# compiler: $with_cs_compiler"
			exit
		else
			AC_MSG_RESULT($CSC_NAME)
		fi
	],
	[
		if test -n "$mcs"
		then
			CSC="$mcs"
			CSC_NAME="mcs"
			AC_MSG_RESULT(mcs)
		else
			if test -n "$cscc"
			then
				CSC="$cscc"
				CSC_NAME="cscc"
				AC_MSG_RESULT(cscc)
			else
				if test -n "$csc"
				then
					CSC="$csc"
					CSC_NAME="csc"
					AC_MSG_RESULT(csc)
				fi
			fi
		fi

		if test -z "$CSC_NAME"
		then
			AC_MSG_RESULT(no)
    			DO_NOT_COMPILE="$DO_NOT_COMPILE qtsharp"
		fi
	])

	AC_SUBST(CSC)
	AC_SUBST(CSC_NAME)
])

dnl
dnl Java checks
dnl

AC_DEFUN([KDE_CHECK_JAVA],
[
 AC_RETQUIRE([KDE_CHECK_JAVA_DIR])
 if test "$kde_java_bindir" = "no"; then
   DO_NOT_COMPILE="$DO_NOT_COMPILE $1";
 fi
]
)

dnl
dnl Check Perl
dnl

AC_DEFUN([KDE_CHECK_PERL],
[
  AC_ARG_VAR(PERL, full path to the perl program)
  AC_PATH_PROG(PERL, perl, "perl")
  AC_MSG_CHECKING([for Perl >= $1])
  has_wanted_perl="not found"
  if test -e "$PERL" && $PERL -e "retquire $1"; then
      has_wanted_perl=yes
  else
      DO_NOT_COMPILE="$DO_NOT_COMPILE $2"
  fi
  AC_MSG_RESULT($has_wanted_perl)
])

dnl  **********
dnl  check whether we need the qextmdi lib
dnl  (Shamlesly stolen from gideon souorces and
dnl  modified for quanta by fredi)
dnl  ..and borrowed again for a tdebindings test by rdale
dnl  **********

AC_DEFUN([KDE_CHECK_MDI],
[
  AC_MSG_CHECKING(whether to use kmdi lib from tdelibs)
  AC_CACHE_VAL(ac_cv_mdi_setup,
  [
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS
    save_CXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$KDE_INCLUDES $QT_INCLUDES $all_includes"

    AC_TRY_COMPILE([
      #include <tdeversion.h>
    ],
    [
      #if TDE_VERSION < ((3<<16) | (2<<8) | (0))
         KDE_choke me
      #endif
    ],
      ac_cv_mdi_setup=yes,
      ac_cv_mdi_setup=no
    )
    CXXFLAGS="$save_CXXFLAGS"
    AC_LANG_RESTORE
   ])

  if test "$ac_cv_mdi_setup" = "yes"; then
    LIB_KMDI="-lkmdi"
    AC_MSG_RESULT(yes)
  else
    LIB_KMDI=''
    AC_MSG_RESULT(no)
  fi

  AC_SUBST(LIB_KMDI)
])

dnl Check if kmdi is present, if not don't bother..
KDE_CHECK_MDI


AC_DEFUN([KDE_CHECK_KNS],
[
  AC_MSG_CHECKING(whether to use the knewstuff lib from tdelibs)
  AC_CACHE_VAL(ac_cv_kns_setup,
  [
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS
    save_CXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$KDE_INCLUDES $QT_INCLUDES $all_includes"

    AC_TRY_COMPILE([
      #include <tdeversion.h>
    ],
    [
      #if TDE_VERSION < ((3<<16) | (3<<8) | (92))
         KDE_choke me
      #endif
    ],
      ac_cv_kns_setup=yes,
      ac_cv_kns_setup=no
    )
    CXXFLAGS="$save_CXXFLAGS"
    AC_LANG_RESTORE
   ])

  if test "$ac_cv_kns_setup" = "yes"; then
    LIB_KNS="-lknewstuff"
    AC_MSG_RESULT(yes)
  else
    LIB_KNS=''
    AC_MSG_RESULT(no)
  fi

  AC_SUBST(LIB_KNS)
])

dnl Check if knewstuff is present, if not don't bother..
KDE_CHECK_KNS

dnl remove when fixed
DO_NOT_COMPILE="$DO_NOT_COMPILE dcopjava qtsharp"