浏览代码

Add libtool support (allows ./configure --enable-shared and --enable-static)

Sebastien Alaiwan 11 年之前
父节点
当前提交
98d6f925f9
共有 3 个文件被更改,包括 8 次插入3 次删除
  1. 2 0
      .gitignore
  2. 3 2
      Makefile.am
  3. 3 1
      configure.ac

+ 2 - 0
.gitignore

@@ -1,5 +1,7 @@
 /config
+/configure
 /Makefile.in
 /aclocal.m4
 /autom4te.cache
 /configure
+/m4

+ 3 - 2
Makefile.am

@@ -1,4 +1,5 @@
-noinst_LIBRARIES += %D%/librtmidi.a
-%C%_librtmidi_a_SOURCES = \
+lib_LTLIBRARIES = %D%/librtmidi.la
+%C%_librtmidi_la_LDFLAGS = -no-undefined
+%C%_librtmidi_la_SOURCES = \
   %D%/RtMidi.cpp \
   %D%/RtMidi.h

+ 3 - 1
configure.ac

@@ -12,12 +12,14 @@ AC_SUBST(noinst_LIBRARIES)
 # Checks for programs.
 AC_PROG_CXX(g++ CC c++ cxx)
 AM_PROG_AR
-AC_PROG_RANLIB
 AC_PATH_PROG(AR, ar, no)
 if [[ $AR = "no" ]] ; then
     AC_MSG_ERROR("Could not find ar - needed to create a library");
 fi
 
+LT_INIT([win32-dll])
+AC_CONFIG_MACRO_DIR([m4])
+
 # Checks for header files.
 AC_HEADER_STDC
 #AC_CHECK_HEADERS(sys/ioctl.h unistd.h)