Browse Source

configure.ac,Makefile.am,build.sh : Updated to use external libcm.

master
kevin 1 year ago
parent
commit
1a16a3d5d8
3 changed files with 50 additions and 27 deletions
  1. 24
    22
      Makefile.am
  2. 2
    2
      build/linux/debug/build.sh
  3. 24
    3
      configure.ac

+ 24
- 22
Makefile.am View File

@@ -1,24 +1,29 @@
1
+AM_CXXFLAGS =
2
+AM_LDFLAGS  =  
3
+AM_CPPFLAGS =
4
+AM_CFLAGS   =
5
+
1 6
 ACLOCAL_AMFLAGS = -I m4 # use custom macro's in ./m4 
2 7
 
3
-lib_LTLIBRARIES=
4
-bin_PROGRAMS=
5
-include_HEADERS=
8
+# if we are building and linking to a nested copy of libcm
9
+if BUILD_LIBCM
10
+SUBDIRS      = src/libcm
11
+AM_CPPFLAGS += -I$(srcdir)/src/libcm/src  -I$(srcdir)/src/libcm/src/dsp  -I$(srcdir)/src/libcm/src/vop  -I$(srcdir)/src/libcm/src/app
12
+AM_LDFLAGS  += -Lsrc/libcm/src
13
+endif
14
+
15
+# To Profile w/ gprof:
16
+# 1) Modify configure: ./configure --disable-shared CFLAGS="-pg"
17
+# 2) Run the program. ./foo
18
+# 3) Run gprof /libtool --mode=execute gprof ./foo
6 19
 
7 20
 # C compiler flags
8 21
 # _GNU_SOURCE - turns on GNU specific extensions and gives correct prototype for double log2(double) 
9 22
 # -Wall turn on all warnings
10 23
 # -Wno-multichar - turns off multi-character constant warnings from cmAudioFile.c
11 24
 
12
-
13
-
14
-AM_CPPFLAGS  = -D _GNU_SOURCE  -I.. -I$(srcdir)/src/libcm  -I$(srcdir)/src/libcm/dsp  -I$(srcdir)/src/libcm/vop  -I$(srcdir)/src/libcm/app
15
-AM_CPPFLAGS +=  -I$(srcdir)/src/libcmpp -I$(srcdir)/src/libcmpp/fltk -I$(srcdir)/src/tlCtl 
16
-AM_CFLAGS    = -Wno-multichar 
17
-AM_CXXFLAGS  = 
18
-AM_LDFLAGS   =  
19
-MYLIBS       = -lpthread  -lfftw3f -lfftw3 -lfltk -lX11
20
-CMLIBS       = src/libcm/libcm.la  src/libcmpp/libcmpp.la # autoconfig manual recommends storing direct referenes to non-3rd party libraries rather than using -L and -l
21
-
25
+AM_CPPFLAGS += -D _GNU_SOURCE  -I.. -I$(srcdir)/src/libcmpp -I$(srcdir)/src/libcmpp/fltk -I$(srcdir)/src/tlCtl 
26
+AM_CFLAGS   += -Wno-multichar 
22 27
 
23 28
 # debug/release switches
24 29
 if DEBUG
@@ -29,6 +34,8 @@ else
29 34
   AM_CXXFLAGS += -O3
30 35
 endif
31 36
 
37
+MYLIBS       = -lpthread  -lfftw3f -lfftw3 -lfltk -lX11 -lcm
38
+
32 39
 # NOTE: 10/25/12 The use of -Wl, -Bstatic -Wl, -Bdynamic forces linking
33 40
 # against the static version of 'libasound' and then turns dynamic linking
34 41
 # back on for the other libraries.
@@ -53,15 +60,10 @@ if OS_OSX
53 60
  AM_LDFLAGS  +=  -framework Cocoa -framework CoreAudio -framework CoreMIDI -framework Carbon -framework Accelerate
54 61
 endif
55 62
 
56
-include src/libcm/Makefile.am
57
-src_libcm_libcm_la_SOURCES   = $(cmSRC) $(cmHDR)
58
-include_HEADERS += $(cmHDR)
59
-lib_LTLIBRARIES += src/libcm/libcm.la
60
-
61 63
 include src/libcmpp/Makefile.am
62 64
 src_libcmpp_libcmpp_la_SOURCES = $(cmppSRC) $(cmppHDR)
63
-include_HEADERS                     += $(cmppHDR)
64
-lib_LTLIBRARIES                     += src/libcmpp/libcmpp.la
65
+include_HEADERS                = $(cmppHDR)
66
+lib_LTLIBRARIES                = src/libcmpp/libcmpp.la
65 67
 
