File: configure.in

package info (click to toggle)
libwps 0.1.2-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,104 kB
  • ctags: 695
  • sloc: sh: 8,931; cpp: 4,466; makefile: 367
file content (247 lines) | stat: -rw-r--r-- 5,831 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
AC_INIT(src/lib/WPS8.cpp)

AM_CONFIG_HEADER(config.h)

WPS_MAJOR_VERSION=0
WPS_MINOR_VERSION=1
WPS_MICRO_VERSION=2

WPS_VERSION="$WPS_MAJOR_VERSION.$WPS_MINOR_VERSION.$WPS_MICRO_VERSION"

AC_SUBST(WPS_MAJOR_VERSION)
AC_SUBST(WPS_MINOR_VERSION)
AC_SUBST(WPS_MICRO_VERSION)
AC_SUBST(WPS_VERSION)

dnl # libtool versioning
dnl LT_RELEASE=$WPS_MAJOR_VERSION.$WPS_MINOR_VERSION
dnl AC_SUBST(LT_RELEASE)

LT_CURRENT=`expr 10 '*' $WPS_MAJOR_VERSION + $WPS_MINOR_VERSION`
LT_REVISION=$WPS_MICRO_VERSION
# For 1.0.0 comment the first line and uncomment the second
LT_AGE=0
# LT_AGE=$WPS_MINOR_VERSION
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_CURRENT_MINUS_AGE)

AM_INIT_AUTOMAKE(libwps, $WPS_VERSION)

AC_PROG_CC

AC_PROG_CXX

AC_PROG_INSTALL

AC_LIBTOOL_WIN32_DLL

AC_ARG_ENABLE([static-tools],[  --enable-static-tools  Link tools statically],[
       case "${enableval}" in
          yes) enable_static_tools="yes" ;;
          no)  enable_static_tools="no" ;;
            *) AC_MSG_ERROR(bad value ${enableval} for --static-tools) ;;
       esac
],[
       enable_static_tools="no"
])

AM_CONDITIONAL(STATIC_TOOLS, test x$enable_static_tools = xyes)

if test x$enable_static_tools = xno; then
	AC_DISABLE_STATIC
fi

if test x$enable_static_tools = xyes; then
	enable_static="yes"
fi

AC_PROG_LIBTOOL

AC_SUBST(WPS_OBJDIR, [$objdir])

AC_PATH_PROG(PKG_CONFIG, pkg-config, no)

dnl ***********************************************************************************

PKG_CHECK_MODULES(LIBWPS,[
    libwpd-0.8
    ])

dnl stream
dnl
test_stream=true
AC_ARG_WITH(stream,
	[  --without-stream        Do not build input stream implementation],
	if test "x$withval" = xno; then
		test_stream=false
	fi
)

AM_CONDITIONAL(WITH_LIBWPS_STREAM, $test_stream )

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    native_win32=yes
    LIBWPS_WIN32_RESOURCE=libwps-win32res.lo
    LIBWPS_STREAM_WIN32_RESOURCE=libwps-stream-win32res.lo
    WPS2HTML_WIN32_RESOURCE=wps2html-win32res.lo
    WPS2TEXT_WIN32_RESOURCE=wps2text-win32res.lo
    WPS2RAW_WIN32_RESOURCE=wps2raw-win32res.lo
    ;;
  *)
    native_win32=no
    LIBWPS_WIN32_RESOURCE=
    LIBWPS_STREAM_WIN32_RESOURCE=
    WPS2HTML_WIN32_RESOURCE=
    WPS2TEXT_WIN32_RESOURCE=
    WPS2RAW_WIN32_RESOURCE=
    ;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
AC_SUBST(LIBWPS_WIN32_RESOURCE)
AC_SUBST(LIBWPS_STREAM_WIN32_RESOURCE)
AC_SUBST(WPS2HTML_WIN32_RESOURCE)
AC_SUBST(WPS2TEXT_WIN32_RESOURCE)
AC_SUBST(WPS2RAW_WIN32_RESOURCE)

