File: configure.in

package info (click to toggle)
papaya 0.97.20031122-5.5
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 10,536 kB
  • ctags: 4,163
  • sloc: cpp: 23,715; sh: 11,142; ansic: 6,359; python: 1,667; makefile: 608; yacc: 318; perl: 168; sed: 109; csh: 10
file content (334 lines) | stat: -rw-r--r-- 8,332 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
AC_PREREQ(2.52)

AC_INIT(src/papaya/Splash.cpp)
AM_INIT_AUTOMAKE(papaya, 0.98)

dnl AC_CONFIG_HEADERS(config.h)

PACKAGE=papaya
VERSION=0.98

AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_INSTALL
dnl if test "x$host_os" = "xmingw32"; then
AC_LIBTOOL_WIN32_DLL
dnl fi
AC_PROG_LIBTOOL
AC_ISC_POSIX

dnl Check for header files
AC_STDC_HEADERS
AC_HAVE_HEADERS(string.h fcntl.h sys/file.h sys/param.h)
AC_FUNC_ALLOCA


dnl gettext stuff
ALL_LINGUAS="en_GB en_US fr no_NO es"
AM_GNU_GETTEXT
localedir=${datadir}/locale
AC_SUBST(localedir)




#AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)

dnl Declare --enable-* arguments and collect ac_help strings.

dnl Need --enable-dmalloc --disable-dmalloc
AC_ARG_ENABLE(dmalloc, [  --enable-dmalloc        enable dmalloc debugging], DMALLOC="$enable_dmalloc")

AC_ARG_ENABLE(debugging, [  --enable-debugging      compile with debugging symbols], DEBUGGING="$enable_debugging")

AC_ARG_ENABLE(profiling, [  --enable-profiling      compile with profiling support], PROFILING="$enable_profiling")

dnl AC_ARG_ENABLE(macosx, [  --enable-macosx         make Papaya compile under MacOSX], MACOSX="$enable_macosx")

dnl Build plugins
AC_ARG_ENABLE(plugins, [  --enable-plugins        build plugins (default)], PLUGINS="$plugins")

dnl Look for latex to build the manual with
AC_PATH_PROG(PDFLATEX, pdflatex)
AC_PATH_PROG(PNGTOPNM, pngtopnm)
AC_PATH_PROG(PNMTOPS, pnmtops)
AC_PATH_PROG(EPSTOPDF, epstopdf)
if test "x$PDFLATEX" = "x"; then
  echo pdflatex not found, not building user manual
else
  if test "x$PNGTOPNM" = "x"; then
    echo pngtopnm not found, not building user manual
  else 
    if test "x$PNMTOPS" = "x"; then
      echo pnmtops not found, not building user manual
    else 
      if test "x$EPSTOPDF" = "x"; then
        echo epstopdf not found, not building user manual
      else 
        MANUAL="manual.pdf"
        MANUAL_SUBDIRS="images"
      fi
    fi
  fi
fi

dnl Look for GTK 2.0.6 or greater.
  AC_PATH_PROG(PKGCONFIG, pkg-config)
  if test "x$PKGCONFIG" = "x"; then
    AC_MSG_ERROR([ *** pkg-config is required *** ])
  else
    if $PKGCONFIG --atleast-version 2.0.6 gtk+-2.0; then
      GTK_CFLAGS="`pkg-config --cflags gtk+-2.0`"
      GTK_LIBS="`pkg-config --libs gtk+-2.0`"
      INTERFACE="-DUSE_GTK_2"
      VT="o/GTKTwoVT.o"
    else
      AC_MSG_ERROR([ *** GTK+-2.0.6 or higher is required *** ])
    fi
  fi

dnl Look for VTE.
dnl  if $PKGCONFIG --atleast-version 0.10.0 vte; then
dnl    GTK_CFLAGS="$GTK_CFLAGS `pkg-config --cflags vte`"
dnl    GTK_LIBS="$GTK_LIBS `pkg-config --libs vte`"
dnl  else
dnl    AC_MSG_ERROR([ *** VTE 0.10.0 or higher is required *** ])
dnl  fi

