~ubuntu-branches/ubuntu/edgy/lasso/edgy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-09-13 09:26:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040913092634-01vdfl8j9cp94exa
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl -*- Mode: sh -*-
 
2
dnl
 
3
dnl configure.ac - top level autoconf file for Lasso
 
4
dnl (Process this file with autoconf to produce a configure script.)
 
5
dnl
 
6
dnl 
 
7
dnl See COPYING at the top of this package for the full license terms.
 
8
dnl 
 
9
dnl 
 
10
 
 
11
dnl Declare package and package version.
 
12
dnl (r-c).a.r
 
13
dnl - First number is the lowest supported API version number.
 
14
dnl - Second number is the number of supported API versions where API version >
 
15
dnl   first number.
 
16
dnl - Third number is the current API version implementation version number.
 
17
dnl See libtool explanations about current, age and release, later in this file.
 
18
AC_INIT([Liberty Alliance Single Sign On], 0.4.1, lasso-devel@lists.labs.libre-entreprise.org)
 
19
dnl Check if autoconf ver > 2.53
 
20
AC_PREREQ(2.53)
 
21
dnl Check existence of a relative pathed source file.
 
22
AC_CONFIG_SRCDIR(lasso/lasso.c)
 
23
dnl Copy stamp REVISIO-INFO in the configure script.
 
24
AC_REVISION($Revision: 1.94 $)
 
25
 
 
26
dnl Run many macros mostly needed by configure.ac.
 
27
AM_INIT_AUTOMAKE(lasso, 0.4.1)
 
28
dnl Create rules to automaticaly regenerate the config header.
 
29
AM_CONFIG_HEADER(lasso/lasso_config.h)
 
30
dnl Add --enable-maintainer-mode option to configure.
 
31
AM_MAINTAINER_MODE
 
32
 
 
33
dnl Perform only subset commands and variable relevant to the host type.
 
34
AC_CANONICAL_HOST
 
35
dnl ==========================================================================
 
36
dnl Perform host specific configuration
 
37
dnl ==========================================================================
 
38
NULL=
 
39
MINGW=0
 
40
DARWIN=0
 
41
dnl For java sun environment automagic include subdir guessing. (dirty ? No...)
 
42
SUN_EXTRA_INCLUDE=
 
43
case "${host}" in
 
44
    *aix* )
 
45
        CFLAGS="${CFLAGS} -D_ALL_SOURCE"
 
46
        ;;
 
47
    *-pc-mingw32)
 
48
        case "${build}" in
 
49
            *-pc-cygwin)
 
50
                CC="gcc -mno-cygwin"
 
51
                CFLAGS="${CFLAGS} -D_MSC_VER -DIN_LASSO -DMINGW -DWIN32 -D_WIN32 -I/usr/local/include"
 
52
                LDFLAGS="${LDFLAGS} -L/usr/local/lib"
 
53
                MINGW=1
 
54
                SUN_EXTRA_INCLUDE="win32" 
 
55
                ;;
 
56
            dnl ==========================================================================
 
57
            dnl Workaround for non libtool standard library name specs.
 
58
            dnl ==========================================================================
 
59
            *)
 
60
            SUN_EXTRA_INCLUDE="win32" 
 
61
            ;;
 
62
        esac
 
63
 
 
64
dnl         if test -f "/cygdrive/c/windows/system/user32.dll"; then
 
65
dnl             dnl make symbolic link.
 
66
dnl             if test ! -f "/usr/local/lib/libuser32.dll"; then
 
67
dnl                 AC_MSG_WARN([Create workaround symbolic links: user32.dll])
 
68
dnl                 ln -s   /cygdrive/c/windows/system/user32.dll \
 
69
dnl                         /usr/local/lib/libuser32.dll
 
70
dnl             fi
 
71
dnl             if test ! -f "/usr/local/lib/libkernel32.dll"; then
 
72
dnl                 AC_MSG_WARN([Create workaround symbolic links: kernel32.dll])
 
73
dnl                 ln -s   /cygdrive/c/windows/system/kernel32.dll \
 
74
dnl                         /usr/local/lib/libkernel32.dll
 
75
dnl             fi
 
76
dnl         fi
 
77
        dnl FIXME: This is a guessing, no test yet under windows with sun JDK
 
78
        ;;
 
79
    *-pc-cygwin)
 
80
        SUN_EXTRA_INCLUDE="win32" 
 
81
        ;;
 
82
    *linux*)
 