test_docs=true
if test "x$native_win32" = xyes; then
	test_docs=false
fi
AC_ARG_WITH(docs,
	[  --without-docs          Do not build documentation],
	if test "x$withval" = xno; then
		test_docs=false
	fi
	if test "x$withval" = xyes; then
		test_docs=true
	fi
)

if test "x$test_docs" = xtrue; then
	AC_PATH_PROG(DOXYGEN, doxygen)
	if test -z "$DOXYGEN"; then
		AC_MSG_WARN([*** Could not find doxygen in your PATH.])
		AC_MSG_WARN([*** The documentation will not be built.])
		test_docs=false
	fi
fi

AM_CONDITIONAL(WITH_LIBWPS_DOCS, $test_docs )

AC_MSG_CHECKING([for Win32 platform in general])
case "$host" in
  *-*-mingw*|*-*-cygwin*)
    platform_win32=yes
    ;;
  *)
    platform_win32=no
    ;;
esac
AC_MSG_RESULT($platform_win32)
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)

AC_MSG_CHECKING([for Darwin (Mac OS X) platform])
case "$host" in
  *-*-darwin*)
    platform_darwin=yes
    ;;
  *)
    platform_darwin=no
    ;;
esac
AC_MSG_RESULT($platform_darwin)
AM_CONDITIONAL(PLATFORM_DARWIN, test "$platform_darwin" = yes)

AC_ARG_ENABLE(debug,[  --enable-debug    Turn on debugging],[
	case "${enableval}" in
	   yes)	debug=true ;
		DEBUG_CXXFLAGS="-DDEBUG -g" ;;
	    no)	debug=false ;
		DEBUG_CXXFLAGS="-DNDEBUG" ;;
	     *)	AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
	esac
],[	debug=false
	DEBUG_CXXFLAGS="-DNDEBUG" 
])

# AM_CONDITIONAL(DEBUG, test x$debug = xtrue)

# Courtesy of Glib: Ensure MSVC-compatible struct packing convention 
# is used when compiling for Win32 with gcc.
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
# gcc2 uses "-fnative-struct".
if test x"$native_win32" = xyes; then
  AC_CHECK_TOOL(WINDRES, windres)
  if test x"$GCC" = xyes; then
    msnative_struct=''
    AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
    if test -z "$ac_cv_prog_CC"; then
      our_gcc="$CC"
    else
      our_gcc="$ac_cv_prog_CC"
    fi
    case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
      2.)
	if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
	  msnative_struct='-fnative-struct'
	fi
	;;
      *)
	if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
	  msnative_struct='-mms-bitfields'
	fi
	;;
    esac
    if test x"$msnative_struct" = x ; then
      AC_MSG_RESULT([no way])
      AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
    else
      CFLAGS="$CFLAGS $msnative_struct"
      CXXFLAGS="$CXXFLAGS $msnative_struct"
      AC_MSG_RESULT([${msnative_struct}])
    fi
  fi
fi 

LIBWPS_CXXFLAGS="$LIBWPS_CFLAGS"

AC_SUBST(LIBWPS_CXXFLAGS)
AC_SUBST(DEBUG_CXXFLAGS)
AC_SUBST(LIBWPS_LIBS)

AC_OUTPUT([
Makefile
src/Makefile
src/conv/Makefile
src/conv/html/Makefile
src/conv/html/wps2html.rc
src/conv/raw/Makefile
src/conv/raw/wps2raw.rc
src/conv/text/Makefile
src/conv/text/wps2text.rc
src/lib/Makefile
src/lib/libwps.rc
src/lib/libwps-stream.rc
src/test/Makefile
docs/Makefile
docs/doxygen/Makefile
build/Makefile
build/win32/Makefile
libwps-0.1.pc
libwps-stream-0.1.pc
libwps.spec
libwps-zip
autopackage/Makefile
autopackage/default.apspec
])

case "$debug" in
     "true" )
        AC_MSG_RESULT([Configured with debugging symbols.]) ;;
esac