source: trunk/configure.ac @ 2418

Last change on this file since 2418 was 2418, checked in by joshe, 15 years ago

A couple autoconf fixes for osx.

File size: 5.6 KB
Line 
1AC_INIT([Transmission],[0.72Z],[http://bugzilla.gnome.org/enter_bug.cgi?product=Pan])
2AC_PREREQ(2.54)
3AM_CONFIG_HEADER(config.h)
4AC_CONFIG_SRCDIR(libtransmission/transmission.h)
5AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
6AM_MAINTAINER_MODE
7
8GLIB_MINIMUM=2.4.0
9GTK_MINIMUM=2.4.0
10WX_MINIMUM=2.6.0
11AC_SUBST(GLIB_MINIMUM)
12AC_SUBST(GTK_MINIMUM)
13AC_SUBST(WX_MINIMUM)
14
15AC_PROG_CC
16AC_PROG_CXX
17AC_HEADER_STDC
18AC_HEADER_TIME
19AC_CHECK_FUNCS([lrintf strlcpy strlcat daemon])
20AC_PROG_INSTALL
21AC_PROG_MAKE_SET
22AC_PROG_RANLIB
23ACX_PTHREAD
24
25dnl AC_PROG_INTLTOOL([0.23],[no-xml])
26GETTEXT_PACKAGE=transmission
27AC_SUBST(GETTEXT_PACKAGE)
28AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
29ALL_LINGUAS="bg es fi fr it pl ro ru sv"
30AM_GLIB_GNU_GETTEXT
31transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
32
33AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data])
34AC_CHECK_LIB([ssl],[SSL_library_init])
35
36dnl ----------------------------------------------------------------------------
37dnl
38dnl  libevent detection for the Daemon
39
40
41AC_CHECK_LIB([event],[event_init],[have_libevent=yes],[have_libevent=no])
42AC_ARG_WITH(libevent,
43            AC_HELP_STRING([--with-libevent], [Build Daemon]),
44            [want_libevent=$withval],
45            [want_libevent=$have_libevent])
46use_libevent=no
47if test "x$want_libevent" = "xyes" ; then
48    if test "x$have_libevent" = "xyes"; then
49      use_libevent=yes
50    else
51      AC_MSG_ERROR("libevent not found!")
52    fi
53fi
54AM_CONDITIONAL([WITH_LIBEVENT],[test "x$use_libevent" = "xyes"])
55
56
57
58dnl ----------------------------------------------------------------------------
59dnl
60dnl  GTK+ detection for the GTK+ client
61
62AM_PATH_GTK_2_0($GTK_MINIMUM,[have_gtk=yes],[have_gtk=no][gthread])
63AC_ARG_WITH(gtk, AC_HELP_STRING([--with-gtk], [Build gtk client]),
64                 [want_gtk=$withval],
65                 [want_gtk=$have_gtk])
66use_gtk=no
67if test "x$want_gtk" = "xyes" ; then
68    if test "x$have_gtk" = "xyes"; then
69      AM_PATH_GLIB_2_0($GLIB_MINIMUM,,exit 1,gobject gmodule gthread)
70      AM_PATH_GTK_2_0($GTK_MINIMUM,,exit 1,gthread)
71      use_gtk=yes
72    else
73      AC_MSG_ERROR("GTK+ not found!")
74    fi
75fi
76AM_CONDITIONAL([WITH_GTK],[test "x$use_gtk" = "xyes"])
77
78
79
80dnl ----------------------------------------------------------------------------
81dnl
82dnl  platform-specific stuff.
83
84AC_CANONICAL_HOST
85beos="no"
86darwin="no"
87msw="no"
88case $host_os in
89
90   *cygwin|*mingw32*)
91     msw="yes"
92     CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows"
93     CPPFLAGS="$CPPFLAGS -DWIN32_LEAN_AND_MEAN"
94     LIBS="$LIBS -lshell32 -lws2_32"
95     transmissionlocaledir="locale"
96     if test -z "$host_alias"; then
97       hostaliaswindres=
98     else
99       hostaliaswindres="$host_alias-windres";
100     fi
101     AC_PATH_PROGS([WINDRES], [windres $hostaliaswindres $host_os-windres])
102     if test "x$WINDRES" = "x"; then
103       AC_MSG_ERROR([windres could not be found within your path.])
104     fi
105     AC_SUBST(WINDRES)
106     ;;
107
108  *BeOS*)
109    beos="yes"
110    RELEASE=`uname -r`
111    case $RELEASE in
112      6.*|5.0.4) # Zeta or R5 / BONE beta 7
113        ;;
114      5.0*)       # R5 / net_server
115        CPPFLAGS="$CPPFLAGS -DBEOS_NETSERVER"
116        ;;
117      *)
118        AC_MSG_ERROR("Unsupported BeOS version")
119        ;;
120    esac
121    GCCVER=`$CC -dumpversion`
122    case $GCCVER in
123      2.95.3*|3*|4*)
124        ;;
125      2.9*)
126        BEOS_OLDCC=yes
127        ;;
128      *)
129        AC_MSG_ERROR("Unsupported gcc version")
130        ;;
131    esac
132    ;;
133
134  *darwin*)
135    darwin="yes"
136    # Make sure the Universal SDK is installed
137    if test ! -d /Developer/SDKs/MacOSX10.4u.sdk; then
138      cat << EOF
139You need to install the Universal SDK in order to build Transmission:
140  Get your Xcode CD or package
141  Restart the install
142  When it gets to "Installation Type", select "Customize"
143  Select "Mac OS X 10.4 (Universal) SDK" under "Cross Development"
144  Finish the install.
145EOF
146      exit 1
147    fi
148    ;;
149
150  *solaris*)
151    LIBS="$LIBS -lsocket -lnsl"
152    ;;
153
154esac
155AM_CONDITIONAL([HAVE_BEOS],[test "x$beos" = "xyes"])
156AM_CONDITIONAL([HAVE_DARWIN],[test "x$darwin" = "xyes"])
157AM_CONDITIONAL([HAVE_WINDOWS],[test "x$msw" = "xyes"])
158
159
160dnl ----------------------------------------------------------------------------
161dnl
162dnl  Version files
163
164
165dnl constraint: strlen(MAJOR MINOR MAINT BETA) must be 4
166dnl convention: BETA: "Z" for a beta, "0" for a stable
167MAJOR="0"
168MINOR="7"
169MAINT="2"
170BETA="Z"
171STRING=0.80-svn
172REV=`svnversion -n`
173AC_SUBST(VERSION_MAJOR,[$MAJOR])
174AC_SUBST(VERSION_MINOR,[$MINOR])
175AC_SUBST(VERSION_MAINTENANCE,[$MAINT])
176AC_SUBST(VERSION_REVISION,[$REV])
177AC_SUBST(VERSION_BETA,[$BETA])
178AC_SUBST(VERSION_STRING,[$MAJOR.$MINOR$MAINT$BETA])
179AC_SUBST(VERSION_STRING_LONG,[$MAJOR.$MINOR$MAINT$BETA-r$REV])
180
181dnl for macosx
182AC_SUBST(BUNDLE_VERSION,[$REV])
183dnl if it's a beta version, include the svn revision number
184if test x${BETA} = "xZ"; then
185  AC_SUBST(VERSION_PACKAGE,$MAJOR.$MINOR$MAINT$BETA-r$REV)
186else
187  AC_SUBST(VERSION_PACKAGE,$MAJOR.$MINOR$MAINT$BETA)
188fi
189AC_SUBST(VERSION_PACKAGE)
190
191
192
193dnl ----------------------------------------------------------------------------
194dnl
195dnl  Generate the output
196
197AC_CONFIG_FILES([Makefile
198                 transmission.spec
199                 beos/Makefile
200                 cli/Makefile
201                 daemon/Makefile
202                 gtk/Makefile
203                 libtransmission/Makefile
204                 libtransmission/version.h
205                 macosx/Makefile
206                 macosx/Info.plist])
207
208AC_OUTPUT
209
210echo "
211
212Configuration:
213
214        Source code location:  ${srcdir}
215        Compiler:              ${CXX}
216        Build BeOS client:     ${beos}
217        Build Daemon:          ${use_libevent}
218        Build GTK+ client:     ${use_gtk}
219        Build OS X client:     ${darwin}
220
221"
Note: See TracBrowser for help on using the repository browser.