83
        SUN_EXTRA_INCLUDE="linux"
 
84
        ;;
 
85
    *Darwin*)
 
86
        DARWIN=1
 
87
        ;;
 
88
esac
 
89
 
 
90
 
 
91
 
 
92
# OSX Fink
 
93
if test -d /sw/bin ; then
 
94
  PATH=$PATH:/sw/bin
 
95
fi
 
96
 
 
97
dnl
 
98
dnl Check for programs
 
99
dnl
 
100
AC_PROG_CC
 
101
AC_HEADER_STDC
 
102
LT_AC_PROG_RC
 
103
AM_PROG_GCJ
 
104
AC_EXEEXT
 
105
AC_PROG_CC_C_O
 
106
AM_SANITY_CHECK
 
107
AC_PROG_AWK
 
108
AC_PROG_LN_S
 
109
AC_LIBTOOL_WIN32_DLL
 
110
AM_PROG_LIBTOOL
 
111
AC_SUBST(LIBTOOL_DEPS)
 
112
 
 
113
dnl Find tar command for make dist
 
114
AC_CHECK_PROGS(TAR, gnutar gtar tar)
 
115
 
 
116
dnl Check existence of binding programs
 
117
AC_CHECK_PROGS(JAVA, java)
 
118
AC_CHECK_PROGS(JAVAC, gcj javac)
 
119
AC_CHECK_PROGS(JAR, fastjar jar)
 
120
AC_CHECK_PROGS(PYTHON, python)
 
121
AC_CHECK_PROGS(PHP, php)
 
122
AC_PATH_PROGS(PHP_PATH, php)
 
123
AC_CHECK_PROG(PHP_CONFIG, php-config, php-config)
 
124
AC_CHECK_PROGS(SWIG, swig)
 
125
 
 
126
LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[^_].*"'
 
127
 
 
128
dnl Make sure we have an ANSI compiler
 
129
AM_C_PROTOTYPES
 
130
test "z$U" != "z" && AC_MSG_ERROR(Compiler not ANSI compliant)
 
131
 
 
132
dnl ==========================================================================
 
133
dnl Version Super.Size.Me.L
 
134
dnl ==========================================================================
 
135
 
 
136
changequote(<<, >>)dnl
 
137
VERSION_MAJOR=`echo $VERSION | $SED -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\1/'`
 
138
VERSION_MINOR=`echo $VERSION | $SED -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\2/'`
 
139
VERSION_RELEASE=`echo $VERSION | $SED -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\3/'`
 
140
changequote([, ])dnl
 
141
 
 
142
version_decimal=`expr $VERSION_MAJOR \* 10000 + $VERSION_MINOR \* 100 + $VERSION_RELEASE`
 
143
windows_version=`echo $VERSION_MAJOR,$VERSION_MINOR,$VERSION_RELEASE,0`
 
144
 
 
145
dnl Add versionning & package defines to lasso_config.h
 
146
AC_DEFINE_UNQUOTED(LASSO_VERSION_MAJOR, $VERSION_MAJOR, [Major version number])
 
147
AC_DEFINE_UNQUOTED(LASSO_VERSION_MINOR, $VERSION_MINOR, [Minor version number])
 
148
AC_DEFINE_UNQUOTED(LASSO_VERSION_SUBMINOR, $VERSION_RELEASE, [Release version number])
 
149
AC_DEFINE_UNQUOTED(LASSO_VERSION_DECIMAL, $version_decimal, [Release version as a decimal])
 
150
 
 
151
dnl Dirty hack in order to have dynamic resource version numbering.
 
152
AC_DEFINE_UNQUOTED(LASSO_WINDOWS_VERSION, $windows_version, [Windows version of the lasso version])
 
153
 
 
154
dnl CURRENT, REVISION, AGE
 
155
dnl - library source changed -> increment REVISION
 
156
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
 
157
dnl - interfaces added -> increment AGE
 
158
dnl - interfaces removed -> AGE = 0
 
159
 
 
160
# syntax: CURRENT[:REVISION[:AGE]]
 
161
# So if M=major, m=minor, r=release:
 
162
# c = M + a = M + m;
 
163
# m = a
 
164
# r = r
 
165
current=`expr $VERSION_MAJOR + $VERSION_MINOR`
 
166
LASSO_VERSION_INFO="1:1:0"
 
167
AC_SUBST(LASSO_VERSION_INFO)
 
168
 
 
169
dnl ==========================================================================
 
