From: Andre Noll Date: Thu, 31 Aug 2006 20:00:21 +0000 (+0200) Subject: major autoconf update X-Git-Tag: v0.2.14~24 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c17c55aed657fc3104c7edbee56d877a3f8ec05d;p=paraslash.git major autoconf update - switch from AC_ARG_ENABLE to AC_ARG_WITH - set/unset CPPFLAGS and LDFLAGS for each test separately - make location of ortp headers/libs configurable, nuke --disable-ortp --- diff --git a/configure.ac b/configure.ac index 85f4c829..71e82776 100644 --- a/configure.ac +++ b/configure.ac @@ -209,6 +209,8 @@ AC_CHECK_HEADER(SDL/SDL.h, [], ########################################################################### mysql have_mysql="yes" +OLD_CPPFLAGS="$CPPFLAGS" +OLD_LD_FLAGS="$LDFLAGS" AC_ARG_WITH(mysql_headers, [AC_HELP_STRING(--with-mysql-headers=dir, [look for mysql.h also in dir])]) if test -n "$with_mysql_headers"; then @@ -237,6 +239,8 @@ if test "$have_mysql" = "yes"; then else AC_MSG_WARN([cannot build mysql-based audio file selector]) fi +CPPFLAGS="$OLD_CPPFLAGS" +LDFLAGS="$OLD_LDFLAGS" ########################################################################### ogg have_ogg="yes" AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ @@ -270,6 +274,8 @@ else fi ########################################################################### faad have_faad=yes +OLD_CPPFLAGS="$CPPFLAGS" +OLD_LD_FLAGS="$LDFLAGS" AC_ARG_WITH(faad_headers, [AC_HELP_STRING(--with-faad-headers=dir, [look for neaacdec.h also in dir])]) if test -n "$with_faad_headers"; then @@ -301,8 +307,12 @@ if test "$have_faad" = "yes"; then else AC_MSG_WARN([no aac support in para_audiod/para_filter]) fi +CPPFLAGS="$OLD_CPPFLAGS" +LDFLAGS="$OLD_LDFLAGS" ########################################################################### mad have_mad="yes" +OLD_CPPFLAGS="$CPPFLAGS" +OLD_LD_FLAGS="$LDFLAGS" AC_ARG_WITH(mad_headers, [AC_HELP_STRING(--with-mad-headers=dir, [look for mad.h also in dir])]) if test -n "$with_mad_headers"; then @@ -339,6 +349,8 @@ if test -n "$audiod_audio_formats"; then else AC_MSG_WARN([can not build para_audiod (no supported audio formats)]) fi +CPPFLAGS="$OLD_CPPFLAGS" +LDFLAGS="$OLD_LDFLAGS" ########################################################################### alsa have_alsa="yes" msg="=> no alsa support for para_audiod/para_write" @@ -362,19 +374,22 @@ if test "$have_alsa" = "yes"; then fi ########################################################################### ortp have_ortp="yes" -AC_ARG_ENABLE(ortp, AC_HELP_STRING([--disable-ortp], [Disable ortp support]), - if test x$enableval = xno; then - have_ortp=no - fi -) -if test "$have_ortp" = "yes"; then - AC_CHECK_HEADERS([ortp/ortp.h], [], [ - have_ortp="no" - ]) - AC_CHECK_LIB([ortp], [ortp_init], [], [ - have_ortp="no" - ]) +OLD_CPPFLAGS="$CPPFLAGS" +OLD_LD_FLAGS="$LDFLAGS" +AC_ARG_WITH(ortp_headers, [AC_HELP_STRING(--with-ortp-headers=dir, + [look for ortp/ortp.h also in dir])]) +if test -n "$with_ortp_headers"; then + ortp_cppflags="-I$with_ortp_headers" + CPPFLAGS="$CPPFLAGS $ortp_cppflags" +fi +AC_ARG_WITH(ortp_libs, [AC_HELP_STRING(--with-ortp-libs=dir, + [look for libortp also in dir])]) +if test -n "$with_ortp_libs"; then + ortp_libs="-L$with_ortp_libs" + LDFLAGS="$LDFLAGS $ortp_libs" fi +AC_CHECK_HEADERS([ortp/ortp.h], [], [have_ortp="no"]) +AC_CHECK_LIB([ortp], [ortp_init], [], [have_ortp="no"]) if test "$have_ortp" = "yes"; then recv_cmdline_objs="$recv_cmdline_objs ortp_recv.cmdline" recv_errlist_objs="$recv_errlist_objs ortp_recv" @@ -384,20 +399,20 @@ if test "$have_ortp" = "yes"; then server_errlist_objs="$server_errlist_objs ortp_send" - recv_ldflags="$recv_ldflags -lortp" - server_ldflags="$server_ldflags -lortp" - audiod_ldflags="$audiod_ldflags -lortp" + recv_ldflags="$recv_ldflags $ortp_libs -lortp" + server_ldflags="$server_ldflags $ortp_libs -lortp" + audiod_ldflags="$audiod_ldflags $ortp_libs -lortp" receivers="$receivers ortp" senders="$senders ortp" AC_DEFINE(HAVE_ORTP, 1, [define to 1 to turn on ortp support]) - + AC_SUBST(ortp_cppflags) + AC_SUBST(ortp_libs) else - AC_MSG_NOTICE([deactivating ortp support]) + AC_MSG_NOTICE([deactivating ortp sender/receiver]) fi -AC_SUBST(GLIB_CFLAGS) -AC_SUBST(GLIB_LIBS) - +CPPFLAGS="$OLD_CPPFLAGS" +LDFLAGS="$OLD_LDFLAGS" ########################################################################### zmw slide="para_slider" msg="can not build para_slider" @@ -490,7 +505,7 @@ AC_SUBST(gui_objs, add_dot_o($gui_objs)) AC_OUTPUT AC_MSG_NOTICE([creating Makefile.deps]) -gcc -MM -MG $mysql_cppflags $faad_cppflags $mad_cppflags *.c > Makefile.deps +gcc -MM -MG $mysql_cppflags $faad_cppflags $mad_cppflags $ortp_cppflags *.c > Makefile.deps AC_MSG_NOTICE([ paraslash configuration: ~~~~~~~~~~~~~~~~~~~~~~~~