Do not use DISTFILES, use EXTRA_DIST instead or else Makefile.{am,in} won't be included
[xsp.git] / configure.in
blob67ca3969839ff643b562c67424373eeaba68dfa4
1 AC_PREREQ(2.57)
2 AC_INIT(src/Mono.WebServer.XSP/main.cs)
3 AC_CANONICAL_SYSTEM
4 AM_INIT_AUTOMAKE(xsp, 2.7)
5 AM_MAINTAINER_MODE
8 AC_PROG_INSTALL
10 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
11 if test "x$PKG_CONFIG" = "xno"; then
12         AC_MSG_ERROR([You need to install pkg-config])
16 # --enable-tracing
18 AC_MSG_CHECKING([if tracing is requested])
19 AC_ARG_ENABLE([tracing],
20  AC_HELP_STRING([--enable-tracing],[enable producing XSP tracing messages]),
21  [enable_tracing=$enableval],
22  [enable_tracing=no])
24 if test "x$enable_tracing" != "xno" ; then
25         AC_MSG_RESULT([yes])
26         WEBTRACING="-define:WEBTRACE -define:TRACE"
27 else
28         AC_MSG_RESULT([no])
29         WEBTRACING=""
32 AC_ARG_WITH([runtime],
33  AC_HELP_STRING([--with-runtime],[use the specified runtime when xsp is installed]),
34  [RUNTIME=$withval])
36 AC_PATH_PROG(CSC, csc, no)
37 AC_PATH_PROG(GMCS, gmcs, no)
38 AC_PATH_PROG(DMCS, dmcs, no)
40 if test "x$RUNTIME" = "x" ; then
41    if test -x "${prefix}/bin/mono" ; then
42            AC_MSG_CHECKING([for runtime in the installation prefix])
43            RUNTIME="${prefix}/bin/mono"
44            AC_MSG_RESULT([$RUNTIME])
45    else
46            AC_PATH_PROG(RUNTIME, mono, no)
47    fi
49 AC_PATH_PROG(GACUTIL, gacutil, no)
50 AC_PATH_PROG(SN, sn, no)
51 CS="C#"
52 if test "x$CSC" = "xno" -a "x$GMCS" = "xno" -a "x$DMCS" = "xno" ; then
53         dnl AC_MSG_ERROR([You need to install a C# compiler])
54         AC_MSG_ERROR([No $CS compiler found])
57 if test "x$GMCS" != "xno" ; then
58         AC_MSG_CHECKING([whether gmcs is actually able to compile...])
60         echo "class Foo { public static void Main() {} }" > test.cs
62         if [ gmcs -r:System.Web.dll -out:test.exe test.cs > /dev/null 2>&1 ]
63         then
64                 AC_MSG_RESULT(yes)
65         else
66                 GMCS=no
67                 AC_MSG_RESULT(no)
68         fi
70         rm -f test.cs test.exe
73 case "$host" in
74         *-*-mingw*|*-*-cygwin*)
75         platform_win32=yes      
76         ;;
77 esac
79 AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
80 AM_CONDITIONAL(NET_2_0, test ! x$GMCS = xno)
81 AM_CONDITIONAL(NET_4_0, test ! x$DMCS = xno)
82 AM_CONDITIONAL(XSP_ONLY, test x$platform_win32 = xyes)
84 GACUTIL_FLAGS='-root $(DESTDIR)$(prefix)/lib'
86 # Put the version in the new required format (for svn revisions)
87 export VERSION
88 [XSP_VERSION=$($AWK 'BEGIN {
89   split (ENVIRON["VERSION"] ".0.0.0", vsplit, ".")
90   if(length(vsplit [1]) > 4) {
91     split (substr(ENVIRON["VERSION"], 0, 4) "." substr(ENVIRON["VERSION"], 5) ".0.0", vsplit, ".")
92   }
93   print vsplit [1] "." vsplit [2] "." vsplit [3] "." vsplit [4]
94 }')]
97 AC_SUBST(WEBTRACING)
98 AC_SUBST(GMCS)
99 AC_SUBST(DMCS)
100 AC_SUBST(RUNTIME)
101 AC_SUBST(GACUTIL)
102 AC_SUBST(GACUTIL_FLAGS)
103 AC_SUBST(SN)
104 AC_SUBST(VERSION)
105 AC_SUBST(XSP_VERSION)
106 AC_OUTPUT([
107         Makefile
108         man/xsp.1
109         man/dbsessmgr.1
110         man/asp-state.1
111         man/mono-asp-apps.1
112         man/Makefile
113         packaging/Makefile
114         packaging/opensuse/Makefile
115         scripts/Makefile
116         src/Makefile
117         src/Mono.WebServer/AssemblyInfo.cs
118         src/Mono.WebServer/AssemblyInfo2.cs
119         src/Mono.WebServer/AssemblyInfo4.cs
120         src/Mono.WebServer/Makefile
121         src/Mono.WebServer.Apache/Makefile
122         src/Mono.WebServer.Apache/AssemblyInfo.cs
123         src/Mono.WebServer.FastCgi/Makefile
124         src/Mono.WebServer.FastCgi/AssemblyInfo.cs
125         src/Mono.WebServer.XSP/Makefile
126         src/Mono.WebServer.XSP/AssemblyInfo.cs
127         src/Mono.WebServer.XSP/xsp.pc
128         src/Mono.WebServer.XSP/xsp-2.pc
129         src/Mono.WebServer.XSP/xsp-4.pc
130         test/Makefile
131         test/controls/Makefile
132         test/App_Code/Makefile
133         test/1.1/Makefile
134         test/1.1/authtest/Makefile
135         test/1.1/asp.net/Makefile
136         test/1.1/webcontrols/Makefile
137         test/1.1/html/Makefile
138         test/1.1/webservice/Makefile
139         test/1.1/databind/Makefile
140         test/1.1/handlers/Makefile
141         test/1.1/customcontrol/Makefile
142         test/2.0/Makefile
143         test/2.0/menu/Makefile
144         test/2.0/gridview/Makefile
145         test/2.0/treeview/Makefile
146         test/2.0/masterpages/Makefile
147         tools/Makefile
148         tools/asp_state/Makefile
149         tools/asp_state/AssemblyInfo.cs
150         tools/dbsessmgr/Makefile
151         tools/dbsessmgr/AssemblyInfo.cs
152         tools/mono-asp-apps/Makefile
153         unittests/Makefile
154         unittests/Tests.XSP.Security/Makefile
155         unittests/webroot/Makefile
156         docs/Makefile
159 echo
160 echo "Runtime: $RUNTIME"
161 echo "$CS 2.0 compiler: $GMCS"
162 echo "$CS 4.0 compiler: $DMCS"