66 68
 include src/tlCtl/Makefile.am
67 69
 src_kc_kc_SOURCES  = $(tlCtlSRC)
@@ -69,5 +71,5 @@ src_kc_kc_SOURCES  = $(tlCtlSRC)
69 71
 src_kc_kc_SOURCES += src/kc/kcMain.cpp 
70 72
 src_kc_kc_SOURCES += src/kc/kcApp.h          src/kc/kcApp.cpp 
71 73
 
72
-src_kc_kc_LDADD    = $(CMLIBS) $(MYLIBS)
73
-bin_PROGRAMS                += src/kc/kc
74
+src_kc_kc_LDADD    = src/libcmpp/libcmpp.la  $(MYLIBS) 
75
+bin_PROGRAMS       = src/kc/kc

+ 2
- 2
build/linux/debug/build.sh View File

@@ -11,8 +11,8 @@ cd ${curdir}
11 11
 		   --enable-debug \
12 12
 		   CFLAGS="-g -Wall" \
13 13
 		   CXXFLAGS="-g -Wall" \
14
-		   CPPFLAGS= \
15
-		   LDFLAGS= \
14
+		   CPPFLAGS="-I/home/kevin/src/libcm/build/linux/debug/include " \
15
+		   LDFLAGS="-L/home/kevin/src/libcm/build/linux/debug/lib" \
16 16
 		   LIBS=
17 17
 #		   --enable-sonicart \
18 18
 

+ 24
- 3
configure.ac View File

@@ -3,7 +3,7 @@
3 3
 # this configure.ac or any of the Makefile.am files.
4 4
 #
5 5
 
6
-AC_INIT([kc],[1.0],[kc@larke.org])
6
+AC_INIT([kc],[1.0],[kl@currawongproject.org])
7 7
 AC_CONFIG_AUX_DIR([build-aux])                    # put aux files in build-aux
8 8
 AM_INIT_AUTOMAKE([1.9 -Wall foreign subdir-objects]) # subdir-objects needed for non-recursive make
9 9
 AC_CONFIG_SRCDIR([src/kc/kcMain.cpp])
@@ -50,7 +50,6 @@ AC_CHECK_FUNCS([clock_gettime floor memmove memset mkdir pow rint select socket
50 50
 # be sure to also set "ACLOCAL_AMFLAGS = -I m4" in ./Makefile.am
51 51
 # Defines the config.h variable OS_LINUX or OS_OSX
52 52
 AX_FUNC_OS_TYPE
53
-
54 53
 AX_FUNC_OS_64
55 54
 
56 55
 # ac_cv_os_type is set by AX_FUNC_OS_TYPE
@@ -61,6 +60,23 @@ echo "OS='${ax_cv_os_type}'"
61 60
 AM_CONDITIONAL([OS_64],[test x"${ax_cv_os_64}" == xx86_64])
62 61
 echo "ptr width='${ax_cv_os_64}'"
63 62
 
63
+# check if a request has been made to build libcm
64
+AC_ARG_ENABLE([build_libcm],
65
+     [  --enable-build_libcm    libcm is included in the local source tree],
66
+     [case "${enableval}" in
67
+       yes) build_libcm=true ;;
68
+       no)  build_libcm=false ;;
69
+       *) AC_MSG_ERROR([bad value ${enableval} for --enable-build_libcm]) ;;
70
+     esac],[build_libcm=false])
71
+     
72
+echo "build_libcm=${build_libcm}"
73
+
74
+# check if a nested copy of libcm exists in /src/libcm
75
+AC_CHECK_FILE([${srcdir}/src/libcm/src/cmGlobal.h],[local_libcm=true],[local_libcm=false])
76
+echo "local_libcm=${local_libcm}"
77
+
78
+# set BUILD_LIBCM if a libcm build request was set and a nested copy of libcm exists
79
+AM_CONDITIONAL([BUILD_LIBCM], [test x$build_libcm = xtrue -a x$local_libcm = xtrue ])
64 80
 
65 81
 AC_ARG_ENABLE([debug],
66 82
      [  --enable-debug    Turn on debugging],
@@ -125,6 +141,11 @@ fi
125 141
 
126 142
 AM_CONDITIONAL([INC_SONICART], [test x$sonicart = xtrue])
127 143
 
128
-
129 144
 AC_CONFIG_FILES([ Makefile ])
145
+
146
+# if local nested libcm then do recursive configure into subdirs
147
+if test x$build_libcm = xtrue -a x$local_libcm = xtrue; then
148
+AC_CONFIG_SUBDIRS([src/libcm])
149
+fi
150
+
130 151
 AC_OUTPUT

Loading…
Cancel
Save