Mercurial > libpst
comparison configure.in @ 118:0f1492b7fe8b
patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
add processing for pst files of type 0x0f
start adding support for properly building and installing libpst.so and the header files required to use it.
remove version.h since the version number is now in config.h
more const correctness issues regarding getopt()
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 31 Jan 2009 12:12:36 -0800 |
parents | ed2a260bbb98 |
children | 6395ced2b8b2 |
comparison
equal
deleted
inserted
replaced
117:0a3d854b53f6 | 118:0f1492b7fe8b |
---|---|
1 AC_PREREQ(2.59) | 1 AC_PREREQ(2.59) |
2 AC_INIT(libpst,0.6.25,carl@five-ten-sg.com) | 2 AC_INIT(libpst,0.6.26,carl@five-ten-sg.com) |
3 AC_CONFIG_SRCDIR([config.h.in]) | 3 AC_CONFIG_SRCDIR([config.h.in]) |
4 AC_CONFIG_HEADER([config.h]) | 4 AC_CONFIG_HEADER([config.h]) |
5 | 5 |
6 AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION) | 6 AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION) |
7 | 7 |
8 AC_CANONICAL_HOST | |
9 | |
10 # Check for Win32 | |
11 AC_MSG_CHECKING([for Win32]) | |
12 case "$host" in | |
13 *-mingw*) | |
14 os_win32=yes | |
15 ;; | |
16 *) | |
17 os_win32=no | |
18 ;; | |
19 esac | |
20 AC_MSG_RESULT($os_win32) | |
21 AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"]) | |
22 | |
8 | 23 |
9 # Checks for programs. | 24 # Checks for programs. |
10 my_build_dii=yes | 25 # The following lines adds the --enable-dii option to configure: |
11 AC_PATH_PROG(CONVERT, convert) | 26 # |
12 if test "x$CONVERT" = "x" ; then | 27 # Give the user the choice to enter one of these: |
13 AC_MSG_WARN([convert not found. pst2dii disabled]) | 28 # --enable-dii |
14 my_build_dii=no | 29 # --enable-dii=yes |
15 else | 30 # --enable-dii=no |
16 # The following lines adds the --enable-dii option to configure: | 31 # |
17 # | 32 AC_MSG_CHECKING([whether we are enabling dii utility]) |
18 # Give the user the choice to enter one of these: | 33 AC_ARG_ENABLE(dii, |
19 # --enable-dii | 34 AC_HELP_STRING([--enable-dii], [enable dii utility]), |
20 # --enable-dii=yes | 35 [ |
21 # --enable-dii=no | 36 case "${enableval}" in |
22 # | 37 yes) ;; |
23 AC_MSG_CHECKING([whether we are enabling dii utility]) | 38 no) ;; |
24 AC_ARG_ENABLE(dii, | 39 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dii) ;; |
25 AC_HELP_STRING([--enable-dii], [enable dii utility]), | 40 esac |
26 [if test "${enable_dii}" = "no" ; then | 41 ], |
27 AC_MSG_RESULT([no]) | 42 # default if not specified |
28 my_build_dii=no | 43 enable_dii=yes |
29 else | 44 ) |
30 AC_MSG_RESULT([yes]) | 45 AC_MSG_RESULT([$enable_dii]) |
31 fi], | 46 if test "$enable_dii" = "yes"; then |
32 # Default value for configure | 47 AC_PATH_PROG(CONVERT, convert) |
33 AC_MSG_RESULT([yes]) | 48 if test "x$CONVERT" = "x" ; then |
34 ) | 49 AC_MSG_WARN([convert not found. pst2dii disabled]) |
35 fi | 50 enable_dii=no |
36 AM_CONDITIONAL(BUILD_DII, test $my_build_dii = yes) | 51 fi |
52 fi | |
53 if test "$enable_dii" = "yes"; then | |
54 AC_CHECK_HEADER([gd.h], , [ | |
55 enable_dii=no | |
56 AC_MSG_WARN([gd.h not found. pst2dii disabled]) | |
57 ]) | |
58 fi | |
59 AM_CONDITIONAL(BUILD_DII, [test "$enable_dii" = "yes"]) | |
37 | 60 |
38 | 61 |
39 # Checks for programs. | 62 # Checks for programs. |
40 AC_PROG_CXX | 63 AC_PROG_CXX |
41 AC_PROG_CC | 64 AC_PROG_CC |
65 AM_PROG_CC_C_O | |
42 AC_PROG_CPP | 66 AC_PROG_CPP |
43 AC_PROG_INSTALL | 67 AC_PROG_INSTALL |
44 AC_PROG_LN_S | 68 AC_PROG_LN_S |
45 AC_PROG_LIBTOOL | 69 AC_PROG_LIBTOOL |
46 AC_PROG_MAKE_SET | 70 AC_PROG_MAKE_SET |
49 AC_SYS_LARGEFILE | 73 AC_SYS_LARGEFILE |
50 AC_CHECK_SIZEOF(off_t) | 74 AC_CHECK_SIZEOF(off_t) |
51 | 75 |
52 # Checks for header files. | 76 # Checks for header files. |
53 AC_CHECK_HEADER([unistd.h], | 77 AC_CHECK_HEADER([unistd.h], |
54 AM_CONDITIONAL(NEED_XGETOPT, [test yes = no ]), | 78 AM_CONDITIONAL(NEED_XGETOPT, [test yes = no]), |
55 AM_CONDITIONAL(NEED_XGETOPT, [test yes = yes]) | 79 AM_CONDITIONAL(NEED_XGETOPT, [test yes = yes]) |
56 ) | 80 ) |
57 AC_HEADER_DIRENT | 81 AC_HEADER_DIRENT |
58 AC_HEADER_STDC | 82 AC_HEADER_STDC |
59 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdint.h stdlib.h string.h sys/param.h unistd.h wchar.h]) | 83 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdint.h stdlib.h string.h sys/param.h unistd.h wchar.h]) |
60 if test "$my_build_dii" = "yes"; then | |
61 AC_CHECK_HEADERS([gd.h]) | |
62 fi | |
63 | 84 |
64 # Checks for typedefs, structures, and compiler characteristics. | 85 # Checks for typedefs, structures, and compiler characteristics. |
65 AC_HEADER_STDBOOL | 86 AC_HEADER_STDBOOL |
66 AC_C_CONST | 87 AC_C_CONST |
67 AC_TYPE_OFF_T | 88 AC_TYPE_OFF_T |
70 | 91 |
71 # Checks for library functions. | 92 # Checks for library functions. |
72 AC_FUNC_FSEEKO | 93 AC_FUNC_FSEEKO |
73 AC_FUNC_LSTAT | 94 AC_FUNC_LSTAT |
74 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK | 95 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK |
75 AC_FUNC_MALLOC | 96 if test "$cross_compiling" != "yes"; then |
76 AC_FUNC_MKTIME | 97 AC_FUNC_MALLOC |
77 AC_FUNC_REALLOC | 98 AC_FUNC_MKTIME |
99 AC_FUNC_REALLOC | |
100 fi | |
78 AC_FUNC_STRFTIME | 101 AC_FUNC_STRFTIME |
79 AC_FUNC_VPRINTF | 102 AC_FUNC_VPRINTF |
80 AC_CHECK_FUNCS([memchr memmove memset strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol]) | 103 AC_CHECK_FUNCS([memchr memmove memset strcasecmp strncasecmp strchr strdup strerror strpbrk strrchr strstr strtol]) |
81 | 104 |
82 # iconv on mac is a library | 105 # iconv on mac is a library |
83 SAVELIBS="${LIBS}" | 106 SAVELIBS="$LIBS" |
84 AC_SEARCH_LIBS([iconv_open], [iconv]) | 107 AC_SEARCH_LIBS([iconv_open], [iconv]) |
85 if test "x${SAVELIBS}" != "x${LIBS}"; then | 108 if test "$SAVELIBS" != "$LIBS"; then |
86 all_libraries="-L/usr/lib $all_libraries" | 109 all_libraries="-L/usr/lib $all_libraries" |
87 AC_SUBST(all_libraries) | 110 AC_SUBST(all_libraries) |
88 AC_MSG_WARN([This should be building on Mac OSX, adding /usr/lib to the library path]) | 111 AC_MSG_WARN([This should be building on Mac OSX, adding /usr/lib to the library path]) |
89 fi | 112 fi |
90 | 113 |
91 AC_MSG_CHECKING([if iconv uses const arguments]) | 114 AC_MSG_CHECKING([if iconv uses const arguments]) |
92 AC_LANG_PUSH([C++]) | 115 AC_LANG_PUSH([C++]) |
93 AC_COMPILE_IFELSE([ | 116 AC_COMPILE_IFELSE([ |
94 #include <iconv.h> | 117 #include <iconv.h> |
95 int main(int argc, char **argv) | 118 #include <stddef.h> |
119 int main(int argc, char* const* argv) | |
96 { | 120 { |
97 size_t inlen = 100; | 121 size_t inlen = 100; |
98 char buffer[[inlen]]; | 122 char buffer[[inlen]]; |
99 char *p = buffer; | 123 char *p = buffer; |
100 size_t utf8_len = 2 * inlen + 1; | 124 size_t utf8_len = 2 * inlen + 1; |
120 # --enable-pst-debug=yes | 144 # --enable-pst-debug=yes |
121 # --enable-pst-debug=no | 145 # --enable-pst-debug=no |
122 # | 146 # |
123 AC_MSG_CHECKING([whether we are forcing debug dump file creation]) | 147 AC_MSG_CHECKING([whether we are forcing debug dump file creation]) |
124 AC_ARG_ENABLE(pst-debug, | 148 AC_ARG_ENABLE(pst-debug, |
125 AC_HELP_STRING([--enable-pst-debug], [force debug dump file creation]), | 149 AC_HELP_STRING([--enable-pst-debug], [force debug dump file creation]), |
126 [if test "${enable_pst_debug}" = "no" ; then | 150 [ |
127 AC_MSG_RESULT([no]) | 151 case "${enableval}" in |
128 else | 152 yes) ;; |
129 AC_DEFINE(DEBUG_ALL, 1, Define to 1 to force debug dump file creation) | 153 no) ;; |
130 AC_MSG_RESULT([yes]) | 154 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pst-debug) ;; |
131 fi], | 155 esac |
132 # Default value for configure | 156 ], |
133 AC_MSG_RESULT([no]) | 157 # default if not specified |
134 ) | 158 enable_pst_debug=no |
159 ) | |
160 AC_MSG_RESULT([$enable_pst_debug]) | |
161 if test "$enable_pst_debug" = "yes"; then | |
162 AC_DEFINE(DEBUG_ALL, 1, Define to 1 to force debug dump file creation) | |
163 fi | |
135 | 164 |
136 | 165 |
137 # The following lines adds the --enable-libpst-shared option to configure: | 166 # The following lines adds the --enable-libpst-shared option to configure: |
138 # | 167 # |
139 # Give the user the choice to enter one of these: | 168 # Give the user the choice to enter one of these: |
141 # --enable-libpst-shared=yes | 170 # --enable-libpst-shared=yes |
142 # --enable-libpst-shared=no | 171 # --enable-libpst-shared=no |
143 # | 172 # |
144 AC_MSG_CHECKING([whether we are building libpst shared object]) | 173 AC_MSG_CHECKING([whether we are building libpst shared object]) |
145 AC_ARG_ENABLE(libpst-shared, | 174 AC_ARG_ENABLE(libpst-shared, |
146 AC_HELP_STRING([--enable-libpst-shared], [build libpst shared object]), | 175 AC_HELP_STRING([--enable-libpst-shared], [build libpst shared object]), |
147 [if test "${enable_libpst_shared}" = "no" ; then | 176 [ |
148 AC_MSG_RESULT([no]) | 177 case "${enableval}" in |
149 AM_CONDITIONAL(BUILD_LIBPST_SHARED, test 0 = 1) | 178 yes) ;; |
150 else | 179 no) ;; |
151 AC_MSG_RESULT([yes]) | 180 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libpst-shared) ;; |
152 AM_CONDITIONAL(BUILD_LIBPST_SHARED, test 1 = 1) | 181 esac |
153 fi], | 182 ], |
154 # Default value for configure | 183 # default if not specified |
155 [AC_MSG_RESULT([no]) | 184 enable_libpst_shared=no |
156 AM_CONDITIONAL(BUILD_LIBPST_SHARED, test 0 = 1)] | 185 ) |
157 ) | 186 AC_MSG_RESULT([$enable_libpst_shared]) |
187 enable_static_tools=yes | |
188 if test "$enable_libpst_shared" = "yes"; then | |
189 enable_shared=yes | |
190 enable_static_tools=no | |
191 fi | |
192 | |
193 | |
194 # needed by STATIC_TOOLS in src/Makefile.am | |
195 AC_SUBST(PST_OBJDIR, [$objdir]) | |
196 | |
197 | |
198 # The following lines adds the --enable-static-tools option to configure: | |
199 # | |
200 # Give the user the choice to enter one of these: | |
201 # --enable-static-tools | |
202 # --enable-static-tools=yes | |
203 # --enable-static-tools=no | |
204 # | |
205 AC_MSG_CHECKING([whether to link command line tools with libpst statically]) | |
206 AC_ARG_ENABLE([static-tools], | |
207 AC_HELP_STRING([--enable-static-tools], [link command line tools with libpst statically]), | |
208 [ | |
209 case "${enableval}" in | |
210 yes) ;; | |
211 no) ;; | |
212 *) AC_MSG_ERROR(bad value ${enableval} for --static-tools) ;; | |
213 esac | |
214 ], | |
215 [ | |
216 enable_static_tools=no | |
217 ]) | |
218 AC_MSG_RESULT([$enable_static_tools]) | |
219 AM_CONDITIONAL(STATIC_TOOLS, [test "$enable_static_tools" = "yes"]) | |
220 if test "$enable_static_tools" = "yes"; then | |
221 enable_static="yes" | |
222 fi | |
223 | |
224 | |
225 AC_MSG_CHECKING([system enable shared]) | |
226 AC_MSG_RESULT([$enable_shared]) | |
227 AC_MSG_CHECKING([system enable static]) | |
228 AC_MSG_RESULT([$enable_static]) | |
229 | |
158 | 230 |
159 | 231 |
160 AC_OUTPUT( \ | 232 AC_OUTPUT( \ |
161 Makefile \ | 233 Makefile \ |
234 debian/Makefile \ | |
162 debian/changelog \ | 235 debian/changelog \ |
163 debian/Makefile \ | |
164 libpst.spec \ | |
165 libpst.pc \ | |
166 html/Makefile \ | 236 html/Makefile \ |
167 info/Makefile \ | 237 info/Makefile \ |
238 libpst.pc \ | |
239 libpst.spec \ | |
240 libpst/Makefile \ | |
168 man/Makefile \ | 241 man/Makefile \ |
169 src/Makefile \ | 242 src/Makefile \ |
170 src/version.h \ | |
171 src/pst2dii.cpp \ | 243 src/pst2dii.cpp \ |
172 xml/Makefile \ | 244 xml/Makefile \ |
173 xml/libpst \ | 245 xml/libpst \ |
174 ) | 246 ) |