ons, 2003-03-26 kl. 10:13 skrev Takashi Iwai:
> > For now the program will compile with gtk1 unless you apply the second
> > patch yourself. I will try to make it use gtk2 as default and fall back
> > to gtk1 if gtk2 is not present.
>
> please note that, so far, we still don't define pkgconfig as default
> requirement for alsa-tools package...
> although i prefer pkgconfig, there are still old systems which don't
> have it.
On a computer with pkgconfig autoconf will generate a configure script
that will first try gtk2 and if that fails it will use gtk1.
On a computer without pkgconfig you will get a configure script that
will allways use gtk1.
The configure script is a little (too?) ugly, but I think it works
though I have not been able to test all combinations fully.
Maybee it is better to keep the patch???
Søren
AC_INIT(envy24control.c)
AM_INIT_AUTOMAKE(envy24control, 0.1.0)
AC_PROG_CC
AC_PROG_INSTALL
AC_HEADER_STDC
ALSA_REQUIRED=0.9.0
ifdef([PKG_CHECK_MODULES],
[echo "GTK2"
PKG_CHECK_MODULES(
ENVY24CONTROL,
gtk+-2.0 alsa >= $ALSA_REQUIRED,[],
[echo GTK1
AM_PATH_GTK(1.0.1)
AM_PATH_ALSA($ALSA_REQUIRED)
CFLAGS="$CFLAGS $GTK_CFLAGS $ALSA_FLAGS"
LDFLAGS="$LDFLAGS $GTK_LIBS $ALSA_LIBS"
ENVY24CONTROL_CFLAGS="$CFLAGS"
ENVY24CONTROL_LIBS="$GTK_LIBS"])],
[echo GTK1
AM_PATH_GTK(1.0.1)
AM_PATH_ALSA($ALSA_REQUIRED)
CFLAGS="$CFLAGS $GTK_CFLAGS $ALSA_FLAGS"
LDFLAGS="$LDFLAGS $GTK_LIBS $ALSA_LIBS"
ENVY24CONTROL_CFLAGS="$CFLAGS"
ENVY24CONTROL_LIBS="$GTK_LIBS"]])
AC_SUBST(ENVY24CONTROL_CFLAGS)
AC_SUBST(ENVY24CONTROL_LIBS)
AC_OUTPUT(Makefile)
INCLUDES=\
@ENVY24CONTROL_CFLAGS@
bin_PROGRAMS = envy24control
man_MANS = envy24control.1
envy24control_SOURCES = envy24control.c envy24control.h levelmeters.c \
mixer.c patchbay.c hardware.c driverevents.c volume.c
envy24control_LDFLAGS = $(ENVY24CONTROL_LIBS)
EXTRA_DIST = cvscompile envy24control.1 depcomp
clean:
rm -rf .deps *~
alsa-dist: distdir
@rm -rf ../distdir/envy24control
@mkdir -p ../distdir/envy24control
@cp -RLpv $(distdir)/* ../distdir/envy24control
@rm -rf $(distdir)