File: configure.ac

package info (click to toggle)
sooperlooper 1.7.8~dfsg0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,912 kB
  • sloc: cpp: 31,035; sh: 5,205; makefile: 204
file content (221 lines) | stat: -rw-r--r-- 7,831 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(pbd)

AC_CONFIG_AUX_DIR(.)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_VALIDATE_CACHED_SYSTEM_TUPLE()

LIBPBD_MAJOR_VERSION=2
LIBPBD_MINOR_VERSION=6
LIBPBD_MICRO_VERSION=0

AC_SUBST(LIBPBD_MAJOR_VERSION)
AC_SUBST(LIBPBD_MINOR_VERSION)
AC_SUBST(LIBPBD_MICRO_VERSION)

LIBPBD_VERSION=$LIBPBD_MAJOR_VERSION.$LIBPBD_MINOR_VERSION.${LIBPBD_MICRO_VERSION}
LIBPBD_RELEASE=$LIBPBD_MAJOR_VERSION-$LIBPBD_MINOR_VERSION-${LIBPBD_MICRO_VERSION}

AC_SUBST(LIBPBD_SO_VERSION)
AC_SUBST(LIBPBD_VERSION)
AC_SUBST(LIBPBD_RELEASE)

AM_INIT_AUTOMAKE(libpbd,${LIBPBD_VERSION})

AC_CONFIG_HEADERS(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
if test "$ac_cv_prog_cxx" = "no" ; then
   AC_MSG_ERROR([*** libpbd is C++. You don't appear to have a C++ compiler])
fi

#AM_OPT_FLAGS

AC_ARG_ENABLE(optimize,
     [  --disable-optimize       avoid optimizations to allow for gdb debugging.],
     [ if test "x$enable_optimize" != "xno" ; then CXXFLAGS="$OPT_CXXFLAGS" ; fi ],
     [ CXXFLAGS="$OPT_CXXFLAGS" ])

AC_ARG_ENABLE(profiling,
     [  --enable-profiling       build for profiling using gprof.],
     [ if test "x$enable_profiling" = "xyes" ; then CXXFLAGS="$CXXFLAGS $PROF_FLAGS" ; fi ])

AC_OBJEXT
AC_PROG_RANLIB

AC_LANG_CPLUSPLUS

dnl We may need C++-11 for some versions of sigc
AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])

AC_MSG_CHECKING([for --with-macosx-sdk])
AC_ARG_WITH(macosx-sdk,    [  --with-macosx-sdk=PATH  use an OS X SDK at PATH], [
        wxUSE_MACOSX_SDK=$withval
        wx_cv_use_macosx_sdk="wxUSE_MACOSX_SDK=$withval"
        #echo "wxUSE_MACOSX_SDK=$wxUSE_MACOSX_SDK" >> ${wx_arg_cache_file}.tmp
    ], [
        # NOTE: Empty string on purpose so that --without-macosx-sdk (thus no)
        # will override --enable-universal_binary's automatic SDK usage.
        wxUSE_MACOSX_SDK=
        #LINE=`grep "^wxUSE_MACOSX_SDK=" ${wx_arg_cache_file}`
        #if test "x$LINE" != x ; then
        #    eval "$LINE"
        #    echo "$LINE" >> ${wx_arg_cache_file}.tmp
        #fi
    ])
AC_MSG_RESULT([$wxUSE_MACOSX_SDK])

AC_MSG_CHECKING([for --with-macosx-version-min])
AC_ARG_WITH(macosx-version-min,    [  --with-macosx-version-min=VER   build binaries which require at least this OS X version], [
        wxUSE_MACOSX_VERSION_MIN=$withval
        wx_cv_use_macosx_version_min="wxUSE_MACOSX_VERSION_MIN=$withval"
        #echo "wxUSE_MACOSX_VERSION_MIN=$wxUSE_MACOSX_VERSION_MIN" >> ${wx_arg_cache_file}.tmp
    ], [
        # default "yes" because when not using an SDK it means the same as no
        # but when using an SDK it means to use the SDK version
        wxUSE_MACOSX_VERSION_MIN=yes
        # See if there is a value in the cache
        #LINE=`grep "^wxUSE_MACOSX_VERSION_MIN=" ${wx_arg_cache_file}`
        #if test "x$LINE" != x ; then
        #    eval "$LINE"
        #    echo "$LINE" >> ${wx_arg_cache_file}.tmp
        #fi
    ])
AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])


dnl Set up the Mac OS X SDK.  We do this early so configure tests will occur
dnl with the SDK in place.
dnl NOTE: We clobber wxUSE_MACOSX_SDK with the SDK path
if test "x$wxUSE_MACOSX_SDK" = "xno"; then
    wxUSE_MACOSX_SDK=
elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then
    # TODO: Search for most recent SDK and use it.
    wxUSE_MACOSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
fi


if test "x$wxUSE_MACOSX_SDK" != "x"; then
    AC_MSG_CHECKING([for SDK directory $wxUSE_MACOSX_SDK])
    if ! test -d "$wxUSE_MACOSX_SDK"; then
        AC_MSG_FAILURE([not found])
    else
        AC_MSG_RESULT([exists])
    fi
    MACOSX_SDK_OPTS="-isysroot $wxUSE_MACOSX_SDK"
    eval "CC=\"$CC $MACOSX_SDK_OPTS\""
    eval "CXX=\"$CXX $MACOSX_SDK_OPTS\""
    eval "LD=\"$LD $MACOSX_SDK_OPTS\""
    retest_macosx_linking=yes
    dnl NOTE: When libtool is used in lieu of AR/RANLIB (i.e. in static mode)
    dnl the syslibroot makes no difference.  We aren't using libtool now but
    dnl if we ever did, be aware that you don't need to worry about it.
fi

dnl Set up the deployment target
dnl No   : Don't specify a min version even if using an SDK
dnl Yes  : Use the version from the SDK if used, otherwise same as no
dnl Param: Use the specified version
if test "x$wxUSE_MACOSX_VERSION_MIN" = "xno"; then
    wxUSE_MACOSX_VERSION_MIN=
elif test "x$wxUSE_MACOSX_VERSION_MIN" = "xyes"; then
    if test "x$wxUSE_MACOSX_SDK" != "x"; then
        AC_MSG_CHECKING([SDK deployment version])
dnl We need to quote the next line where we don't need macros and do need [] in the regex
[
        MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" buildSettings | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
]
        # If that failed, try again with the new key
        if test "x$MACOSX_SDK_PLIST_VERSION_MIN" == "x"; then
[
            MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" DefaultProperties | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
]
        fi

        if test "x$MACOSX_SDK_PLIST_VERSION_MIN" != "x"; then
            wxUSE_MACOSX_VERSION_MIN=$MACOSX_SDK_PLIST_VERSION_MIN
            AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
        else
            AC_MSG_WARN([Could not determine deployment target from SDKSettings.plist])
            wxUSE_MACOSX_VERSION_MIN=
        fi
    else
        wxUSE_MACOSX_VERSION_MIN=
    fi
fi

if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then
    MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN"
    eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\""
    eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\""
    eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\""
    retest_macosx_linking=yes
fi

dnl If either an SDK or a version option was added, make sure that we can
dnl still compile and link both C and C++.  If we didn't do this, then most
dnl of the remaining tests would fail.
if test "x$retest_macosx_linking" = "xyes"; then
    AC_LANG_PUSH(C)
    AC_MSG_CHECKING([if C compiler works with SDK/version options])
    AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no.  Try a different SDK]); exit 1])
    AC_LANG_POP()

    AC_LANG_PUSH(C++)
    AC_MSG_CHECKING([if C++ compiler works with SDK/version options])
    AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no.  Try a different SDK]); exit 1])
    AC_LANG_POP()
fi


dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h)

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

dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_FUNC_GETMNTENT
AC_CHECK_FUNCS(regcomp select strdup strerror strtol)
AC_CHECK_LIB(pthread, pthread_create, ,[AC_MSG_ERROR([you have no POSIX thread support])])

dnl PKG_CHECK_MODULES(ICU, icu-i18n, , [AC_MSG_WARN([ICU not found, no problem])])

PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.5)

dnl sigc++
have_sigcpp=no
PKG_CHECK_MODULES(SIGCPP, [sigc++-2.0 >= 2.2.10],[have_sigcpp=yes])
if test "x${have_sigcpp}" = "xyes"
then
  presigcpp_CFLAGS=$CFLAGS
  CFLAGS=$CFLAGS $SIGCPP_CFLAGS
  AC_CHECK_HEADER([sigc++/object.h], [SIGCPP_CFLAGS="$SIGCPP_CFLAGS -DUSE_SIGCPP_OBJECT_H"])
  CFLAGS=$presigcpp_CFLAGS
fi


#AM_BUILD_ENVIRONMENT

CFLAGS="$CFLAGS $XML_CFLAGS $SIGCPP_CFLAGS $ICU_CLFAGS"
CXXFLAGS="$CXXFLAGS $XML_CFLAGS $SIGCPP_CFLAGS $ICU_CFLAGS"
LIBS="$LIBS $XML_LIBS $SIGCPP_LIBS $ICU_LIBS"

AC_OUTPUT([Makefile
           version.cc
           pbd/Makefile
])