configure.in 1.56 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
dnl
dnl PortAudio configure.in script
dnl
dnl Dominic Mazzoni
dnl

dnl Require autoconf >= 2.13
AC_PREREQ(2.13)

dnl Init autoconf and make sure configure is being called
dnl from the right directory
AC_INIT([pa_common/portaudio.h])

dnl Checks for programs
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PATH_PROG(AR, ar, no)
if [[ $AR = "no" ]] ; then
   AC_MSG_ERROR("Could not find ar - needed to create a library");
fi

dnl Extra variables we want to substitute
AC_SUBST(OTHER_OBJS)
25 26
AC_SUBST(PADLL)
AC_SUBST(SHARED_FLAGS)
27
AC_SUBST(DLL_LIBS)
28 29 30 31 32 33 34 35 36

dnl Determine the host operating system / platform
AC_CANONICAL_HOST

case "${host_os}" in
  darwin* )
	dnl Mac OS X configuration

	OTHER_OBJS="pa_mac_core/pa_mac_core.o";
37 38 39
	LIBS="-framework CoreAudio -lm";
	PADLL="libportaudio.dylib";
	SHARED_FLAGS="-framework CoreAudio -dynamiclib";
40 41
	;;

42 43 44 45 46 47 48 49 50 51
  mingw* )
	dnl MingW configuration

	OTHER_OBJS="pa_win_wmme/pa_win_wmme.o";
	LIBS="-lwinmm -lm";
	PADLL="portaudio.dll";
	SHARED_FLAGS="-shared -mthreads";
	DLL_LIBS="-lwinmm";
	;;

52 53 54 55 56 57 58 59 60 61
  cygwin* )
	dnl Cygwin configuration

	OTHER_OBJS="pa_win_wmme/pa_win_wmme.o";
	LIBS="-lwinmm -lm";
	PADLL="portaudio.dll";
	SHARED_FLAGS="-shared -mthreads";
	DLL_LIBS="-lwinmm";
	;;

62 63 64 65 66 67 68 69 70
  *)
	dnl Unix OSS configuration

   AC_CHECK_LIB(pthread, pthread_create,
                ,
                AC_MSG_ERROR([libpthread not found!]))

	OTHER_OBJS="pa_unix_oss/pa_unix_oss.o";
	LIBS="-lm -lpthread";
71 72
	PADLL="libportaudio.so";
	SHARED_FLAGS="-shared";
73 74 75 76 77 78 79 80 81
esac

AC_OUTPUT([Makefile])

echo ""
echo "Finished configure."

echo ""
echo "Type 'make' to build PortAudio and examples."