File: configure.ac

package info (click to toggle)
orange 0.3.2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,780 kB
  • ctags: 506
  • sloc: sh: 9,533; ansic: 4,449; makefile: 96
file content (216 lines) | stat: -rw-r--r-- 5,839 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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([liborange], [0.3.2], twogood@users.sourceforge.net)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE

AM_CONFIG_HEADER(config.h)

CFLAGS="-Wall -Wsign-compare -Wno-long-long $CFLAGS"

case $target in

	powerpc-apple-*)
		dnl Prevent "Undefined Macro argument list" error.
		CFLAGS="-no-cpp-precomp $CFLAGS"
		;;

esac

dnl Check where uint16_t and uint32_t may be found
AC_SUBST(INT_HEADER)

dnl Old compilers
AC_CHECK_HEADERS(inttypes.h,[INT_HEADER=inttypes.h])

dnl C99 compliant compilers
AC_CHECK_HEADERS(stdint.h,[INT_HEADER=stdint.h])

if test -z "$INT_HEADER"; then
	AC_MSG_ERROR([Don't know how to get uint16_t and uint32_t on your system])
fi

AC_CHECK_HEADERS(stdbool.h,,[
  AC_MSG_ERROR([Don't know how to get bool values on your system])
])

dnl Big-endian stuff
AC_SUBST(WORDS_BIGENDIAN)
AC_C_BIGENDIAN()
if test "$ac_cv_c_bigendian" = yes; then
  WORDS_BIGENDIAN=1
else
  WORDS_BIGENDIAN=0
fi

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
dnl AM_PATH_CHECK()

dnl Checks for libraries.
AC_LIB_RPATH

dnl Conditional use of libsynce (to allow stand-alone orange)
AC_ARG_WITH(libsynce,
  AC_HELP_STRING(
    [--without-libsynce],
    [Don't require libsynce (for stand-alone use, defaults to require)]),
  [my_with_libsynce="${withval}"],
  [my_with_libsynce=yes]
  )
if test "x$my_with_libsynce" = "xyes"; then
  PKG_CHECK_MODULES(LIBSYNCE, libsynce >= 0.9.1)
  AC_DEFINE_UNQUOTED(WITH_LIBSYNCE, 1, [Set to 1 when compiled with libsynce])
  SYNCE_HEADER=synce.h
else
  SYNCE_HEADER=liborange_stub.h
fi
AC_SUBST([SYNCE_HEADER])

dnl Conditional use of libdynamite
AC_ARG_WITH(libdynamite,
  AC_HELP_STRING(
    [--without-libdynamite],
    [Don't use libdynamite (defaults to use)]),
  [my_with_libdynamite="${withval}"],
  [my_with_libdynamite=yes]
  )
if test "x$my_with_libdynamite" = "xyes"; then
  PKG_CHECK_MODULES(LIBDYNAMITE, libdynamite >= 0.1)
  AC_DEFINE_UNQUOTED(WITH_LIBDYNAMITE, 1, [Set to 1 when compiled with libdynamite])
fi

dnl Conditional use of libunshield
AC_ARG_WITH(libunshield,
  AC_HELP_STRING(
    [--without-libunshield],
    [Don't use libunshield (defaults to use)]),
  [my_with_libunshield="${withval}"],
  [my_with_libunshield=yes]
  )
if test "x$my_with_libunshield" = "xyes"; then
  PKG_CHECK_MODULES(LIBUNSHIELD, libunshield >= 0.5)
  AC_DEFINE_UNQUOTED(WITH_LIBUNSHIELD, 1, [Set to 1 when compiled with libunshield])
fi

dnl Checks for typedefs, structures, and compiler characteristics.
SAVED_CFLAGS="$CFLAGS"
CFLAGS=""
AC_C_CONST
CFLAGS="$SAVED_CFLAGS"

dnl Conditional compile of Inno Setup support (because it's not very good)
my_enable_inno=0
AC_ARG_ENABLE(inno,
  AC_HELP_STRING(
    [--enable-inno],
    [Enables expermential Inno Setup support]),
    [my_enable_inno=1],
    [my_enable_inno=0]
  )
AC_DEFINE_UNQUOTED(ENABLE_INNO, $my_enable_inno, [Set to 1 when Inno Setup support is enabled])
if test $my_enable_inno -eq 1; then
  INNO_LIBADD='inno.lo'
fi
AC_SUBST([INNO_LIBADD])

dnl Conditional compile of VISE support (because it's not very good)
my_enable_vise=0
AC_ARG_ENABLE(vise,
  AC_HELP_STRING(
    [--enable-vise],
    [Enables expermential VISE support]),
    [my_enable_vise=1],
    [my_enable_vise=0]
  )
AC_DEFINE_UNQUOTED(ENABLE_VISE, $my_enable_vise, [Set to 1 when VISE support is enabled])
if test $my_enable_vise -eq 1; then
  VISE_LIBADD='vise.lo'
fi
AC_SUBST([VISE_LIBADD])

dnl Conditional use of libole2 (because it's GPL licensed)
my_with_libole2=0
AC_ARG_WITH(libole2,
  AC_HELP_STRING(
    [--with-libole2],
    [Use GPL-contaminated libole2 for MSI decoding]),
    [my_with_libole2=1],
    [my_with_libole2=0]
  )
if test $my_with_libole2 -eq 1; then
  AM_PATH_LIBOLE2([0.2.4],
    [AC_DEFINE_UNQUOTED(WITH_LIBOLE2, $my_with_libole2, [Set to 1 when libole2 support is included])],
    [AC_MSG_ERROR([Can't find libole2])]
    )
fi

dnl Conditional use of libgsf (because it's LGPL licensed)
my_with_libgsf=0
AC_ARG_WITH(libgsf,
  AC_HELP_STRING(
    [--with-libgsf],
    [Use LGPL-contaminated libgsf for MSI decoding]),
    [my_with_libgsf=1],
    [my_with_libgsf=0]
  )
if test $my_with_libgsf -eq 1; then
  PKG_CHECK_MODULES([LIBGSF], [libgsf-1],,
                    [AC_MSG_ERROR([Can't find libgsf-1])]
                    )
fi
AC_DEFINE_UNQUOTED(WITH_LIBGSF, $my_with_libgsf, [Set to 1 when compiled with libgsf])

dnl Conditional compile of MSI support (because it requires libole2)
my_enable_msi=0
AC_ARG_ENABLE(msi,
  AC_HELP_STRING(
    [--enable-msi],
    [Enables expermential MSI support]),
    [my_enable_msi=1],
    [my_enable_msi=0]
  )
AC_DEFINE_UNQUOTED(ENABLE_MSI, $my_enable_msi, [Set to 1 when msi support is enabled])
if test $my_enable_msi -eq 1; then
  if test $my_with_libgsf -eq 1; then
    MSI_LIBADD='msi-gsf.lo'
  else 
    if test $my_with_libole2 -eq 1 ; then
      MSI_LIBADD='msi.lo'
    else
      AC_MSG_ERROR([Not configured with libgsf or libole2 but that's needed for MSI support.])
    fi
  fi
fi
AC_SUBST([MSI_LIBADD])

dnl Look for libmagic
AC_CHECK_LIB(magic,magic_open)
AC_CHECK_HEADERS(magic.h)


# http://www.gnu.org/manual/autoconf-2.53/html_node/AC_LIBOBJ-vs.-LIBOBJS.html
# This is necessary so that .o files in LIBOBJS are also built via
# the ANSI2KNR-filtering rules.
LIB@&t@OBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)

AC_CHECK_LIB(z,inflate,,[
    AC_MSG_ERROR(["Could not find zlib, please install it!"])
    ])

AC_OUTPUT([liborange.pc
           Makefile
           man/Makefile
           lib/Makefile
           lib/liborange.h
           lib/liborange_stub.h
           src/Makefile])