@@ -12,8 +12,9 @@ AM_INIT_AUTOMAKE([foreign subdir-objects 1.11])
1212AM_SILENT_RULES ([ yes] )
1313
1414# Use static linking for select libraries
15- : ${LIBAV_CFLAGS="-static"}
16- : ${LIBAV_LDFLAGS="-llibavcodec.a -llibavformat.a -llibavfilter.a -llibavutil.a -llibwscale.a"}
15+ # Still debugging - the -L stuff below cannot remain as is.
16+ # : ${LIBAV_CFLAGS="-static"}
17+ # : ${LIBAV_LIBS="-lavcodec -lavformat -lavfilter -lavutil -lswscale -llzma"}
1718
1819AC_USE_SYSTEM_EXTENSIONS
1920
@@ -48,6 +49,74 @@ dnl Enable all warnings by default.
4849AM_CPPFLAGS="-Wall"
4950AC_SUBST ( [ AM_CPPFLAGS] )
5051
52+ dnl Checks for header files.
53+ AC_CHECK_HEADERS_ONCE ( [ regex.h pthread_np.h] )
54+ AC_CHECK_HEADERS ( [ sys/wait.h sys/param.h dirent.h getopt.h stdint.h] , [ ] ,
55+ [ AC_MSG_ERROR ( [ [ Missing header required to build OwnTone] ] ) ] )
56+ AC_CHECK_HEADERS ( [ time.h] , [ ] ,
57+ [ AC_MSG_ERROR ( [ [ Missing header required to build OwnTone] ] ) ] )
58+ AC_CHECK_FUNCS_ONCE ( [ posix_fadvise pipe2 gettid] )
59+ AC_CHECK_FUNCS ( [ strptime strtok_r] , [ ] ,
60+ [ AC_MSG_ERROR ( [ [ Missing function required to build OwnTone] ] ) ] )
61+
62+ dnl check for clock_gettime or replace it
63+ AC_SEARCH_LIBS ( [ clock_gettime] , [ rt] ,
64+ [ AC_DEFINE ( [ HAVE_CLOCK_GETTIME] , 1 ,
65+ [ Define to 1 if have clock_gettime function] ) ] ,
66+ [ AC_CHECK_HEADER ( [ mach/mach_time.h] ,
67+ [ AC_DEFINE ( [ HAVE_MACH_CLOCK] , 1 ,
68+ [ Define to 1 if mach kernel clock replacement available] ) ] ,
69+ [ AC_MSG_ERROR ( [ [ Missing clock_gettime and any replacement] ] ) ] ) ] )
70+
71+ dnl check for timer_settime or replace it
72+ AC_SEARCH_LIBS ( [ timer_settime] , [ rt] ,
73+ [ AC_DEFINE ( [ HAVE_TIMER_SETTIME] , 1 ,
74+ [ Define to 1 if have timer_settime function] ) ] ,
75+ [ AC_CHECK_HEADER ( [ mach/mach_time.h] ,
76+ [ AC_DEFINE ( [ HAVE_MACH_TIMER] , 1 ,
77+ [ Define to 1 if mach kernel clock replacement available] ) ] ,
78+ [ AC_MSG_ERROR ( [ [ Missing timer_settime and any replacement] ] ) ] ) ] )
79+
80+ AC_SEARCH_LIBS ( [ pthread_exit] , [ pthread] , [ ] ,
81+ [ AC_MSG_ERROR ( [ [ pthreads library is required] ] ) ] )
82+ AC_SEARCH_LIBS ( [ pthread_setname_np] , [ pthread] ,
83+ [ dnl Validate pthread_setname_np with 2 args (some have 1)
84+ AC_MSG_CHECKING ( [ [ for two-parameter pthread_setname_np] ] )
85+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ @%:@ include <pthread.h>] ] ,
86+ [ [ pthread_setname_np(pthread_self(), "name");] ] ) ] ,
87+ [ AC_MSG_RESULT ( [ yes] )
88+ AC_DEFINE ( [ HAVE_PTHREAD_SETNAME_NP] , 1 ,
89+ [ Define to 1 if you have pthread_setname_np] ) ] ,
90+ [ AC_MSG_RESULT ( [ [ no] ] ) ] ) ] ,
91+ [ AC_SEARCH_LIBS ( [ pthread_set_name_np] , [ pthread] ,
92+ [ AC_CHECK_FUNCS ( [ pthread_set_name_np] ) ] ) ] )
93+ AC_SEARCH_LIBS ( [ pthread_getname_np] , [ pthread] ,
94+ [ AC_DEFINE ( [ HAVE_PTHREAD_GETNAME_NP] , 1 ,
95+ [ Define to 1 if you have pthread_getname_np] ) ]
96+ [ AC_SEARCH_LIBS ( [ pthread_get_name_np] , [ pthread] ,
97+ [ AC_DEFINE ( [ HAVE_PTHREAD_GETNAME_NP] , 1 ,
98+ [ Define to 1 if you have pthread_get_name_np] ) ] ) ] )
99+ AC_SEARCH_LIBS ( [ pthread_getthreadid_np] , [ pthread] ,
100+ [ AC_DEFINE ( [ HAVE_PTHREAD_GETTHREADID_NP] , 1 ,
101+ [ Define to 1 if you have pthread_getthreadid_np] ) ] )
102+ AC_SEARCH_LIBS ( [ uuid_generate_random] , [ uuid] ,
103+ [ AC_DEFINE ( [ HAVE_UUID] , 1 ,
104+ [ Define to 1 if you have uuid_generate_random] ) ] )
105+ AC_SEARCH_LIBS ( [ copy_file_range] , [ c] ,
106+ [ AC_DEFINE ( [ HAVE_COPY_FILE_RANGE] , 1 ,
107+ [ Define to 1 if you have copy_file_range] ) ] )
108+ AC_SEARCH_LIBS ( [ fcopyfile] , [ c] ,
109+ [ AC_DEFINE ( [ HAVE_FCOPYFILE] , 1 ,
110+ [ Define to 1 if you have fcopyfile] ) ] )
111+
112+ AC_SEARCH_LIBS ( [ log10] , [ m] )
113+ AC_SEARCH_LIBS ( [ lrint] , [ m] )
114+ AC_SEARCH_LIBS ( [ fabs] , [ m] )
115+
116+ dnl Large File Support (LFS)
117+ AC_SYS_LARGEFILE
118+ AC_TYPE_OFF_T
119+
51120# Checks for libraries.
52121AC_SUBST ( [ COMMON_LIBS] )
53122AC_SUBST ( [ COMMON_CPPFLAGS] )
@@ -182,78 +251,6 @@ OWNTONE_MODULES_CHECK([OWNTONE], [LIBAV],
182251
183252AC_CHECK_SIZEOF ( [ void *] )
184253
185- # Checks for header files.
186- AC_CHECK_HEADERS_ONCE ( [ regex.h pthread_np.h] )
187- AC_CHECK_HEADERS ( [ sys/wait.h sys/param.h dirent.h getopt.h stdint.h] , [ ] ,
188- [ AC_MSG_ERROR ( [ [ Missing header required to build OwnTone] ] ) ] )
189- AC_CHECK_HEADERS ( [ time.h] , [ ] ,
190- [ AC_MSG_ERROR ( [ [ Missing header required to build OwnTone] ] ) ] )
191- AC_CHECK_FUNCS_ONCE ( [ posix_fadvise pipe2 gettid] )
192- AC_CHECK_FUNCS ( [ strptime strtok_r] , [ ] ,
193- [ AC_MSG_ERROR ( [ [ Missing function required to build OwnTone] ] ) ] )
194-
195- # check for clock_gettime or replace it
196- AC_SEARCH_LIBS ( [ clock_gettime] , [ rt] ,
197- [ AC_DEFINE ( [ HAVE_CLOCK_GETTIME] , 1 ,
198- [ Define to 1 if have clock_gettime function] ) ] ,
199- [ AC_CHECK_HEADER ( [ mach/mach_time.h] ,
200- [ AC_DEFINE ( [ HAVE_MACH_CLOCK] , 1 ,
201- [ Define to 1 if mach kernel clock replacement available] ) ] ,
202- [ AC_MSG_ERROR ( [ [ Missing clock_gettime and any replacement] ] ) ] ) ] )
203-
204- # check for timer_settime or replace it
205- AC_SEARCH_LIBS ( [ timer_settime] , [ rt] ,
206- [ AC_DEFINE ( [ HAVE_TIMER_SETTIME] , 1 ,
207- [ Define to 1 if have timer_settime function] ) ] ,
208- [ AC_CHECK_HEADER ( [ mach/mach_time.h] ,
209- [ AC_DEFINE ( [ HAVE_MACH_TIMER] , 1 ,
210- [ Define to 1 if mach kernel clock replacement available] ) ] ,
211- [ AC_MSG_ERROR ( [ [ Missing timer_settime and any replacement] ] ) ] ) ] )
212-
213- AC_SEARCH_LIBS ( [ pthread_exit] , [ pthread] , [ ] ,
214- [ AC_MSG_ERROR ( [ [ pthreads library is required] ] ) ] )
215- AC_SEARCH_LIBS ( [ pthread_setname_np] , [ pthread] ,
216- [ # Validate pthread_setname_np with 2 args (some have 1)
217- AC_MSG_CHECKING ( [ [ for two-parameter pthread_setname_np] ] )
218- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ @%:@ include <pthread.h>] ] ,
219- [ [ pthread_setname_np(pthread_self(), "name");] ] ) ] ,
220- [ AC_MSG_RESULT ( [ yes] )
221- AC_DEFINE ( [ HAVE_PTHREAD_SETNAME_NP] , 1 ,
222- [ Define to 1 if you have pthread_setname_np] ) ] ,
223- [ AC_MSG_RESULT ( [ [ no] ] ) ] ) ] ,
224- [ AC_SEARCH_LIBS ( [ pthread_set_name_np] , [ pthread] ,
225- [ AC_CHECK_FUNCS ( [ pthread_set_name_np] ) ] ) ] )
226- AC_SEARCH_LIBS ( [ pthread_getname_np] , [ pthread] ,
227- [ AC_DEFINE ( [ HAVE_PTHREAD_GETNAME_NP] , 1 ,
228- [ Define to 1 if you have pthread_getname_np] ) ]
229- [ AC_SEARCH_LIBS ( [ pthread_get_name_np] , [ pthread] ,
230- [ AC_DEFINE ( [ HAVE_PTHREAD_GETNAME_NP] , 1 ,
231- [ Define to 1 if you have pthread_get_name_np] ) ] ) ] )
232- AC_SEARCH_LIBS ( [ pthread_getthreadid_np] , [ pthread] ,
233- [ AC_DEFINE ( [ HAVE_PTHREAD_GETTHREADID_NP] , 1 ,
234- [ Define to 1 if you have pthread_getthreadid_np] ) ] )
235- AC_SEARCH_LIBS ( [ uuid_generate_random] , [ uuid] ,
236- [ AC_DEFINE ( [ HAVE_UUID] , 1 ,
237- [ Define to 1 if you have uuid_generate_random] ) ] )
238- AC_SEARCH_LIBS ( [ copy_file_range] , [ c] ,
239- [ AC_DEFINE ( [ HAVE_COPY_FILE_RANGE] , 1 ,
240- [ Define to 1 if you have copy_file_range] ) ] )
241- AC_SEARCH_LIBS ( [ fcopyfile] , [ c] ,
242- [ AC_DEFINE ( [ HAVE_FCOPYFILE] , 1 ,
243- [ Define to 1 if you have fcopyfile] ) ] )
244-
245- AC_SEARCH_LIBS ( [ log10] , [ m] )
246- AC_SEARCH_LIBS ( [ lrint] , [ m] )
247- AC_SEARCH_LIBS ( [ fabs] , [ m] )
248-
249- # Large File Support (LFS)
250- AC_SYS_LARGEFILE
251- AC_TYPE_OFF_T
252-
253- # Checks for typedefs, structures, and compiler characteristics.
254-
255- # Checks for library functions.
256-
257254dnl --- Begin configuring the options ---
258255dnl Install config file
259256OWNTONE_ARG_DISABLE([ install configuration file] , [ install_conf_file] , [ INSTALL_CONF_FILE] )
0 commit comments