170
dnl Swig
 
171
dnl ==========================================================================
 
172
SWIG_MIN_VERSION=1.3
 
173
AC_MSG_CHECKING(SWIG support)
 
174
if test "X$SWIG" != "X"; then
 
175
  SWIG_VERSION=`$SWIG -version 2>&1 | $SED -ne 's/^SWIG Version //p'`
 
176
  SWIG_VERSION_DEC=`echo $SWIG_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
 
177
 
 
178
 if test $SWIG_VERSION_DEC -ge 010314; then
 
179
   SWIG_PYTHON_ARGS=-noproxy
 
180
 fi
 
181
 
 
182
  SWIG_MIN_VERSION_DEC=`echo $SWIG_MIN_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
 
183
 
 
184
  if test $SWIG_VERSION_DEC -ge $SWIG_MIN_VERSION_DEC; then
 
185
    AC_MSG_RESULT($SWIG_VERSION - OK)
 
186
  else
 
187
    AC_MSG_RESULT($SWIG_VERSION - too old to generate language interfaces)
 
188
    if test -r $srcdir/perl/CORE_wrap.c ; then
 
189
      AC_MSG_WARN(Pre-generated language interface files are present)
 
190
      AC_MSG_WARN(If you want to change the interfaces you will need)
 
191
      AC_MSG_WARN(SWIG version $SWIG_MIN_VERSION from http://www.swig.org/)
 
192
    else
 
193
      AC_MSG_WARN(There are no pre-generated language interface files)
 
194
      AC_MSG_WARN(lasso language interfaces will NOT build.)
 
195
      AC_MSG_WARN(If you want to build them you will need)
 
196
      AC_MSG_WARN(SWIG version $SWIG_MIN_VERSION from http://www.swig.org/)
 
197
      AC_MSG_WARN(Alternatively copy the pre-generated interface)
 
198
      AC_MSG_WARN(files from a released version)
 
199
    fi
 
200
  fi
 
201
else
 
202
  AC_MSG_RESULT(not present - using pre-generated interface files)
 
203
  SWIG="echo"
 
204
fi
 
205
AC_SUBST(SWIG_PYTHON_ARGS)
 
206
 
 
207
dnl Detect available languages binding.
 
208
languages_available=
 
209
 
 
210
dnl ==========================================================================
 
211
dnl Java(tm) API
 
212
dnl ==========================================================================
 
213
dnl Check if java is explicitly disabled.
 
214
AC_ARG_ENABLE(java, [  --disable-java          disable the Java bindings],,
 
215
              enable_java="yes")
 
216
AC_ARG_WITH(java-home,
 
217
            [  --with-java-home=(JAVA_HOME)  set the full path to the java home directory.])
 
218
JAVAC_FLAGS=
 
219
JDK_INCLUDE=
 
220
SUN=no
 
221
if test "X$with_java_home" != X; then
 
222
    JDK_INCLUDE="$with_java_home/include"
 
223
fi
 
224
 
 
225
dnl If the java compiler seems to be a Sun JDK-like compile (Kaffe, Sun JDK...)
 
226
if test "x$JAVA" = "xjava" && test "x$JAVAC" = "xjavac"; then
 
227
    dnl If we have a java compiler
 
228
    dnl need to change quotes to allow square brackets
 
229
    changequote(<<, >>)dnl
 
230
    JAVA_VERSION=`$JAVA -version 2>&1 | $SED -ne 's/java version "\([^"]*\)".*/\1/p' 2>/dev/null`
 
231
    changequote([, ])dnl
 
232
    dnl If no java version found, perphas it is a kaffee environment...
 
233
    if test "x$JAVA_VERSION" = x; then
 
234
        JAVA_VERSION=`$JAVA -version 2>&1 | grep "Java Version" | $SED 's/^.*Java Version: //g'`
 
235
        dnl If the java environment is kaffe, specify the JDK_INCLUDE directory.
 
236
        if test "x$JAVA_VERSION" != x; then
 
237
            JDK_INCLUDE="/usr/lib/kaffe/include"
 
238
        fi
 
239
    else
 
240
        dnl We assume it is a SUN environment.
 
241
        SUN=yes
 
242
    fi
 
243
    if ! test -f "$JDK_INCLUDE/jni.h"; then
 
244
        JAVA_VERSION=""
 
245
    fi
 
246
fi
 
247
 
 
248
dnl If the java compiler is the GNU Java Compiler.
 
249
if test "x$JAVAC" = "xgcj"; then
 
250
    changequote(<<, >>)dnl
 
251
    JAVA_VERSION=`$JAVAC --version 2>&1 | $SED -ne 's/gcj (GCC) \([^"]*\) (.*/\1/p' 2>/dev/null`
 
252
    changequote([, ])dnl
 
253
    
 
254
    dnl Byte-compiled .class file
 
255
    JAVAC_FLAGS="-C"
 
256
    dnl JNI compatible header files. (not used with SWIG.)
 
257
    dnl JAVAH_FLAGS="-jni"
 
258
    dnl Checking for jni.h if gcj is the java interpreter.
 
259
    AC_CHECK_HEADERS([jni.h], [], [JAVA_VERSION=$(NULL)])
 
260
fi
 
261
 
 
262
dnl Now transform JDK_INCLUDE in CFLAG option if applicable.
 
263
if test "X$JDK_INCLUDE" != X; then
 
264
    dnl If it is a sun environment
 
265
    if test "x$SUN" = "xyes"; then
 
266
        JDK_INCLUDE="$JDK_INCLUDE -I$JDK_INCLUDE/$SUN_EXTRA_INCLUDE"
 
267
    fi
 
268
    JDK_INCLUDE=-I$JDK_INCLUDE
 
269
fi
 
270
 
 
271
dnl If we found a java version information, we have java compilation environment.
 
272
if test "X$JAVA_VERSION" != X && test "X$JAR" != X; then
 
273
  languages_available="$languages_available $JAVA($JAVA_VERSION)"
 
274
else
 
275
  enable_java=no
 
276
  JAVA_VERSION=""
 
277
fi
 
278
 
 
279
dnl Conditional java sub dir test.
 
280
AM_CONDITIONAL([JAVA_ENABLED],[test "x$enable_java" = "xyes"])
 
281
AC_SUBST(JAVA_VERSION)
 
282
AC_SUBST(JAVAC_FLAGS)
 
283
AC_SUBST(JDK_INCLUDE)
 
284
 
 
285
 
 
286
dnl ==========================================================================
 
287
dnl Python API
 
288
dnl ==========================================================================
 
289
dnl Check if python is explicitly disabled.
 
290
AC_ARG_ENABLE(python, [  --disable-python        disable the Python bindings],,
 
291
              enable_python="yes")
 
292
 
 
293
dnl Check if user passed a specific python program.
 
294
AC_ARG_WITH(python,
 
295
            [  --with-python=(PYTHON)  set the full path to the python program to use.])
 
296
AC_MSG_CHECKING(for Python development files)
 
297
 
 
298
dnl specific program passed, set PYTHON to it.
 
299
if test "X$with_python" != X; then
 
300
    PYTHON=$with_python
 
301
fi
 
302
 
 
303
 
 
304
dnl need to change quotes to allow square brackets
 
305
changequote(<<, >>)dnl
 
306
PYTHON_VERSION=`$PYTHON -c 'import sys; print sys.version[:3]' 2>/dev/null`
 
307
changequote([, ])dnl
 
308
 
 
309
dnl Check if we were be able to extract a good version number.
 
310
if test "X$PYTHON_VERSION" != X; then
 
311
    PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
 
312
    PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
 
313
    changequote(<<, >>)dnl
 
314
    PY_VERSION=`$PYTHON -c 'import sys ; print sys.version[0:3]'`
 
315
    changequote([, ])dnl
 
316
    PYTHON_H=$PY_PREFIX/include/python$PY_VERSION/Python.h
 
317
    LIBPYTHON_SO=$PY_PREFIX/lib/libpython$PY_VERSION.so
 
318
    if test -f $PYTHON_H; then
 
319
            dnl Not useful unless we make a test on the python version.
 
320
            PYTHON="python$PY_VERSION"
 
321
            PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
 
322
            PY_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config/Makefile"
 
323
            PY_OTHER_LIBS=`$SED -n -e 's/^LIBS=\(.*\)/\1/p' $PY_MAKEFILE`
 
324
            PY_EXTRA_LIBS="$PY_LOCALMODLIBS $PY_BASEMODLIBS $PY_OTHER_LIBS"
 
325
            PY_SITE_PACKAGES="\${prefix}/lib/python$PY_VERSION/site-packages"
 
326
            AC_SUBST(PYTHON)
 
327
            AC_SUBST(PY_LIB_LOC)
 
328
            AC_SUBST(PY_CFLAGS)
 
329
            AC_SUBST(PY_EXTRA_LIBS)
 
330
            AC_SUBST(PY_DYNLOAD)
 
331
            AC_SUBST(PY_LIB_A)
 
332
            AC_SUBST(PY_SITE_PACKAGES)
 
333
            languages_available="$languages_available python($PYTHON_VERSION)"
 
334
    else
 
335
            enable_python=no
 
336
    fi
 
337
else
 
338
        enable_python=no
 
339
fi
 
340
AM_CONDITIONAL([PYTHON_ENABLED],[test "x$enable_python" = "xyes"])
 
341
AC_MSG_RESULT($enable_python)
 
342
AC_SUBST(PYTHON_VERSION)
 
343
 
 
344
dnl Check if php is explicitly disabled.
 
345
AC_ARG_ENABLE(php, [  --disable-php           disable the PHP bindings],,
 
346
              enable_php="yes")
 
347
 
 
348
AC_ARG_WITH(php-config,
 
349
            [  --with-php-config=(PHP_CONFIG)      Specify full path to php-config.])
 
350
dnl Check if user passed a specific php-config program.
 
351
if test "X$with_php_config" != X ; then
 
352
    PHP_CONFIG=$with_php_config
 
353
fi
 
354
 
 
355
if test "X$PHP_CONFIG" != X ; then
 
356
  PHP_INCLUDES=`$PHP_CONFIG --includes`
 
357
  PHP_LDFLAGS=`$PHP_CONFIG --ldflags`
 
358
  PHP_LIBS=`$PHP_CONFIG --libs`
 
359
  PHP_UNPREFIXED_EXTENSION_DIR=`$PHP_CONFIG --extension-dir | $SED 's/\/usr//g'`
 
360
  PHP_PREFIX=`$PHP_CONFIG --prefix`
 
361
else
 
362
  # This allows 'make clean' in the php directory to work when
 
363
  # php isn't available
 
364
  PHP=:
 
365
  PHP_INCLUDES=
 
366
  PHP_LDFLAGS=
 
367
  PHP_LIBS=
 
368
  PHP_UNPREFIXED_EXTENSION_DIR=
 
369
  PHP_PREFIX=
 
370
fi
 
371
AC_SUBST(PHP_INCLUDES)
 
372
AC_SUBST(PHP_LDFLAGS)
 
373
AC_SUBST(PHP_LIBS)
 
374
AC_SUBST(PHP_UNPREFIXED_EXTENSION_DIR)
 
375
AC_SUBST(PHP_PREFIX)
 
376
 
 
377
dnl Check for expat
 
378
have_expat_include=no
 
379
AC_CHECK_LIB(expat, XML_ParserCreate, have_expat_lib=yes, have_expat_lib=no)
 
380
  
 
381
if test x$have_expat_lib = xno; then
 
382
    enable_php=no
 
383
fi
 
384
 
 
385
AC_MSG_CHECKING(for PHP development files)
 
386
PHP_VERSION=`$PHP_CONFIG --version 2>/dev/null`
 
387
dnl Check if we were be able to extract a good version number.
 
388
if test "X$PHP_VERSION" != X; then
 
389
    languages_available="$languages_available php($PHP_VERSION)"
 
390
else
 
391
    enable_php=no
 
392
fi
 
393
AC_MSG_RESULT($enable_php)
 
394
AM_CONDITIONAL([PHP_ENABLED], [test "x$enable_php" = "xyes"])
 
395
AC_SUBST(PHP_VERSION)
 
396
 
 
397
 
 
398
 
 
399
# -----------
 
400
# C# bindings
 
401
# -----------
 
402
 
 
403
AC_ARG_ENABLE(csharp, [  --disable-csharp        disable the C Sharp bindings],,
 
404
              enable_csharp="yes")
 
405
 
 
406
AC_ARG_WITH(cil-interpreter, [  --with-cil-interpreter=path     set location of CIL interpreter for CSharp],[CSHARPBIN="$withval"], [CSHARPBIN=])
 
407
AC_ARG_WITH(csharp-compiler, [  --with-csharp-compiler=path     set location of CSharp compiler],[CSHARPCOMPILERBIN="$withval"], [CSHARPCOMPILERBIN=])
 
408
 
 
409
if test -z "$CSHARPCOMPILERBIN" ; then
 
410
  case $host in
 
411
  *-*-cygwin* | *-*-mingw*)
 
412
    AC_CHECK_PROGS(CSHARPCOMPILER, mcs.bat cscc csc);;
 
413
  *)AC_CHECK_PROGS(CSHARPCOMPILER, mcs cscc);;
 
