File: configure.in

package info (click to toggle)
easyh10 1.5-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,444 kB
  • sloc: ansic: 9,046; sh: 8,387; makefile: 77
file content (261 lines) | stat: -rw-r--r-- 5,989 bytes parent folder | download | duplicates (3)
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
dnl $Id: configure.in,v 1.39 2006/10/08 19:29:18 nyaochi Exp $
dnl
dnl
dnl Exported and configured variables:
dnl CFLAGS
dnl LDFLAGS
dnl INCLUDES


dnl Initialization for autoconf
AC_PREREQ(2.53)
AC_INIT
AC_CONFIG_SRCDIR([cui/main.c])


dnl Checks for system
AC_CANONICAL_HOST
AC_AIX
AC_MINIX
AC_ISC_POSIX

dnl Initialization for automake
AM_INIT_AUTOMAKE(easyh10, 1.5)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_C_PROTOTYPES
AC_HEADER_STDC
AC_CHECK_HEADERS("string.h")

dnl Checks for program
AM_PROG_CC_STDC
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S

dnl Initialozation for libtool
AC_PROG_LIBTOOL

dnl Initialization for variables
CFLAGS="${ac_save_CFLAGS}"
LDFLAGS="$LDFLAGS ${ac_save_LDFLAGS}"
INCLUDES="-I\$(top_srcdir) -I\$(top_srcdir)/include -I\$(srcdir)"

dnl Additional options


dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h unistd.h stdint.h getopt.h)


dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CHECK_SIZEOF
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(unsigned long)

AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t])

AH_VERBATIM([HAVE_UINT8_T],
[/* add uint8_t type */
#undef HAVE_UINT8_T
#ifndef HAVE_UINT8_T
		typedef unsigned char uint8_t;
#endif])

AH_VERBATIM([HAVE_UINT16_T],
[/* add uint16_t type */
#undef HAVE_UINT16_T
#ifndef HAVE_UINT16_T
		typedef unsigned short uint16_t;
#endif])

if test "${ac_cv_sizeof_unsigned_short}" = "4"; then
   AC_DEFINE(A_UINT32_T,unsigned short)
else
		if test "${ac_cv_sizeof_unsigned_int}" = "4"; then
		   AC_DEFINE(A_UINT32_T,unsigned int)
		   else
				if test "${ac_cv_sizeof_unsigned_long}" = "4"; then
						AC_DEFINE(A_UINT32_T,unsigned long)
													  else
																AC_MSG_ERROR([CHECK_TYPE_uint32_t - please report to the developper])
																								  fi
																								  fi
fi

AH_VERBATIM([HAVE_UINT32_T],
[/* add uint32_t type */
#undef HAVE_UINT32_T
#ifndef HAVE_UINT32_T
#undef A_UINT32_T
	   typedef A_UINT32_T uint32_t;
#endif])


dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getcwd mktime strdup strerror strtol strtoul)

dnl Check for math library
AC_CHECK_LIB(m, rand)

dnl Check for zlib library
AC_CHECK_LIB(z, uncompress, , [AC_MSG_ERROR(libz not found!)])

dnl Check for iconv library
AC_ARG_WITH(
  iconv-header,
  [AC_HELP_STRING(--with-iconv-header=DIR, [iconv header directory])],
  [CFLAGS="-I$withval ${CFLAGS}"]
)

AC_ARG_WITH(
  iconv-library,
  [AC_HELP_STRING(--with-iconv-library=DIR, [iconv library directory])],
  [LDFLAGS="-L$withval ${LDFLAGS}"; with_libiconv=native],
  [with_libiconv=maybe]
)

AC_CHECK_HEADER(iconv.h, , [AC_MSG_ERROR(iconv.h not found!)])

found_iconv=no
case $with_libiconv in
  maybe)
    # Check in the C library first
    AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
    # Check if we have GNU libiconv
    if test $found_iconv = "no"; then
      AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
    fi
    # Check if we have a iconv in -liconv, possibly from vendor
    if test $found_iconv = "no"; then
      AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
    fi
    ;;
  no)
    AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
    ;;
  gnu|yes)
    AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
    ;;
  native)
    echo "native"
    echo $LDFLAGS
    # Check if we have GNU libiconv
    if test $found_iconv = "no"; then
      AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
    fi
    # Check if we have a iconv in -liconv, possibly from vendor
    if test $found_iconv = "no"; then
      AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
    fi
    ;;
esac

if test "x$found_iconv" = "xno" ; then
   AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv])
fi

if test x$with_libiconv != xno ; then
  case " $INTLLIBS " in
  *[[\ \ ]]-liconv[[\ \	]]*) ;;
  *) ICONV_LIBS="-liconv" ;;
  esac
fi

case $with_libiconv in
  gnu)
    AC_DEFINE(USE_LIBICONV_GNU, 1, [Using GNU libiconv])
    ;;
  native)
    AC_DEFINE(USE_LIBICONV_NATIVE, 1, [Using a native implementation of iconv in a separate library])
    ;;
esac


dnl Checks for id3tag
AC_ARG_WITH(
  id3tag-header,
  [AC_HELP_STRING(--with-id3tag-header=DIR, [id3tag header directory])],
  [CFLAGS="-I$withval ${CFLAGS}"]
)

AC_ARG_WITH(
  id3tag-library,
  [AC_HELP_STRING(--with-id3tag-library=DIR, [id3tag library directory])],
  [LDFLAGS="-L$withval ${LDFLAGS}"]
)

AC_CHECK_HEADER(
  id3tag.h,
  ,
  [AC_MSG_ERROR(id3tag header not found!)]
)
AC_CHECK_LIB(
  id3tag,
  id3_file_fdopen,
  [ID3TAG_LIBS="-lid3tag"],
  AC_MSG_ERROR([id3tag library is not found!])
)
AC_CHECK_LIB(
  id3tag,
  id3_file_gettag,
  [CFLAGS="-DHAVE_LIBID3TAG_GETTAG ${CFLAGS}"]
)

dnl Check for POSIX regex implementation
with_regex=no
AC_CHECK_FUNCS(
  regcomp regexec regfree,
  [with_regex=posix]
)

dnl Check for Rx regex library
AC_CHECK_HEADER(rxposix.h)
AC_CHECK_LIB(rx, regexec, [with_regex=rx])

case $with_regex in
  posix)
    AC_DEFINE(HAVE_POSIX_REGEX, 1, [Using POSIX regex function])
	REGEX_LIBS=""
	;;
  rx)
    AC_DEFINE(HAVE_GNU_RX, 1, [Using GNU Rx library])
	REGEX_LIBS="-lrx"
	;;
  no)
   AC_MSG_ERROR([*** No regex implementation found in C library or GNU Rx])
   ;;
esac

AC_ARG_ENABLE(
  debug,
  [AC_HELP_STRING(--enable-debug, [Turn on debugging])]
)

if test "$enable_debug" = "yes"; then
   CFLAGS="-DDEBUG -O -g ${CFLAGS}"
fi

dnl Export variables
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(INCLUDES)
AC_SUBST(ID3TAG_LIBS)
AC_SUBST(ICONV_LIBS)
AC_SUBST(REGEX_LIBS)

dnl Checks for library functions.

AC_CONFIG_FILES(Makefile cui/Makefile libh10db/Makefile libucs2/Makefile libgetmediainfo/Makefile easyh10.spec)
AC_OUTPUT