Support both GTK+1.2 and GTK+2.x

Support both GTK+ 1.2 and GTK+ 2.x in single configure scripts.
GTK+ 2.x is used unless --with-gtk2=no is given.

If you have no gtk1 or gtk2 devel packages, use configure.in-gtk1
or -gtk2 and do autoreconf.
This commit is contained in:
Takashi Iwai 2006-03-29 11:33:02 +00:00
parent 3cda29dba9
commit 5341e4ece0
12 changed files with 114 additions and 56 deletions

View file

@ -5,7 +5,7 @@ envy24control_SOURCES = envy24control.c envy24control.h levelmeters.c midi.c \
mixer.c patchbay.c hardware.c driverevents.c volume.c \
profiles.c profiles.h midi.h config.c config.h
envy24control_LDFLAGS = @ENVY24CONTROL_LIBS@
EXTRA_DIST = envy24control.1 depcomp configure.in-gtk2 \
EXTRA_DIST = envy24control.1 depcomp configure.in-gtk1 configure.in-gtk2 \
strstr_icase_blank.c new_process.c README.profiles
AUTOMAKE_OPTIONS = foreign

View file

@ -5,6 +5,8 @@ Needs:
To build (from unpacked tarball):
./configure
If you use GTK+-1.2, pass --with-gtk2=no
make
su -c 'make install'

View file

@ -4,39 +4,23 @@ AC_PROG_CC
AC_PROG_INSTALL
AC_HEADER_STDC
AC_ARG_WITH(gtk2,
[ --with-gtk2=yes,no Build with GTK+2 (default = yes)],
with_gtk2="$withval", with_gtk2="yes")
if test "$with_gtk2" = "yes"; then
PKG_CHECK_MODULES(ENVY24CONTROL, gtk+-2.0 alsa >= 0.9.0)
else
AM_PATH_GTK(1.0.1)
AM_PATH_ALSA(1.0.0)
ENVY24CONTROL_CFLAGS="$CFLAGS $ALSA_CFLAGS $GTK_CFLAGS"
ENVY24CONTROL_LIBS="$LIBS $ALSA_LIBS $GTK_LIBS"
AC_SUBST(ENVY24CONTROL_CFLAGS)
AC_SUBST(ENVY24CONTROL_LIBS)
#AC_SUBST(ALSACTL)
dnl add the mkdir program
AC_ARG_WITH(mkdir-prog,
[ --with-mkdir-prog=PROG Complete path and name from mkdir(optional)],
[mkdir_prog="$withval"], [mkdir_prog=""])
AC_MSG_CHECKING(for MKDIR)
if test "$mkdir_prog" != "" ; then
MKDIR="$mkdir_prog"
else
if test -x "/bin/mkdir" ; then
MKDIR="/bin/mkdir"
elif test -x "${bindir}/mkdir" ; then
MKDIR="${bindir}/mkdir"
elif test -x "${sbindir}/mkdir" ; then
MKDIR="${sbindir}/mkdir"
elif test -x "/sbin/mkdir" ; then
MKDIR="/sbin/mkdir"
elif test -x "/usr/bin/mkdir" ; then
MKDIR="/usr/bin/mkdir"
elif test -x "/usr/sbin/mkdir" ; then
MKDIR="/usr/sbin/mkdir"
else
MKDIR="not found."
fi
fi
AC_MSG_RESULT($MKDIR)
AC_SUBST(MKDIR)
AC_OUTPUT(Makefile)

View file

@ -0,0 +1,42 @@
AC_INIT(envy24control.c)
AM_INIT_AUTOMAKE(envy24control, 0.6.0)
AC_PROG_CC
AC_PROG_INSTALL
AC_HEADER_STDC
AM_PATH_GTK(1.0.1)
AM_PATH_ALSA(1.0.0)
ENVY24CONTROL_CFLAGS="$CFLAGS $ALSA_CFLAGS $GTK_CFLAGS"
ENVY24CONTROL_LIBS="$LIBS $ALSA_LIBS $GTK_LIBS"
AC_SUBST(ENVY24CONTROL_CFLAGS)
AC_SUBST(ENVY24CONTROL_LIBS)
#AC_SUBST(ALSACTL)
dnl add the mkdir program
AC_ARG_WITH(mkdir-prog,
[ --with-mkdir-prog=PROG Complete path and name from mkdir(optional)],
[mkdir_prog="$withval"], [mkdir_prog=""])
AC_MSG_CHECKING(for MKDIR)
if test "$mkdir_prog" != "" ; then
MKDIR="$mkdir_prog"
else
if test -x "/bin/mkdir" ; then
MKDIR="/bin/mkdir"
elif test -x "${bindir}/mkdir" ; then
MKDIR="${bindir}/mkdir"
elif test -x "${sbindir}/mkdir" ; then
MKDIR="${sbindir}/mkdir"
elif test -x "/sbin/mkdir" ; then
MKDIR="/sbin/mkdir"
elif test -x "/usr/bin/mkdir" ; then
MKDIR="/usr/bin/mkdir"
elif test -x "/usr/sbin/mkdir" ; then
MKDIR="/usr/sbin/mkdir"
else
MKDIR="not found."
fi
fi
AC_MSG_RESULT($MKDIR)
AC_SUBST(MKDIR)
AC_OUTPUT(Makefile)