414
  esac
 
415
else
 
416
  CSHARPCOMPILER="$CSHARPCOMPILERBIN"
 
417
fi
 
418
 
 
419
CSHARPPATHSEPARATOR="/"
 
420
CSHARPCYGPATH_W=echo
 
421
if test -z "$CSHARPBIN" ; then
 
422
  languages_available="$languages_available C#($CSHARPCOMPILER)"
 
423
  CSHARPCILINTERPRETER=""
 
424
  if test "cscc" = "$CSHARPCOMPILER" ; then
 
425
    AC_CHECK_PROGS(CSHARPCILINTERPRETER, ilrun)
 
426
  else
 
427
    if test "mcs" = "$CSHARPCOMPILER"; then
 
428
      # Check that mcs is the C# compiler and not the Unix mcs utility by examining the output of 'mcs --version'
 
429
      # The Mono compiler should emit: Mono C# compiler version a.b.c.d
 
430
      csharp_version_raw=`(mcs --version) 2>/dev/null`
 
431
      csharp_version_searched=`(mcs --version | sed -n "/C#\|Mono/p") 2>/dev/null`
 
432
      CSHARPCOMPILER="";
 
433
      if test -n "$csharp_version_raw" ; then
 
434
        if test "$csharp_version_raw" = "$csharp_version_searched" ; then
 
