File: configure.ac

package info (click to toggle)
tagtool 0.12.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,352 kB
  • ctags: 1,010
  • sloc: ansic: 9,013; sh: 3,571; makefile: 121
file content (163 lines) | stat: -rw-r--r-- 4,430 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
dnl Process this file with autoconf to produce a configure script.


AC_INIT(tagtool, 0.12.2)
AM_INIT_AUTOMAKE(${PACKAGE_NAME}, ${PACKAGE_VERSION})

AC_CONFIG_SRCDIR([src/main.c])
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

SPEC_RELEASE="1"
AC_SUBST(SPEC_RELEASE)


dnl Command line options
AC_ARG_ENABLE(mp3,
	AC_HELP_STRING([--disable-mp3], [Disable MP3 support (if enabled, id3lib is required)]),
	[enable_mp3=no;  disable_mp3_reason="(disabled)"],
	[enable_mp3=yes])

AC_ARG_ENABLE(vorbis,
	AC_HELP_STRING([--disable-vorbis], [Disable Ogg Vorbis support (if enabled, libvorbis is required)]),
	[enable_vorbis=no;  disable_vorbis_reason="(disabled)"],
	[enable_vorbis=yes])

if test "$enable_mp3" = "no" && test "$enable_vorbis" = "no"; then
	AC_MSG_ERROR([At least one of 'mp3' or 'vorbis' must be enabled. Try './configure --help' for a list of options.])
fi;


dnl Checks for programs.
AC_PROG_CC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

dnl Checks for libraries and header files
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h langinfo.h],,
	[AC_MSG_ERROR([Missing necessary header files.])])

dnl Use gnuregex in FreeBSD
OSTYPE=`uname -s`
if test "$OSTYPE" = "FreeBSD"; then
	AC_CHECK_HEADERS([gnuregex.h gnu/regex.h])
	AC_CHECK_LIB(gnuregex, main,,
		[AC_MSG_ERROR([Missing required library])])
fi;


dnl Check for gtk and related libraries
PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.4.0
		       gtk+-2.0 >= 2.4.0
		       libglade-2.0 >= 2.3.6])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)


dnl Check for libid3 and libvorbis
if test "$enable_mp3" = "yes"; then
	AC_CHECK_HEADERS([id3.h],,
		[enable_mp3=no;  disable_mp3_reason="(missing id3lib headers)"])
fi;
if test "$enable_mp3" = "yes"; then
	dnl Fix missing link dependencies in libid3.so  (some distros have fixed 
	dnl this in their own libid3 packages, others haven't...)
	SAVE_LDFLAGS=$LDFLAGS
	LDFLAGS="-lstdc++ -lz $LDFLAGS"

	AC_CHECK_LIB(id3, main,,
		[enable_mp3=no;  disable_mp3_reason="(missing id3 library)"])
	AC_CHECK_LIB(id3, ID3FrameInfo_LongName,, 
		[AC_DEFINE(LIBID3_MISSING_ID3FRAMEINFO, 1, [Define to 1 if the ID3FrameInfo_* functions are missing from libid3])])

	if test "$enable_mp3" = "no"; then
		LDFLAGS=$SAVE_LDFLAGS
	fi;
fi;

if test "$enable_vorbis" = "yes"; then
	AC_CHECK_HEADERS([ogg/ogg.h vorbis/codec.h vorbis/vorbisfile.h],,
		[enable_vorbis=no;  disable_vorbis_reason="(missing vorbis headers)"])
fi;
if test "$enable_vorbis" = "yes"; then
	AC_CHECK_LIB(vorbis, main,,
		[enable_vorbis=no;  disable_vorbis_reason="(missing vorbis library)"])
fi;
if test "$enable_vorbis" = "yes"; then
	AC_CHECK_LIB(vorbisfile, main,,
		[enable_vorbis=no;  disable_vorbis_reason="(missing vorbisfile library)"])
fi;

AM_CONDITIONAL(ENABLE_MP3,    test "$enable_mp3" = "yes")
AM_CONDITIONAL(ENABLE_VORBIS, test "$enable_vorbis" = "yes")

if test "$enable_mp3" = "no" && test "$enable_vorbis" = "no"; then
	AC_MSG_RESULT([
No MP3 support $disable_mp3_reason
No Ogg Vorbis support $disable_vorbis_reason
])
	AC_MSG_ERROR([Neither MP3 or Vorbis support is being built. Cannot continue.])
fi;


dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_SIZE_T

dnl Checks for library functions.
AC_FUNC_STAT
AC_FUNC_FNMATCH
AC_FUNC_STRCOLL
AC_FUNC_STRTOD
AC_CHECK_FUNCS([strcasecmp nl_langinfo regcomp],,
	[AC_MSG_ERROR([Missing necessary functions.])])


dnl Internationalization

AC_PROG_INTLTOOL([0.30])
GETTEXT_PACKAGE=tagtool
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
ALL_LINGUAS="pt fr cs es it en_GB de bg lt ua ru"
AM_GLIB_GNU_GETTEXT


dnl Define useful directories

AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR)

save_prefix="$prefix"
test "x$prefix" = xNONE && prefix=$ac_default_prefix
sharedir=`eval echo "${datadir}"`
AC_DEFINE_UNQUOTED(DATADIR, "${sharedir}/${PACKAGE_NAME}", [Directory for application files])
AC_DEFINE_UNQUOTED(HELPDIR, "${sharedir}/gnome/help/${PACKAGE_NAME}/C/", [Directory for help files])
prefix="$save_prefix"


AC_CONFIG_FILES([
	data/Makefile
	pixmaps/Makefile
	po/Makefile.in
	src/Makefile
	Makefile
	tagtool.spec
])
dnl	help/Makefile
dnl	help/C/Makefile
AC_OUTPUT


AC_MSG_RESULT([
Configuration information:

  MP3 support:         $enable_mp3  $disable_mp3_reason
  Ogg Vorbis support:  $enable_vorbis  $disable_vorbis_reason

Now run 'make' to compile $PACKAGE_NAME
])