1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-06 15:19:29 +02:00
audacity/lib-src/FileDialog/configure.ac
lllucius c512822138 Additional changes for wx3
These are mostly for getting it to build on Linux, but I've
also created new configs in Visual Studio to make it easier
to switch between wx2 and wx3.

For Linux, you have to tell configure where to find the wx3
version of the wx-config script and, since some distros build
wxWidgets v3 against GTK+ v3, you may also need to enable
gtk3 with something like:

./configure --enable-gtk3 WX_CONFIG=/usr/bin/wx-config-3.0

On Windows, I've added "wx3-Debug" and "wx3-Release" to the
existing "Debug" and "Release" configurations.

They depend on you having your WXWIN environment variable
pointing to your wx2 directory and a new WXWIN3 environment
variable pointing to your wx3 directory.  For instance, I
have:

WXWIN=C:\Users\yam\Documents\wxWidgets-2.8.13
WXWIN3=C:\Users\yam\Documents\wxWidgets-3.0.2

Doing this allows you to switch freely among the 4 configurations
without having to get out of Visual Studio and monkey around with
the environment.

The project files will also add the location of the wxWidgets DLLs
to the PATH when running Audacity from within Visual Studio.  They
add %WXWIN%\lib\vc_dll or %WXWIN3%\lib\vc_dll at the beginning
of the PATH variable as appropriate.

I expect that once we convert to wx3 we'll just drop back down to
the normal Debug and Release configurations, but this should make
switching between wx2 and wx3 much easier during the transition.
2014-10-16 16:18:04 +00:00

123 lines
3.2 KiB
Plaintext

#
# 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])
#
# Checks for programs.
#
AC_PROG_CXX
AM_PROG_AR
LT_INIT
#
# Checks for libraries.
#
AC_HEADER_STDC
#
# Check for debug
#
AC_ARG_ENABLE(static-wx,
[AS_HELP_STRING([--enable-static-wx],[link wx statically (default=no)])],
static_wx_preference="--static=$enableval",
static_wx_preference="")
AC_ARG_ENABLE(unicode,
[AS_HELP_STRING([--enable-unicode],[enable unicode support (default=no)])],
unicode_preference="--unicode=$enableval",
unicode_preference="")
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[enable debug support (default=none)])],
debug_preference="--debug=$enableval",
debug_preference="")
AC_ARG_ENABLE(gtk3,
[AS_HELP_STRING([--enable-gtk3],[enable use of GTK+-3.0 (default: use GTK+-2.0)])],
enable_gtk3=$enableval,
enable_gtk3=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_PROG(WX_CONFIG, wx-config, 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="$static_wx_preference $unicode_preference $debug_preference $wx_preference"
WX_CXXFLAGS=$($WX_CONFIG $wxconfigargs --cxxflags)
WX_LIBS=""
AC_SUBST([WX_CXXFLAGS])
AC_SUBST([WX_LIBS])
AC_SUBST(HAVE_GTK)
if [[ "$enable_gtk3" = yes ]]; then
PKG_CHECK_MODULES(GTK, gtk+-3.0, have_gtk=yes, have_gtk=no)
else
PKG_CHECK_MODULES(GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
fi
PKG_CHECK_MODULES(GTK, $gtk_version, have_gtk=yes, have_gtk=no)
dnl OS-specific configuration
AC_CANONICAL_HOST
IMPLEMENTATION="generic"
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
AC_SUBST([IMPLEMENTATION])
AM_CONDITIONAL([GENERIC], test "$IMPLEMENTATION" = "generic")
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_HEADERS([config.h])
AC_CONFIG_FILES([FileDialogPrivate.h Makefile])
#
# Write it all out
#
AC_OUTPUT