diff options
author | Mauricio Günther <mauricio@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-03-09 15:28:09 +0000 |
---|---|---|
committer | Mauricio Günther <mauricio@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-03-09 15:28:09 +0000 |
commit | 4f69ffa102abc26c4865cbb0726ce85013f5fa16 (patch) | |
tree | 47d79655442fab95a8b7493994a53da88e8d04d2 /configure.ac | |
parent | 43bd701cc95fd69b8b698cf7651f804c156749fe (diff) | |
download | gnunet-fuse-4f69ffa102abc26c4865cbb0726ce85013f5fa16.tar.gz gnunet-fuse-4f69ffa102abc26c4865cbb0726ce85013f5fa16.zip |
clean up and add new gnunet-fuse for gnunet 0.9
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 205 |
1 files changed, 167 insertions, 38 deletions
diff --git a/configure.ac b/configure.ac index 05c6884..d0cf129 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,62 +1,191 @@ | |||
1 | AC_INIT(gnunet-fuse, 0.8.0c) | 1 | # This file is part of GNUnet. |
2 | AM_INIT_AUTOMAKE | 2 | # (C) 2001-2011 Christian Grothoff (and other contributing authors) |
3 | AM_CONFIG_HEADER(config.h) | 3 | # |
4 | # GNUnet is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License as published | ||
6 | # by the Free Software Foundation; either version 2, or (at your | ||
7 | # option) any later version. | ||
8 | # | ||
9 | # GNUnet is distributed in the hope that it will be useful, but | ||
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | # General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with GNUnet; see the file COPYING. If not, write to the | ||
16 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
17 | # Boston, MA 02111-1307, USA. | ||
18 | # | ||
19 | # | ||
20 | # Process this file with autoconf to produce a configure script. | ||
21 | # | ||
22 | AC_PREREQ(2.61) | ||
23 | AC_INIT([gnunet-ext],[0.0.0],[bug-gnunet@gnu.org]) | ||
24 | AM_INIT_AUTOMAKE([gnunet-ext], [0.0.0]) | ||
25 | AM_CONFIG_HEADER(gnunet_ext_config.h) | ||
4 | 26 | ||
27 | AH_TOP([#define _GNU_SOURCE 1]) | ||
28 | |||
29 | AC_ISC_POSIX | ||
30 | AC_PROG_AWK | ||
31 | AC_PROG_CC | ||
32 | |||
33 | AC_PROG_MKDIR_P | ||
34 | AC_PROG_CPP | ||
35 | AC_PROG_INSTALL | ||
36 | AC_PROG_LN_S | ||
37 | AC_PROG_MAKE_SET | ||
38 | AC_LIBTOOL_WIN32_DLL | ||
5 | AC_PROG_CC | 39 | AC_PROG_CC |
6 | AM_PROG_CC_C_O | 40 | AM_PROG_CC_STDC |
7 | AC_C_CHAR_UNSIGNED | 41 | AC_HEADER_STDC |
42 | AC_CANONICAL_HOST | ||
43 | |||
44 | # dynamic libraries/plugins | ||
45 | AC_DISABLE_STATIC | ||
46 | AC_PROG_LIBTOOL | ||
47 | |||
48 | AC_SYS_LARGEFILE | ||
49 | AC_FUNC_FSEEKO | ||
50 | |||
51 | CFLAGS="-Wall $CFLAGS" | ||
52 | # use '-fno-strict-aliasing', but only if the compiler can take it | ||
53 | if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; | ||
54 | then | ||
55 | CFLAGS="-fno-strict-aliasing $CFLAGS" | ||
56 | fi | ||
8 | 57 | ||
9 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH | ||
10 | 58 | ||
11 | PKG_CHECK_MODULES(GLIB, [glib-2.0]) | 59 | # Check system type |
12 | PKG_CHECK_MODULES(FUSE, [fuse >= 2.6]) | 60 | case "$host_os" in |
61 | *darwin* | *rhapsody* | *macosx*) | ||
62 | AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system]) | ||
63 | CFLAGS="-no-cpp-precomp $CFLAGS" | ||
64 | LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS" | ||
65 | ;; | ||
66 | linux*) | ||
67 | AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system]) | ||
68 | ;; | ||
69 | freebsd*) | ||
70 | AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) | ||
71 | AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system]) | ||
72 | ;; | ||
73 | openbsd*) | ||
74 | AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) | ||
75 | AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system]) | ||
76 | ;; | ||
77 | netbsd*) | ||
78 | AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) | ||
79 | AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system]) | ||
80 | ;; | ||
81 | *solaris*) | ||
82 | AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system]) | ||
83 | AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work]) | ||
84 | build_target="solaris" | ||
85 | ;; | ||
86 | *arm-linux*) | ||
87 | AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system]) | ||
88 | ;; | ||
89 | *cygwin*) | ||
90 | AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) | ||
91 | AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) | ||
92 | AC_CHECK_LIB(intl, gettext) | ||
93 | LDFLAGS="$LDFLAGS -no-undefined" | ||
94 | build_target="cygwin" | ||
95 | ;; | ||
96 | *mingw*) | ||
97 | AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) | ||
98 | AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) | ||
99 | AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system]) | ||
100 | AC_CHECK_LIB(intl, gettext) | ||
101 | LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32" | ||
102 | CFLAGS="-mms-bitfields $CFLAGS" | ||
103 | build_target="mingw" | ||
104 | ;; | ||
105 | *) | ||
106 | AC_MSG_RESULT(Unrecognised OS $host_os) | ||
107 | AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) | ||
108 | ;; | ||
109 | esac | ||
110 | |||
111 | AM_CONDITIONAL(MINGW, test "$build_target" = "mingw") | ||
112 | |||
113 | # check for gettext | ||
114 | AM_GNU_GETTEXT_VERSION([0.18.1]) | ||
115 | AM_GNU_GETTEXT([external]) | ||
116 | |||
117 | AC_CHECK_HEADERS([errno.h stdio.h unistd.h locale.h sys/stat.h sys/types.h langinfo.h libintl.h unistd.h stddef.h argz.h sys/socket.h netinet/in.h stdarg.h]) | ||
13 | 118 | ||
14 | # test for GNUnet core | 119 | # test for GNUnet core |
15 | gnunet=0 | 120 | gnunet=0 |
16 | AC_MSG_CHECKING([for GNUnet core]) | 121 | lookin=${prefix} |
122 | backup_LIBS="$LIBS" | ||
123 | backup_CFLAGS="$CFLAGS " | ||
124 | backup_CPPFLAGS="$CPPFLAGS" | ||
125 | GNUNET_CFLAGS="" | ||
126 | GNUNET_CPPFLAGS="" | ||
127 | GNUNET_LIBS="" | ||
128 | AC_MSG_CHECKING(for GNUnet core) | ||
17 | AC_ARG_WITH(gnunet, | 129 | AC_ARG_WITH(gnunet, |
18 | [ --with-gnunet=PFX Base of GNUnet installation], | 130 | [ --with-gnunet=PFX Base of GNUnet installation], |
19 | [AC_MSG_RESULT([$with_gnunet]) | 131 | [AC_MSG_RESULT([$with_gnunet]) |
20 | case $with_gnunet in | 132 | case $with_gnunet in |
21 | no) | 133 | no) |
134 | lookin="" | ||
22 | ;; | 135 | ;; |
23 | yes) | 136 | yes) |
24 | AC_CHECK_HEADERS(GNUnet/gnunet_ecrs_lib.h, | 137 | lookin="${prefix}" |
25 | AC_CHECK_LIB([gnunetecrs], [GNUNET_ECRS_file_download_partial], | ||
26 | gnunet=1)) | ||
27 | ;; | 138 | ;; |
28 | *) | 139 | *) |
29 | LDFLAGS="-L$with_gnunet/lib $LDFLAGS" | 140 | lookin="$with_gnunet" |
30 | LIBPATH="$with_gnunet/lib $LIBPATH" | ||
31 | CPPFLAGS="-I$with_gnunet/include $CPPFLAGS" | ||
32 | CFLAGS="-I$with_gnunet/include $CFLAGS" | ||
33 | INCLUDEPATH="$with_gnunet/include $INCLUDEPATH" | ||
34 | AC_CHECK_HEADERS(GNUnet/gnunet_ecrs_lib.h, | ||
35 | AC_CHECK_LIB([gnunetecrs], [GNUNET_ECRS_file_download_partial], | ||
36 | EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH" | ||
37 | gnunet=1)) | ||
38 | ;; | 141 | ;; |
39 | esac | 142 | esac |
40 | ], | 143 | ], |
41 | [AC_MSG_RESULT([--with-gnunet not specified]) | 144 | [ |
42 | AC_CHECK_HEADERS(GNUnet/gnunet_ecrs_lib.h, | 145 | AC_MSG_RESULT([--with-gnunet not specified]) |
43 | AC_CHECK_LIB([gnunetecrs], [GNUNET_ECRS_file_download_partial], | 146 | PKG_CHECK_MODULES([GNUNET], [gnunetutil >= 0.9.0], gnunet=1) |
44 | gnunet=1))]) | 147 | ] |
45 | if test "$gnunet" != 1 | 148 | ) |
149 | |||
150 | if test "x$gnunet" == "x0" -a ! "x$lookin" == "x" | ||
46 | then | 151 | then |
47 | AC_MSG_ERROR([gnunet-fuse requires GNUnet]) | 152 | AC_MSG_CHECKING(for GNUnet util library in $lookin) |
153 | GNUNET_LIBS="-L${lookin}/lib" | ||
154 | GNUNET_CFLAGS="-I${lookin}/include" | ||
155 | GNUNET_CPPFLAGS="-I${lookin}/include" | ||
156 | LIBS="$GNUNET_LIBS $backup_LIBS" | ||
157 | CFLAGS="$GNUNET_CFLAGS $backup_CFLAGS" | ||
158 | CPPFLAGS="$GNUNET_CPPFLAGS $backup_CPPFLAGS" | ||
159 | AC_CHECK_HEADERS([gnunet/gnunet_util_lib.h], | ||
160 | AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_], | ||
161 | [ | ||
162 | gnunet=1 | ||
163 | EXT_LIB_PATH="-L${lookin}/lib $EXT_LIB_PATH" | ||
164 | ] | ||
165 | ),,[#include <gnunet/platform.h>] | ||
166 | ) | ||
48 | fi | 167 | fi |
49 | AC_CHECK_HEADERS([GNUnet/gnunet_util.h GNUnet/gnunet_getoption_lib.h],, | ||
50 | AC_MSG_ERROR([compiling gnunet-fuse requires GNUnet core headers] | ||
51 | )) | ||
52 | 168 | ||
53 | AC_CHECK_LIB(gnunetutil,GNUNET_init,, | 169 | if test "x$gnunet" == "x0" |
54 | AC_MSG_ERROR([gnunet-fuse requires GNUnet-Util])) | 170 | then |
55 | AC_CHECK_LIB(gnunetecrs,GNUNET_ECRS_file_download_partial,, | 171 | AC_MSG_ERROR([gnunet-gtk requires GNUnet]) |
56 | AC_MSG_ERROR([gnunet-fuse requires ECRS])) | 172 | fi |
173 | |||
174 | AC_SUBST(GNUNET_CFLAGS) | ||
175 | AC_SUBST(GNUNET_LIBS) | ||
176 | LIBS="$backup_LIBS" | ||
177 | CFLAGS="$backup_CFLAGS" | ||
178 | CPPFLAGS="$backup_CPPFLAGS" | ||
179 | |||
180 | AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data]) | ||
57 | 181 | ||
58 | CFLAGS="$CFLAGS -Wall -W $GLIB_CFLAGS $FUSE_CFLAGS" | 182 | # Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h. |
59 | LIBS="$LIBS $GLIB_LIBS $FUSE_LIBS" | 183 | packagesrcdir=`cd $srcdir && pwd` |
184 | AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir]) | ||
60 | 185 | ||
61 | AC_CONFIG_FILES([Makefile]) | 186 | AC_OUTPUT([ po/Makefile.in |
62 | AC_OUTPUT | 187 | Makefile |
188 | src/Makefile | ||
189 | src/include/Makefile | ||
190 | src/ext/Makefile | ||
191 | ]) | ||