File: configure.ac

package info (click to toggle)
libinstpatch 1.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,148 kB
  • ctags: 7,030
  • sloc: ansic: 37,958; sh: 10,747; makefile: 361; python: 27
file content (214 lines) | stat: -rw-r--r-- 5,545 bytes parent folder | download | duplicates (4)
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
dnl --------------------------------------------------
dnl configure.ac for libInstPatch
dnl --------------------------------------------------

AC_INIT(libinstpatch/misc.c)

# Making releases:
#   IPATCH_VERSION_MICRO += 1;
#   IPATCH_INTERFACE_AGE += 1;
#   IPATCH_BINARY_AGE += 1;
# if any functions have been added, set IPATCH_INTERFACE_AGE to 0.
# if backwards compatibility has been broken (removed or changed functions),
#   set IPATCH_BINARY_AGE and IPATCH_INTERFACE_AGE to 0.
#
IPATCH_VERSION_MAJOR=1
IPATCH_VERSION_MINOR=0
IPATCH_VERSION_MICRO=0
IPATCH_INTERFACE_AGE=0
IPATCH_BINARY_AGE=0
IPATCH_VERSION=$IPATCH_VERSION_MAJOR.$IPATCH_VERSION_MINOR.$IPATCH_VERSION_MICRO
AC_SUBST(IPATCH_VERSION_MAJOR)
AC_SUBST(IPATCH_VERSION_MINOR)
AC_SUBST(IPATCH_VERSION_MICRO)
AC_SUBST(IPATCH_INTERFACE_AGE)
AC_SUBST(IPATCH_BINARY_AGE)
AC_SUBST(IPATCH_VERSION)

LT_CURRENT=`expr 100 '*' $IPATCH_VERSION_MINOR + $IPATCH_VERSION_MICRO - $IPATCH_INTERFACE_AGE`
LT_REVISION=$IPATCH_INTERFACE_AGE
LT_AGE=`expr $IPATCH_BINARY_AGE - $IPATCH_INTERFACE_AGE`
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

# Extra m4 macro directory
AC_CONFIG_MACRO_DIR(m4)

# Check build environment
AC_CANONICAL_SYSTEM

AM_INIT_AUTOMAKE(libinstpatch, $IPATCH_VERSION)
AM_CONFIG_HEADER(config.h)

IPATCH_VERSION="\"$VERSION\""

# Check for debugging flags (before AC_PROG_CC to override defaults)
AC_DEBUGGING

# Program checks
AC_PROG_CC

# Set this after AC_PROG_CC so that we inherit the defaults from it
CFLAGS="$CFLAGS -Wall"

# International language support
AM_GNU_GETTEXT([external])

AC_PROG_INTLTOOL
AC_PROG_INSTALL
AC_HEADER_STDC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

dnl - Check for mingw Win32 gcc environment
AC_MINGW32
if test "${MINGW32}" == "yes" ; then
  AC_DEFINE(MINGW32, 1, [Define if using the mingw environment])
fi

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    native_win32=yes
    ;;
  *)
    native_win32=no
    ;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)

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)

# Ensure MSVC-compatible struct packing convention is used when
# compiling for Win32 with gcc. GTK+ uses this convention, so we must, too.
# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
# gcc2 uses "-fnative-struct".
if test x"$native_win32" = xyes; then
  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 will be incompatible with prebuilt GTK+ DLLs])
    else
      CFLAGS="$CFLAGS $msnative_struct"
      AC_MSG_RESULT([${msnative_struct}])
    fi
  fi
fi

PKG_CHECK_MODULES(GOBJECT,
  gobject-2.0 >= 2.14 glib-2.0 >= 2.14 gthread-2.0 >= 2.14)
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)

# Do libsndfile check
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0)
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)

# Try for pygobject first (removes gtk dependency)
PKG_CHECK_MODULES(PYGTK, pygobject-2.0, PYGTK_SUPPORT=1, PYGTK_SUPPORT=0)

# If no pygobject check for full pygtk
if test ! "$PYGTK_SUPPORT" = "1" ; then
  PKG_CHECK_MODULES(PYGTK, pygtk-2.0, PYGTK_SUPPORT=1, PYGTK_SUPPORT=0)
  PYGTK_CODEGEN_DIR=`pkg-config pygtk-2.0 --variable=codegendir`
else
  PYGTK_CODEGEN_DIR=`pkg-config pygobject-2.0 --variable=codegendir`
fi

AC_SUBST(PYGTK_CFLAGS)
AC_SUBST(PYGTK_LIBS)

AC_ARG_ENABLE(python, AS_HELP_STRING([--disable-python], [disable python binding]),
  enable_python=$enableval, enable_python="yes")

if test "x${enable_python}" = "xyes" -a "$PYGTK_SUPPORT" = "1" ; then
  AC_DEFINE(PYTHON_SUPPORT, 1, [Define to build Python binding])

  if test "x$PYGTK_CODEGEN_DIR" = "x" ; then
      PYGTK_CODEGEN_DIR=/usr/share/pygtk/2.0/codegen
  fi

  AC_SUBST(PYGTK_CODEGEN_DIR)

  # Check for python (defines PYTHON_CFLAGS, PYTHON_LIBS, PYTHON_SITE_PKG, PYTHON_EXTRA_LIBS)
  AC_PYTHON_DEVEL
else
  enable_python="no"
fi

AM_CONDITIONAL(PYTHON_SUPPORT, test "x$enable_python" = "xyes")


# Check for gtk-doc.
GTK_DOC_CHECK(1.9)


AC_OUTPUT([
	Makefile
	docs/Makefile
	docs/reference/Makefile
	examples/Makefile
	libinstpatch/libinstpatch.h
	libinstpatch/Makefile
	libinstpatch/version.h
	libinstpatch-1.0.pc
	m4/Makefile
	po/Makefile.in
	python/Makefile
	tests/Makefile
	utils/Makefile])

_SUMMARY_ENABLED=
_SUMMARY_DISABLED=

FEATURE_SUMMARY([  Python support], ["x${enable_python}" = "xyes"])

FEATURE_SUMMARY([  Generate gtk-doc API docs],
  ["x${enable_gtk_doc}" == "xyes"])

FEATURE_SUMMARY([  Debugging],
  ["${enable_debug}" == "yes"])


echo
echo "**************************************************************"
echo "Enabled features:"
echo -e -n "$_SUMMARY_ENABLED"
echo
echo "Disabled features:"
echo -e -n "$_SUMMARY_DISABLED"
echo
echo "**************************************************************"
echo