435
          CSHARPCOMPILER="mcs"
 
436
        fi
 
437
      fi
 
438
 
 
439
      # mono interpreter (ver 0.26 doesn't seem to work on Windows platforms)
 
440
      case $host in
 
441
      *-*-cygwin* | *-*-mingw*)
 
442
        ;;
 
443
      *)AC_CHECK_PROGS(CSHARPCILINTERPRETER, mint);;
 
444
      esac
 
445
    else 
 
446
      if test "csc" = "$CSHARPCOMPILER"; then
 
447
          CSHARPPATHSEPARATOR="\\\\"
 
448
          CSHARPCYGPATH_W='cygpath -w'
 
449
      fi
 
450
    fi
 
451
  fi
 
452
else
 
453
  CSHARPCILINTERPRETER="$CSHARPBIN"
 
454
fi
 
455
 
 
456
# Cygwin requires the Windows standard (Pascal) calling convention as it is a Windows executable and not a Cygwin built executable
 
457
case $host in
 
458
*-*-cygwin* | *-*-mingw*)
 
459
    if test "$GCC" = yes; then
 
460
        CSHARPDYNAMICLINKING=" -Wl,--add-stdcall-alias"
 
461
    else
 
462
        CSHARPDYNAMICLINKING=""
 
463
    fi ;;
 
