forked from kleinebre/hd24tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·223 lines (190 loc) · 6.7 KB
/
configure
File metadata and controls
executable file
·223 lines (190 loc) · 6.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#
# This is the start of an autotools build system. It's still very much a work
# in-progress and can't be reliably used yet. ~mcrute
#
m4_define(HD24TOOLS_VERSION, 1.0)
AC_PREREQ(2.61)
AC_INIT(hd24tools, HD24TOOLS_VERSION, http://hd24tools.com/)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
AC_SEARCH_LIBS([XpmCreatePixmapFromData], [Xpm])
AC_SEARCH_LIBS([sf_command], [sndfile])
AC_SEARCH_LIBS([jack_client_new], [jack])
AC_SEARCH_LIBS([Pa_Initialize], [portaudio])
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([FL/Fl.H arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/statvfs.h unistd.h])
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_STRUCT_TM
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor getcwd memchr memset mkdir strchr strdup strtol])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
# vim:syntax=m4:
kitchen:hd24tools alex$ cat configure
#!/bin/bash
#######################################################################
# OS Setup Routines
#######################################################################
setup_win32()
{
echo "Build environment... Microsoft Windows";
BUILD_FOR='Win32'
PORTAUDIO_MAKEOPTS='-lwinmm'
MORELIBS="$MORELIBS -lwinmm -mwindows"
# MOREDEPS="$MOREDEPS \$(BINDIR)nojack.o"
}
setup_linux_gnu()
{
echo "Build environment... GNU/Linux";
BUILD_FOR='LinuxGNU'
PORTAUDIO_MAKEOPTS='-pthread'
}
setup_linux_win32()
{
echo "Build environment... Microsoft Windows (Linux)"
BUILD_FOR='Win32Linux'
PORTAUDIO_MAKEOPTS='-lwinmm'
GCC='i586-mingw32msvc-gcc'
}
setup_darwin()
{
echo "Build environment... Macintosh OS X";
BUILD_FOR='Darwin'
JACK_MAKEOPTS='-L/sw/lib -I/sw/include'
PORTAUDIO_MAKEOPTS='-L/sw/lib -I/sw/include'
export CFLAGS="-no-cpp-precomp -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"
export CXXFLAGS="-no-cpp-precomp -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"
}
#######################################################################
# Library Tests
#######################################################################
find_fltk()
{
TEST=`fltk-config --version | awk \
'BEGIN {FS="=";version="Unavailable"} 1==1 {version=$1} END {print version}'`
if [ $? == 0 ]; then
echo "Searching for FLTK... found $TEST"
TMPCCARGS="$TMPCCARGS -DLIBFLTK=\"$TEST\""
FLTKLIB=`fltk-config --libs`
FLTK_HAS_FILE_CHOOSER=`ar t $FLTKLIB |grep -c Fl_Native_File_Chooser.o`
echo "File Chooser: $FLTK_HAS_FILE_CHOOSER"
else
echo "Searching for FLTK... not found"
echo "Can't continue."
exit 1
fi
}
#######################################################################
# Main Configure Routine
#######################################################################
main()
{
[[ -e Makefile ]] && make clean
MORELIBS='' # Extra libraries
MOREDEPS='' # Extra dependencies
BUILD_FOR='' # Build architecture
GCC='gcc' # GCC Command (different if building Win32 on Linux)
TMPCCARGS='' # Extra CC Arguments
# Check for Windows
if [[ $BUILD_FOR == '' && \
($WINDIR == "C:\\WINNT" || $WINDIR == "C:\\WINDOWS") ]];
then
setup_win32
fi
# Check for Linux or Win32 building on Linux
if [[ $BUILD_FOR == '' && \
`if [ -e /proc/version ]; then cat /proc/version | grep Linux; fi` != "" ]]
then
if [ "$1" = "--os=win32" ]; then
setup_linux_win32
else
setup_linux_gnu
fi
fi
# Check for Mac OS X
if [[ $BUILD_FOR == '' && \
("`echo $version|grep powerpc-apple-darwin`" != "" || \
"`echo $OSTYPE|grep darwin`" != "") ]]
then
setup_darwin $1
fi
# Check for Essential Libraries
find_fltk
DEBUGGING=" -O3 "
if [[ "$1" == "--debug" ]]; then
echo "Enabling debugging. $1"
DEBUGGING=" -g -DHD24DEBUG=1"
fi
if [[ "$1" == "--debug=memory" ]]; then
echo "Debugging memory."
DEBUGGING=" -g -DHD24DEBUG=1 -DMEMDEBUG=1 "
shift;
fi
if [[ "$1" == "--debug=mem" ]]; then
echo "Debugging memory."
DEBUGGING=" -g -DHD24DEBUG=1 -DMEMDEBUG=1 "
shift;
fi
if [[ "$1" == "--debug=all" ]]; then
echo "Debugging EVERYTHING."
DEBUGGING=" -g -DSMARTIMAGEDEBUG=1 -DHD24DEBUG=1 -DDEVGENDEBUG=1 -DSMPTE_DEBUG=1 -DRECORDERDEBUG=1 -DHD24FSDEBUG=1 -DHD24FSDEBUG_DEVSCAN=1 -DHD24FSDEBUG_QUICKFORMAT=1 -DHD24FSDEBUG_BITSET=1 -DHD24FSDEBUG_COMMIT=1 -DHD24FSDEBUG_CLUSTERddCALC=1 -DPROJDEBUG=1 -DSONGDEBUG=1 -DHD24SNDFILEDEBUG=1 -DHD24TRANSFERDEBUG=1 -DHD24TRACACTDEBUG=1 -DMEMDEBUG=1 "
fi
if [[ "$1" == "--debug=format" ]]; then
echo "Debugging FS formatting related issues."
DEBUGGING=" -g -DHD24FSDEBUG=1 -DHD24FSDEBUG_QUICKFORMAT=1 "
shift;
fi
if [[ "$1" == "--debug=fs" ]]; then
echo "Debugging FS related issues."
DEBUGGING=" -g -DHD24FSDEBUG=1 -DHD24FSDEBUG_QUICKFORMAT=1 -DHD24FSDEBUG_BITSET=1 -DHD24FSDEBUG_COMMIT=1 -DHD24FSDEBUG_CLUSTERCALC=1 "
shift;
fi
if [[ "$1" == "--debug=image" ]]; then
echo "Debugging FS related issues."
DEBUGGING=" -g -DSMARTIMAGEDEBUG=1 -DHD24FSDEBUG=1 -DHD24FSDEBUG_QUICKFORMAT=1 -DHD24FSDEBUG_BITSET=1 -DHD24FSDEBUG_COMMIT=1 -DHD24FSDEBUG_CLUSTERCALC=1 "
shift;
fi
if [[ "$1" == "--debug=transfer" ]]; then
echo "Debugging file transfer related issues."
DEBUGGING=" -g -DHD24DEBUG=1 -DHD24FSDEBUG=1 -DHD24TRANSFERDEBUG=1 -DHD24TRACACTDEBUG=1 -DMEMDEBUG=1 "
shift;
fi
if [[ "$1" == "--debug=recorder" ]]; then
echo "Debugging recorder related issues."
DEBUGGING=" -g -DRECORDERDEBUG=1 -DSHOWPOLL=1"
shift;
fi
if [[ "$1" == "--debug=coverage" ]]; then
echo "Compile for testing/code coverage"
DEBUGGING=" -g -fprofile-arcs -ftest-coverage -lgcov "
fi
if [[ "$1" == "--debug=test" ]]; then
echo "Compile for testing/code coverage"
DEBUGGING=" -g -fprofile-arcs -ftest-coverage "
shift;
fi
# Create the Makefile
echo "BUILD_ARCH=$BUILD_FOR" > Makefile
echo "MORELIBS=$MORELIBS" >> Makefile
echo "MOREDEPS=$MOREDEPS" >> Makefile
echo "TMPCCARGS=$TMPCCARGS" >> Makefile
echo "DEBUGGING=$DEBUGGING" >> Makefile
echo "FLTK_HAS_FILE_CHOOSER=$FLTK_HAS_FILE_CHOOSER" >> Makefile
if [[ $1 == '--with-universal' ]]; then
echo "UNIVERSAL=true" >> Makefile
fi
cat Makefile.in >> Makefile
echo -e "\nConfiguration complete. If all looked OK, now run make.";
}
main $1