dnl Try to find libglade-2.0
  if $PKGCONFIG --atleast-version 2.0.0 libglade-2.0; then
     GTK_CFLAGS="$GTK_CFLAGS `pkg-config --cflags libglade-2.0` -DUSE_GLADE"
     GTK_LIBS="$GTK_LIBS `pkg-config --libs libglade-2.0`"
  else
     AC_MSG_ERROR([ *** libglade-2.0 is required *** ])
  fi

dnl Look for the presence of libz
AC_CHECK_LIB(z, inflate, [PAPAYA_LIBS="$PAPAYA_LIBS -lz"] [ZLIB="-DZLIB" COMPRESS="o/CompressFilter.o"], [ZLIB="" COMPRESS=""])

AC_CHECK_LIB(dl, main, [PAPAYA_LIBS="$PAPAYA_LIBS -rdynamic -ldl"], [PAPAYA_LIBS="$PAPAYA_LIBS -rdynamic"])
AC_CHECK_LIB(nsl, gethostbyname,,)
AC_CHECK_LIB(socket, socket,,)

if test "x$enable_dmalloc" = "xyes"; then
  AC_CHECK_LIB(dmalloc, dmalloc_shutdown, [ALL_LIBS="$ALL_LIBS -ldmalloc"] [DMALLOC="#define MALLOC"], [DMALLOC="#undef MALLOC"])
fi

dnl Detect if we have recent enough headers for IPv6 support.
AC_CHECK_LIB(c, getaddrinfo, [IPV4=""], 
AC_CHECK_LIB(socket, getaddrinfo, [IPV4=""], [IPV4="-DIPV4"]))

dnl Have we asked for debugging?
if test "x$enable_debugging" = "xyes"; then
  DEBUG="-g"
else
  DEBUG=""
fi

dnl Check for profiling
if test "x$enable_profiling" = "xyes"; then
  PAPAYA_CFLAGS="$PAPAYA_CFLAGS -p"
  PAPAYA_LIBS="$PAPAYA_LIBS -p"
  ALL_CFLAGS="$ALL_CFLAGS -p"
  ALL_LIBS="$ALL_LIBS -p"
else
  PROFILE=""
fi

dnl Checks for header files.
AC_HEADER_STDC

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

dnl Check for MacOSX

dnl if test "x$enable_macosx" = "xyes"; then

dnl uname -a returns:
dnl Darwin dhcppc2 5.1 Darwin Kernel Version 5.1: Tue Oct 30 00:06:34 PST 2001; root:xnu/xnu-201.5.obj~1/RELEASE_PPC  Power Macintosh powerpc

dnl  $ALL_LIBS += "-L/sw/lib"
dnl  $ALL_CFLAGS += "-I/sw/include"
dnl fi


dnl Check for mingw32

if test "x$host_os" = "xmingw32"; then
  PAPAYA_CFLAGS="$PAPAYA_CFLAGS -mms-bitfields -mno-cygwin"
  PAPAYA_LIBS="-lwsock32 -lregex"
fi

dnl Building plugins?
SRC_SUBDIRS="papaya"

if test "x$enable_plugins" = "xno"; then
  echo "Not installing plugins"
