#configure.ac dnl - dnl represents a comment in automake config files dnl here we specify the AC_INIT(midiio,0.1) AM_INIT_AUTOMAKE(midiio, 0.1) AC_PROG_CXX AC_LANG_C dnl Checks for programs. AC_PROG_AWK AC_PROG_CC dnl Check for headers AC_CHECK_HEADERS(unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T dnl Detect OS we're building on dnl this next line is required to be able to read the host value AC_CANONICAL_HOST dnl Use the value here to add support for other operating systems echo "Host Value: '${host}'" case "${host}" in *-mingw32*) dnl specify Windows specific compiler flags and linker options compile_target=win CPPFLAGS="$CPPFLAGS -D__WINDOWS_MM__" LIBS="$LIBS -lwinmm" ;; *linux-gnu) dnl specify Linux specific compiler flags and linker options compile_target=linux dnl Check for ALSA AC_CHECK_LIB(asound, snd_seq_event_output_direct, alsalib=yes,alsalib=no) AC_CHECK_HEADERS(alsa/asoundlib.h,alsaheader=yes, alsaheader=no) if test "$alsalib" = "yes"; then if test "$alsaheader" = "yes"; then LIBS="$LIBS -lasound" else AC_MSG_ERROR([** Coulnd't find ALSA header file sys/asoundlib.h **]) fi else AC_MSG_ERROR([** Couldn't find ALSA library libasound. **]) fi CPPFLAGS="$CPPFLAGS -D__LINUX_ALSASEQ__" ;; esac AC_HEADER_STDC AM_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile src/Makefile) # Makefile.am # Here we specify we have files in the source directory to process AUTOMAKE_OPTIONS = foreign SUBDIRS = src # src/Makefile.am # Here we define there are 2 programs we're compiling bin_PROGRAMS = midiio midiout # and here we define what we put together to make the final programs midiout_SOURCES = midiout.cpp RtMidi.cpp midiio_SOURCES = midiio.cpp RtMidi.cpp