464
*)CSHARPDYNAMICLINKING="";;
 
465
esac
 
466
 
 
467
AC_CHECK_PROGS(GACUTIL, gacutil)
 
468
 
 
469
AC_SUBST(CSHARPCILINTERPRETER)
 
470
AC_SUBST(CSHARPCYGPATH_W)
 
471
AC_SUBST(CSHARPCOMPILER)
 
472
AC_SUBST(CSHARPDYNAMICLINKING)
 
473
AC_SUBST(CSHARPLIBRARYPREFIX) # Is this going to be used?
 
474
AC_SUBST(GACUTIL)
 
475
 
 
476
if test "X$CSHARPCOMPILER" = X; then
 
477
    enable_csharp=no 
 
478
fi
 
479
if test "X$GACUTIL" = X; then
 
480
    enable_csharp=no 
 
481
fi
 
482
AM_CONDITIONAL([CSHARP_ENABLED], [test "x$enable_csharp" = "xyes"])
 
483
 
 
484
 
 
485
 
 
486
dnl ==========================================================================
 
487
dnl Test suite (requires check)
 
488
dnl ==========================================================================
 
489
dnl Check if user disabled the tests.
 
490
AC_ARG_ENABLE(tests, [  --disable-tests         disable the test suite],,
 
491
              enable_tests="yes")
 
492
AC_DEFINE([CHECK_IS_XML], [], [Define if check available with XML support])
 
493
if test "x$enable_tests" = xyes ; then
 
494
  AM_PATH_CHECK
 
