Browse Source

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

master
kevin 3 years 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
+AM_CXXFLAGS =
2
+AM_LDFLAGS  =  
3
+AM_CPPFLAGS =
4
+AM_CFLAGS   =
5
+
1
 ACLOCAL_AMFLAGS = -I m4 # use custom macro's in ./m4 
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
 # C compiler flags
20
 # C compiler flags
8
 # _GNU_SOURCE - turns on GNU specific extensions and gives correct prototype for double log2(double) 
21
 # _GNU_SOURCE - turns on GNU specific extensions and gives correct prototype for double log2(double) 
9
 # -Wall turn on all warnings
22
 # -Wall turn on all warnings
10
 # -Wno-multichar - turns off multi-character constant warnings from cmAudioFile.c
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
 # debug/release switches
28
 # debug/release switches
24
 if DEBUG
29
 if DEBUG
29
   AM_CXXFLAGS += -O3
34
   AM_CXXFLAGS += -O3
30
 endif
35
 endif
31
 
36
 
37
+MYLIBS       = -lpthread  -lfftw3f -lfftw3 -lfltk -lX11 -lcm
38
+
32
 # NOTE: 10/25/12 The use of -Wl, -Bstatic -Wl, -Bdynamic forces linking
39
 # NOTE: 10/25/12 The use of -Wl, -Bstatic -Wl, -Bdynamic forces linking
33
 # against the static version of 'libasound' and then turns dynamic linking
40
 # against the static version of 'libasound' and then turns dynamic linking
34
 # back on for the other libraries.
41
 # back on for the other libraries.
53
  AM_LDFLAGS  +=  -framework Cocoa -framework CoreAudio -framework CoreMIDI -framework Carbon -framework Accelerate
60
  AM_LDFLAGS  +=  -framework Cocoa -framework CoreAudio -framework CoreMIDI -framework Carbon -framework Accelerate
54
 endif
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
 include src/libcmpp/Makefile.am
63
 include src/libcmpp/Makefile.am
62
 src_libcmpp_libcmpp_la_SOURCES = $(cmppSRC) $(cmppHDR)
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
 include src/tlCtl/Makefile.am
68
 include src/tlCtl/Makefile.am
67
 src_kc_kc_SOURCES  = $(tlCtlSRC)
69
 src_kc_kc_SOURCES  = $(tlCtlSRC)
69
 src_kc_kc_SOURCES += src/kc/kcMain.cpp 
71
 src_kc_kc_SOURCES += src/kc/kcMain.cpp 
70
 src_kc_kc_SOURCES += src/kc/kcApp.h          src/kc/kcApp.cpp 
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
 		   --enable-debug \
11
 		   --enable-debug \
12
 		   CFLAGS="-g -Wall" \
12
 		   CFLAGS="-g -Wall" \
13
 		   CXXFLAGS="-g -Wall" \
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
 		   LIBS=
16
 		   LIBS=
17
 #		   --enable-sonicart \
17
 #		   --enable-sonicart \
18
 
18
 

+ 24
- 3
configure.ac View File

3
 # this configure.ac or any of the Makefile.am files.
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
 AC_CONFIG_AUX_DIR([build-aux])                    # put aux files in build-aux
7
 AC_CONFIG_AUX_DIR([build-aux])                    # put aux files in build-aux
8
 AM_INIT_AUTOMAKE([1.9 -Wall foreign subdir-objects]) # subdir-objects needed for non-recursive make
8
 AM_INIT_AUTOMAKE([1.9 -Wall foreign subdir-objects]) # subdir-objects needed for non-recursive make
9
 AC_CONFIG_SRCDIR([src/kc/kcMain.cpp])
9
 AC_CONFIG_SRCDIR([src/kc/kcMain.cpp])
50
 # be sure to also set "ACLOCAL_AMFLAGS = -I m4" in ./Makefile.am
50
 # be sure to also set "ACLOCAL_AMFLAGS = -I m4" in ./Makefile.am
51
 # Defines the config.h variable OS_LINUX or OS_OSX
51
 # Defines the config.h variable OS_LINUX or OS_OSX
52
 AX_FUNC_OS_TYPE
52
 AX_FUNC_OS_TYPE
53
-
54
 AX_FUNC_OS_64
53
 AX_FUNC_OS_64
55
 
54
 
56
 # ac_cv_os_type is set by AX_FUNC_OS_TYPE
55
 # ac_cv_os_type is set by AX_FUNC_OS_TYPE
61
 AM_CONDITIONAL([OS_64],[test x"${ax_cv_os_64}" == xx86_64])
60
 AM_CONDITIONAL([OS_64],[test x"${ax_cv_os_64}" == xx86_64])
62
 echo "ptr width='${ax_cv_os_64}'"
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
 AC_ARG_ENABLE([debug],
81
 AC_ARG_ENABLE([debug],
66
      [  --enable-debug    Turn on debugging],
82
      [  --enable-debug    Turn on debugging],
125
 
141
 
126
 AM_CONDITIONAL([INC_SONICART], [test x$sonicart = xtrue])
142
 AM_CONDITIONAL([INC_SONICART], [test x$sonicart = xtrue])
127
 
143
 
128
-
129
 AC_CONFIG_FILES([ Makefile ])
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
 AC_OUTPUT
151
 AC_OUTPUT

Loading…
Cancel
Save