File: configure.ac

package info (click to toggle)
audacity 2.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 86,844 kB
  • sloc: ansic: 225,005; cpp: 221,240; sh: 27,327; python: 16,896; makefile: 8,186; lisp: 8,002; perl: 317; xml: 307; sed: 16
file content (132 lines) | stat: -rw-r--r-- 3,019 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
#
# FileDialog
#

AC_PREREQ([2.59])
AC_INIT([FileDialog],[1.0],[audacity.sourceforge.net],[FileDialog])
AC_CONFIG_AUX_DIR([autotools])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.11 dist-xz foreign no-dist-gzip subdir-objects -Wall])
AM_MAINTAINER_MODE([disable])

#
# We use C++
#
AC_LANG_CPLUSPLUS

#
# Checks for programs.
#
AC_PROG_CXX
AM_PROG_AR
AC_PROG_OBJCXX

LT_INIT

#
# Checks for libraries.
#
AC_HEADER_STDC

#
# Check for debug
#
AC_ARG_ENABLE(debug,
            [AS_HELP_STRING([--enable-debug],[enable debug support (default=none)])],
            debug_preference="yes",
            debug_preference="no")

AC_ARG_WITH(wx-version,
            [AS_HELP_STRING([--with-wx-version],[override default wxWidgets version [2.6,2.8]])],
            wx_preference="--version=$withval",
            wx_preference="")

AC_ARG_WITH(wx-config,
            [AS_HELP_STRING([--with-wx-config],[override default wxWidgets config script])],
            wx_config="$withval",
            wx_config="")

dnl wxWidgets -- we assume that if wx-config is found, wxWidgets is successfully installed.
AC_PATH_PROGS(WX_CONFIG, wx-config wx-config-3.0, no, $PATH:/usr/local/bin )
if [[ "$WX_CONFIG" = "no" ]] ; then
   AC_MSG_ERROR("Could not find wx-config: is wxWidgets installed? is wx-config in your path?")
fi

dnl Gather wx arguments

wxconfigargs="$wx_preference"
WX_CXXFLAGS=$($WX_CONFIG $wxconfigargs --cxxflags)
WX_LIBS=""
AC_SUBST([WX_CXXFLAGS])
AC_SUBST([WX_LIBS])

if test x"$debug_preference" = "xyes" ; then
   dnl we want debuging on
   AC_MSG_NOTICE([Adding -g for debugging to CFLAGS and CXXFLAGS ...])
   CFLAGS="${CFLAGS} -g -DwxDEBUG_LEVEL=1"
   CXXFLAGS="${CXXFLAGS} -g -DwxDEBUG_LEVEL=1"
else
   CFLAGS="${CFLAGS} -DwxDEBUG_LEVEL=0"
   CXXFLAGS="${CXXFLAGS} -DwxDEBUG_LEVEL=0"
fi

AC_MSG_CHECKING([for gtk3 use in wxWidgets])
CPPFLAGS="${WX_CXXFLAGS}"
AC_EGREP_CPP(wxWidgets built with GTK3,
[#include <wx/wx.h>
#if defined(__WXGTK3__)
   wxWidgets built with GTK3
#endif
], enable_gtk3=yes, enable_gtk3=no)

if [[ "$enable_gtk3" = yes ]]; then
   gtk_version=gtk+-3.0
   AC_MSG_RESULT([yes])
else
   gtk_version=gtk+-2.0
   AC_MSG_RESULT([no])
fi

AC_SUBST(HAVE_GTK)
PKG_CHECK_MODULES(GTK, $gtk_version, have_gtk="yes", have_gtk="no")

dnl OS-specific configuration

AC_CANONICAL_HOST

IMPLEMENTATION=""
case "${host_os}" in
   darwin*)
      dnl Mac OS X configuration
      IMPLEMENTATION="mac"
   ;;

   cygwin*)
      dnl Windows/CygWin configuration
      IMPLEMENTATION="win"
   ;;

   *)
      if [[ "$have_gtk" = "yes" ]]
      then
         AC_DEFINE(HAVE_GTK, 1, [Define if GTK is available])
         CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
         LIBS="$LIBS $GTK_LIBS"
         IMPLEMENTATION="gtk"
      fi
   ;;
esac

AM_CONDITIONAL([GTK], test "$IMPLEMENTATION" = "gtk")
AM_CONDITIONAL([MAC], test "$IMPLEMENTATION" = "mac")
AM_CONDITIONAL([WINDOWS], test "$IMPLEMENTATION" = "win")

echo "Implementation to use: $IMPLEMENTATION"

AC_CONFIG_FILES([Makefile])

#
# Write it all out
#
AC_OUTPUT