495
  AC_CHECK_LIB(check, srunner_set_xml, [AC_DEFINE(CHECK_IS_XML)])
 
496
fi
 
497
 
 
498
AM_CONDITIONAL(WITH_TESTS, [test "x$enable_tests" = "xyes"])
 
499
 
 
500
dnl Final step, add missing programs.
 
501
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
 
502
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 
503
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
 
504
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
 
505
 
 
506
 
 
507
dnl ==========================================================================
 
508
dnl User specific option.
 
509
dnl ==========================================================================
 
510
dnl Where do we want to install docs
 
511
AC_MSG_CHECKING(for docs folder) 
 
512
AC_ARG_WITH(html-dir, [  --with-html-dir=PATH    path to installed docs ])
 
513
if test "z$with_html_dir" != "z" ; then
 
514
    LASSO_DOCDIR=$with_html_dir
 
515
else
 
516
    LASSO_DOCDIR='$(datadir)/doc/lasso'
 
517
fi
 
518
AC_MSG_RESULT($LASSO_DOCDIR)
 
519
AC_SUBST(LASSO_DOCDIR)
 
520
 
 
521
AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
 
522
 
 
523
if test "x$with_html_dir" = "x" ; then
 
524
  HTML_DIR='${datadir}/gtk-doc/html'
 
525
else
 
526
  HTML_DIR=$with_html_dir
 
527
fi
 
528
AC_SUBST(HTML_DIR)
 
529
 
 
530
AC_CHECK_PROGS(REST2HTML, rest2html)
 
531
 
 
532
AM_CONDITIONAL(HAVE_REST2HTML, test -n "$ac_cv_prog_REST2HTML")
 
533
 
 
534
 
 
535
dnl pkg-config path
 
536
AC_ARG_WITH(pkg-config, [  --with-pkg-config=PATH set pkg-config metadata search path.],
 
537
            PKG_CONFIG_PATH="${withval}", PKG_CONFIG_PATH="")
 
538
if test "z$PKG_CONFIG_PATH" != "z"; then
 
539
    export PKG_CONFIG_PATH
 
540
fi
 
541
 
 
542
PKG_CHECK_MODULES(LASSO, glib-2.0 gobject-2.0 libxml-2.0 libxslt xmlsec1 xmlsec1-openssl openssl)
 
543
 
 
544
dnl Let people disable the gtk-doc stuff.
 
545
AC_ARG_ENABLE(gtk-doc, [  --disable-gtk-doc       disable documentation build],,
 
546
              enable_gtk_doc="yes")
 
547
 
 
548
if test "x$enable_gtk_doc" = "xyes" ; then
 
549
    GTK_DOC_MIN_VERSION=1.0
 
550
    PKG_CHECK_MODULES(GTK_DOC, gtk-doc >= $GTK_DOC_MIN_VERSION, enable_gtk_doc="yes",
 
551
                      enable_gtk_doc="no")
 
552
fi
 
553
dnl Conditional docs sub dir test.
 
554
AM_CONDITIONAL([GTK_DOC_ENABLED],[test "x$enable_gtk_doc" = "xyes"])
 
555
 
 
556
 
 
557
dnl Debug 
 
558
AC_MSG_CHECKING(for debugging) 
 
559
AC_ARG_ENABLE(debugging,   [  --enable-debugging      enable debuging messages (no)])
 
560
if test "z$enable_debugging" = "zyes" ; then
 
561
    enable_debugging=yes
 
562
    LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG"
 
563
else
 
564
    enable_debugging=no
 
565
fi    
 
566
AC_MSG_RESULT($enable_debugging)
 
567
 
 
568
dnl Profiling 
 
569
AC_MSG_CHECKING(for profiling) 
 
570
AC_ARG_ENABLE(profiling,   [  --enable-profiling      enable profiling compilation flags (no)])
 
571
if test "z$enable_profiling" = "zyes" ; then
 
572
    CFLAGS="$CFLAGS -pg"
 
573
    AC_MSG_RESULT(yes)
 
574
else
 
575
    AC_MSG_RESULT(no)
 
576
fi 
 
577
 
 
578
dnl ==========================================================================
 
579
dnl Pedantic compilation
 
580
dnl ==========================================================================
 
581
AC_MSG_CHECKING(for pedantic) 
 
582
AC_ARG_ENABLE(pedantic,   [  --enable-pedantic       enable pedantic compilation flags (no)])
 
583
if test "z$enable_pedantic" = "zyes" ; then
 