else
  SRC_SUBDIRS="$SRC_SUBDIRS plugins"
  PLUGIN_SUBDIRS="Turf BSX MXP"

  AC_CHECK_LIB(kmid, kMidStop, [MIDI="-DMIDI -I/usr/include/kde"] [LIBMIDI="-lkmid"], [MIDI=""] [LIBMIDI=""])

  # Check for the presence of Python to correctly configure the TP plugin.
  AC_PATH_PROGS(PYTHON, python python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 python1.3, no)
  if test "x$PYTHON" = "xno"; then
    echo "Disabling Python support."
  else
    echo "Found Python executable: $PYTHON"
    echo "checking for pygtk-2.0..."

    AC_PATH_PROG(PKGCONFIG, pkg-config)
    if test "x$PKGCONFIG" = "x"; then
      AC_MSG_ERROR([ *** pkg-config is required *** ])
    else
      if $PKGCONFIG --atleast-version 1.99.10 pygtk-2.0; then
        PLUGIN_SUBDIRS="$PLUGIN_SUBDIRS PythonPlugin"
        TURF_PYTHON="-DPYTHON -I../PythonPlugin"

        changequote(, )dnl
        PYTHON_INC=`$PYTHON -c '
import sys
print "-I%s/include/python%s" % (sys.prefix, sys.version[:3])'`
        PYTHON_LIB=`$PYTHON -c '
import sys
print "-L%s/lib/python%s/config -lpython%s" % (sys.prefix, sys.version[:3], sys.version[:3])'`
        changequote([, ])dnl

        PYGTK_INC="`$PKGCONFIG --cflags pygtk-2.0`"
	PYGTK_LIB="`$PKGCONFIG --libs pygtk-2.0`"
	PYTHON_INC="$PYTHON_INC -DUSE_PYGTK"
      else
	PYTHON="no"
        echo "Disabling Python support: PyGTK 1.99.10 is required."
      fi
    fi

  fi

  dnl Add other plugin configuration stuff here.

fi

AC_SUBST(SRC_SUBDIRS)
AC_SUBST(PLUGIN_SUBDIRS)
AC_SUBST(DMALLOC)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
AC_SUBST(DMALLOC_LIB)
AC_SUBST(ZLIB)
AC_SUBST(COMPRESS)
AC_SUBST(IPV4)
AC_SUBST(INTLSUB)
AC_SUBST(POSUB)

AC_SUBST(INTERFACE)
AC_SUBST(VT)

AC_SUBST(PAPAYA_CFLAGS)
AC_SUBST(PAPAYA_LIBS)
AC_SUBST(ALL_CFLAGS)
AC_SUBST(ALL_LIBS)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

AC_SUBST(MIDI)
AC_SUBST(LIBMIDI)

AC_SUBST(TURF_PYTHON)
AC_SUBST(PYTHON_LIB)
AC_SUBST(PYTHON_INC)

AC_SUBST(PYGTK_INC)
AC_SUBST(PYGTK_LIB)

AC_SUBST(MANUAL)
AC_SUBST(MANUAL_SUBDIRS)
AC_SUBST(EPSTOPDF)
AC_SUBST(PNGTOPNM)
AC_SUBST(PNMTOPS)
AC_SUBST(PDFLATEX)

AC_OUTPUT([ m4/Makefile 
Makefile
src/Makefile
src/papaya/Makefile
src/include/Makefile
src/include/papaya/Makefile
src/plugins/Makefile
src/plugins/Turf/Makefile
src/plugins/PythonPlugin/Makefile
src/plugins/BSX/Makefile
src/plugins/MXP/Makefile
src/include/papaya/system.h
doc/Makefile
doc/manual/Makefile
doc/manual/images/Makefile
intl/Makefile
po/Makefile.in
share/Makefile
share/papaya.pc
],
[touch Makefile.in
]
)

dnl Print a summary of the options

echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"

if test "x$with_interface" = "xgtk"; then
  echo "Interface: GTK"
else
  echo "Interface: GTK 2.0"
fi

if test "x$enable_debugging" = "xyes"; then
  echo "Debugging: enabled"
else
  echo "Debugging: disabled"
fi

if test "x$enable_dmalloc" = "xyes"; then
  echo "DMalloc  : enabled"
fi

if test "x$enable_macos" = "xyes"; then
  echo "MacOS X  : yes"
fi

if test "x$COMPRESS" = "x"; then
  echo "MCCP     : disabled"
else
  echo "MCCP     : enabled"
fi

echo "PREFIX   : $prefix"

if test "x$enable_plugins" = "xno"; then
  echo "Plugin support is disabled."
else
  echo "Plugin support is enabled."
  if test "x$PYTHON" = "xno"; then
    echo "Python plugin support is disabled."
  else
    echo "Python plugin support is enabled."
    echo "Python includes: $PYTHON_INC."
    echo "Python libraries: $PYTHON_LIB."
  fi
fi

echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"

echo "Now run make clean && make"

echo "Using make program $MAKE."