584
    CFLAGS="$CFLAGS -O -pedantic -Wall -ansi -fno-inline -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
 
585
    AC_MSG_RESULT(yes)
 
586
else
 
587
    AC_MSG_RESULT(no)
 
588
fi    
 
589
 
 
590
dnl ==========================================================================
 
591
dnl Static linking
 
592
dnl ==========================================================================
 
593
LASSO_STATIC_BINARIES=""
 
594
AC_MSG_CHECKING(for static linking) 
 
595
AC_ARG_ENABLE(static_linking,   [  --enable-static-linking enable static linking (no)])
 
596
if test "z$enable_static_linking" = "zyes" ; then
 
597
    LASSO_STATIC_BINARIES="-static"
 
598
    AC_MSG_RESULT(yes)
 
599
else
 
600
    AC_MSG_RESULT(no)
 
601
fi    
 
602
AC_SUBST(LASSO_STATIC_BINARIES)
 
603
 
 
604
dnl ==========================================================================
 
605
dnl Final steps: lasso config
 
606
dnl ==========================================================================
 
607
LASSO_CORE_CFLAGS="$LASSO_DEFINES" 
 
608
if test $MINGW -eq 1; then 
 
609
  LASSO_CORE_LIBS="-llasso-0"
 
610
else
 
611
  LASSO_CORE_LIBS="-llasso "
 
612
fi
 
613
AC_SUBST(LASSO_CORE_CFLAGS)
 
614
AC_SUBST(LASSO_CORE_LIBS)
 
615
 
 
616
LASSO_CFLAGS="$LASSO_CORE_CFLAGS $LASSO_CFLAGS"
 
617
LASSO_LIBS="-L${libdir} $LASSO_LIBS"
 
618
AC_SUBST(LASSO_CFLAGS)
 
619
AC_SUBST(LASSO_LIBS)
 
620
 
 
621
AC_SUBST(LASSO_DEFINES)
 
622
AC_SUBST(LASSO_APP_DEFINES)
 
623
AC_SUBST(CFLAGS)
 
624
AC_SUBST(CPPFLAGS)
 
625
AC_SUBST(LDFLAGS)
 
626
 
 
627
dnl Dirty system often means dirty hacks...
 
628
AM_CONDITIONAL(MINGW, test $MINGW == 1)
 
629
AM_CONDITIONAL(DARWIN, test $DARWIN == 1)
 
630
 
 
631
 
 
632
dnl ==========================================================================
 
633
dnl Writing result files
 
634
dnl ==========================================================================
 
635
AC_OUTPUT(
 
636
[Makefile
 
637
csharp/Makefile
 
638
csharp/lasso-sharp.pc
 
639
docs/Makefile
 
640
docs/lasso-book/Makefile
 
641
docs/reference/Makefile
 
642
docs/tutorial/Makefile
 
643
java/Makefile
 
644
lasso/Makefile
 
645
lasso/environs/Makefile
 
646
lasso/protocols/elements/Makefile
 
647
lasso/protocols/Makefile
 
648
lasso/xml/Makefile
 
649
php/Makefile
 
650
php/examples/Makefile
 
651
php/examples/sample-sp/Makefile
 
652
python/Makefile
 
653
swig/Makefile
 
654
tests/Makefile
 
655
tests/data/Makefile
 
656
tests/data/ca1-la/Makefile
 
657
tests/data/idp1-la/Makefile
 
658
tests/data/lecp1-la/Makefile
 
659
tests/data/sp1-la/Makefile
 
660
lasso.pc
 
661
win32/Makefile
 
662
win32/nsis/Makefile
 
663
])
 
664
languages_available=`echo $languages_available | sed -e "s/^ //" `
 
665
AC_MSG_RESULT(
 
666
 
 
667
=============
 
668
Configuration
 
669
=============
 
670
 
 
671
Main
 
672
----
 
673
 
 
674
Compiler:               ${CC} 
 
675
Install prefix:         ${prefix}
 
676
Debugging:              $enable_debugging
 
677
 
 
678
Optionals builds
 
679
----------------
 
680
  
 
681
Available languages:    ${languages_available}
 
682
 
 
683
C# binding:             ${enable_csharp}
 
684
Java binding:           ${enable_java}
 
685
PHP binding:            ${enable_php}
 
686
Python binding:         ${enable_python}
 
687
 
 
688
C API references:       ${enable_gtk_doc}
 
689
Tests suite:            ${enable_tests}
 
690
)