1# This file is part of MiniDLNA. 2# 3# MiniDLNA is free software; you can redistribute it and/or modify it 4# under the terms of the GNU Lesser General Public License as 5# published by the Free Software Foundation; either version 2 of the 6# License, or (at your option) any later version. 7# 8# MiniDLNA is distributed in the hope that it will be useful, but WITHOUT 9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 10# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 11# License for more details. 12# 13# You should have received a copy of the GNU Lesser General Public 14# License along with MiniDLNA; if not, write to the Free Software 15# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 16# USA. 17AC_INIT(MiniDLNA,1.1.3,,minidlna) 18#LT_INIT 19 20AC_CANONICAL_TARGET 21AM_INIT_AUTOMAKE([subdir-objects]) 22AC_CONFIG_HEADERS([config.h]) 23AM_SILENT_RULES([yes]) 24 25m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [AC_USE_SYSTEM_EXTENSIONS]) 26 27#MiniDLNA 28 29AM_ICONV 30AM_GNU_GETTEXT([external]) 31AM_GNU_GETTEXT_VERSION(0.18) 32 33# Checks for programs. 34AC_PROG_AWK 35AC_PROG_CC 36AM_PROG_CC_C_O 37AC_PROG_INSTALL 38AC_PROG_LN_S 39AC_PROG_MAKE_SET 40 41# Default string definitions 42AC_DEFINE_UNQUOTED([OS_URL],"http://sourceforge.net/projects/minidlna/",[OS URL]) 43AC_DEFINE_UNQUOTED([ROOTDEV_MANUFACTURER],"Justin Maggard", [Manufacturer]) 44AC_DEFINE_UNQUOTED([ROOTDEV_MANUFACTURERURL],"http://www.netgear.com/", [Manufacturer URL]) 45AC_DEFINE_UNQUOTED([ROOTDEV_MODELNAME],"Windows Media Connect compatible (MiniDLNA)", [Model name]) 46AC_DEFINE_UNQUOTED([ROOTDEV_MODELDESCRIPTION],"MiniDLNA on " OS_NAME, [Model description]) 47AC_DEFINE_UNQUOTED([ROOTDEV_MODELURL],OS_URL,[Model URL]) 48 49 50################################################################################################################ 51# Checks for typedefs, structures, and compiler characteristics. 52AC_C_INLINE 53AC_TYPE_MODE_T 54AC_TYPE_OFF_T 55AC_TYPE_PID_T 56AC_TYPE_SIZE_T 57m4_ifdef([AC_TYPE_UINT8_T], [AC_TYPE_UINT8_T]) 58m4_ifdef([AC_TYPE_INT32_T], [AC_TYPE_INT32_T]) 59m4_ifdef([AC_TYPE_UINT32_T], [AC_TYPE_UINT32_T]) 60m4_ifdef([AC_TYPE_UINT64_T], [AC_TYPE_UINT64_T]) 61m4_ifdef([AC_TYPE_SSIZE_T], [AC_TYPE_SSIZE_T]) 62AC_STRUCT_DIRENT_D_TYPE 63AC_STRUCT_ST_BLOCKS 64AC_HEADER_STDBOOL 65AC_C_BIGENDIAN 66 67# Checks for library functions. 68AC_FUNC_FORK 69AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK 70AC_CHECK_FUNCS([gethostname getifaddrs gettimeofday inet_ntoa memmove memset mkdir realpath select sendfile setlocale socket strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtol strtoul]) 71 72# 73# Check for struct ip_mreqn 74# 75AC_MSG_CHECKING(for struct ip_mreqn) 76AC_TRY_COMPILE([#include <netinet/in.h>], [ 77 struct ip_mreqn mreq; 78 mreq.imr_address.s_addr = 0; 79], [ 80 # Yes, we have it... 81 AC_MSG_RESULT(yes) 82 AC_DEFINE([HAVE_STRUCT_IP_MREQN],[],[Support for struct ip_mreqn]) 83], [ 84 # We'll just have to try and use struct ip_mreq 85 AC_MSG_RESULT(no) 86 AC_MSG_CHECKING(for struct ip_mreq) 87 AC_TRY_COMPILE([#include <netinet/in.h>], [ 88 struct ip_mreq mreq; 89 mreq.imr_interface.s_addr = 0; 90 ], [ 91 # Yes, we have it... 92 AC_MSG_RESULT(yes) 93 AC_DEFINE([HAVE_STRUCT_IP_MREQ],[],[Support for struct ip_mreq]) 94 ], [ 95 # No multicast support 96 AC_MSG_ERROR([No multicast support]) 97 ]) 98]) 99 100################################################################################################################ 101# Special include directories 102case $host in 103 *-*-darwin*) 104 DARWIN_OS=1 105 SEARCH_DIR="/opt/local" 106 INCLUDE_DIR="$SEARCH_DIR/include" 107 ;; 108 *-*-solaris*) 109 AC_DEFINE([SOLARIS], [1], [we are on solaris]) 110 ;; 111 *-*-cygwin*) 112 CYGWIN_OS=1 113 ;; 114 *-*-freebsd*) 115 FREEBSD_OS=1 116 ;; 117 *-*-openbsd*) 118 OPENBSD_OS=1 119 ;; 120 *-*-linux*) 121 if test -f /etc/redhat-release; then 122 INCLUDE_DIR="/usr/include/ffmpeg" 123 fi 124 ;; 125esac 126 127AC_CHECK_HEADERS(syscall.h sys/syscall.h mach/mach_time.h) 128AC_MSG_CHECKING([for __NR_clock_gettime syscall]) 129AC_COMPILE_IFELSE( 130 [AC_LANG_PROGRAM( 131 [ 132 #include <asm/unistd.h> 133 ], 134 [ 135 #ifndef __NR_clock_gettime 136 #error 137 #endif 138 ] 139 )], 140 [ 141 AC_MSG_RESULT([yes]) 142 AC_DEFINE([HAVE_CLOCK_GETTIME_SYSCALL], [1], [Whether the __NR_clock_gettime syscall is defined]) 143 ], 144 [ 145 AC_MSG_RESULT([no]) 146 AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [use clock_gettime])],) 147 ]) 148 149AC_CHECK_HEADER(linux/netlink.h, 150 [AC_DEFINE([HAVE_NETLINK],[1],[Support for Linux netlink])], [], [#include <sys/socket.h>]) 151 152################################################################################################################ 153### Library checks 154 155CPPFLAGS_SAVE="$CPPFLAGS" 156for dir in "" /usr/local $INCLUDE_DIR; do 157 if test -n "$dir"; then 158 CPPFLAGS="$CPPFLAGS_SAVE -I$dir" 159 fi 160 AC_CHECK_HEADERS([libavutil/avutil.h ffmpeg/libavutil/avutil.h libav/libavutil/avutil.h avutil.h ffmpeg/avutil.h libav/avutil.h], [HAVE_LIBAVUTIL=1]) 161 if test -z "$HAVE_LIBAVUTIL"; then 162 unset ac_cv_header_avutil_h 163 unset ac_cv_header_libavutil_avutil_h 164 unset ac_cv_header_ffmpeg_avutil_h 165 unset ac_cv_header_ffmpeg_libavutil_avutil_h 166 unset ac_cv_header_libav_avutil_h 167 unset ac_cv_header_libav_libavutil_avutil_h 168 continue 169 fi 170 break 171done 172if test -z "$HAVE_LIBAVUTIL"; then 173 AC_MSG_ERROR([libavutil headers not found or not usable]) 174fi 175 176CPPFLAGS_SAVE="$CPPFLAGS" 177for dir in "" /usr/local $INCLUDE_DIR; do 178 if test -n "$dir"; then 179 CPPFLAGS="$CPPFLAGS_SAVE -I$dir" 180 fi 181 AC_CHECK_HEADERS([libavcodec/avcodec.h ffmpeg/libavcodec/avcodec.h libav/libavcodec/avcodec.h avcodec.h ffmpeg/avcodec.h libav/avcodec.h], [HAVE_LIBAVCODEC=1]) 182 if test -z "$HAVE_LIBAVCODEC"; then 183 unset ac_cv_header_avcodec_h 184 unset ac_cv_header_libavcodec_avcodec_h 185 unset ac_cv_header_ffmpeg_avcodec_h 186 unset ac_cv_header_ffmpeg_libavcodec_avcodec_h 187 unset ac_cv_header_libav_avcodec_h 188 unset ac_cv_header_libav_libavcodec_avcodec_h 189 continue 190 fi 191 break 192done 193if test -z "$HAVE_LIBAVCODEC"; then 194 AC_MSG_ERROR([libavcodec headers not found or not usable]) 195fi 196 197CPPFLAGS_SAVE="$CPPFLAGS" 198for dir in "" /usr/local $INCLUDE_DIR; do 199 if test -n "$dir"; then 200 CPPFLAGS="$CPPFLAGS_SAVE -I$dir" 201 fi 202 AC_CHECK_HEADERS([libavformat/avformat.h ffmpeg/libavformat/avformat.h libav/libavformat/avformat.h avformat.h ffmpeg/avformat.h libav/avformat.h], [HAVE_LIBAVFORMAT=1]) 203 if test -z "$HAVE_LIBAVFORMAT"; then 204 unset ac_cv_header_avformat_h 205 unset ac_cv_header_libavformat_avformat_h 206 unset ac_cv_header_ffmpeg_avformat_h 207 unset ac_cv_header_ffmpeg_libavformat_avformat_h 208 unset ac_cv_header_libav_avformat_h 209 unset ac_cv_header_libav_libavformat_avformat_h 210 continue 211 fi 212 break 213done 214if test -z "$HAVE_LIBAVFORMAT"; then 215 AC_MSG_ERROR([libavformat headers not found or not usable]) 216fi 217 218CPPFLAGS_SAVE="$CPPFLAGS" 219for dir in "" /usr/local $INCLUDE_DIR; do 220 if test -n "$dir"; then 221 CPPFLAGS="$CPPFLAGS -I$dir" 222 fi 223 AC_CHECK_HEADERS([jpeglib.h sqlite3.h libexif/exif-loader.h id3tag.h ogg/ogg.h vorbis/codec.h FLAC/metadata.h],,[unset $as_ac_Header; break],) 224 if test x"$ac_cv_header_jpeglib_h" != x"yes"; then 225 CPPFLAGS="$CPPFLAGS_SAVE" 226 continue 227 elif test x"$ac_cv_header_sqlite3_h" != x"yes"; then 228 CPPFLAGS="$CPPFLAGS_SAVE" 229 continue 230 elif test x"$ac_cv_header_libexif_exif_loader_h" != x"yes"; then 231 CPPFLAGS="$CPPFLAGS_SAVE" 232 continue 233 elif test x"$ac_cv_header_id3tag_h" != x"yes"; then 234 CPPFLAGS="$CPPFLAGS_SAVE" 235 continue 236 elif test x"$ac_cv_header_ogg_ogg_h" != x"yes"; then 237 CPPFLAGS="$CPPFLAGS_SAVE" 238 continue 239 elif test x"$ac_cv_header_vorbis_codec_h" != x"yes"; then 240 CPPFLAGS="$CPPFLAGS_SAVE" 241 continue 242 elif test x"$ac_cv_header_FLAC_metadata_h" != x"yes"; then 243 CPPFLAGS="$CPPFLAGS_SAVE" 244 continue 245 else 246 break; 247 fi 248done 249test x"$ac_cv_header_jpeglib_h" != x"yes" && AC_MSG_ERROR([libjpeg headers not found or not usable]) 250test x"$ac_cv_header_sqlite3_h" != x"yes" && AC_MSG_ERROR([libsqlite3 headers not found or not usable]) 251test x"$ac_cv_header_libexif_exif_loader_h" != x"yes" && AC_MSG_ERROR([libexif headers not found or not usable]) 252test x"$ac_cv_header_id3tag_h" != x"yes" && AC_MSG_ERROR([libid3tag headers not found or not usable]) 253test x"$ac_cv_header_ogg_ogg_h" != x"yes" && AC_MSG_ERROR([libogg headers not found or not usable]) 254test x"$ac_cv_header_vorbis_codec_h" != x"yes" && AC_MSG_ERROR([libvorbis headers not found or not usable]) 255test x"$ac_cv_header_FLAC_metadata_h" != x"yes" && AC_MSG_ERROR([libFLAC headers not found or not usable]) 256 257CFLAGS_SAVE="$CFLAGS" 258CFLAGS="$CFLAGS -Wall -Werror" 259AC_MSG_CHECKING([if we should use the daemon() libc function]) 260AC_COMPILE_IFELSE( 261 [AC_LANG_PROGRAM( 262 [ 263 #include <stdlib.h> 264 #include <unistd.h> 265 ], 266 [ 267 return daemon(0, 0); 268 ] 269 )], 270 [ 271 AC_DEFINE([USE_DAEMON], [1], 272 [use the system's builtin daemon()]) 273 AC_MSG_RESULT([yes]) 274 ], 275 [ 276 AC_MSG_RESULT([no]) 277 ]) 278 279AC_MSG_CHECKING([if scandir declaration requires const char cast]) 280AC_COMPILE_IFELSE( 281 [AC_LANG_PROGRAM( 282 [ 283 #include <stdlib.h> 284 #include <sys/types.h> 285 #include <dirent.h> 286 ], 287 [ 288 int filter(struct dirent *d); 289 struct dirent **ptr = NULL; 290 char *name = NULL; 291 (void)scandir(name, &ptr, filter, alphasort); 292 ] 293 )], 294 [ 295 AC_MSG_RESULT([no]) 296 ], 297 [ 298 AC_DEFINE([SCANDIR_CONST], [1], 299 [scandir needs const char cast]) 300 301 AC_MSG_RESULT([yes]) 302 ]) 303 304AC_MSG_CHECKING([for linux sendfile support]) 305AC_COMPILE_IFELSE( 306 [AC_LANG_PROGRAM( 307 [ 308 #include <sys/types.h> 309 #include <sys/sendfile.h> 310 ], 311 [ 312 int tofd = 0, fromfd = 0; 313 off_t offset; 314 size_t total = 0; 315 ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); 316 return nwritten; 317 ] 318 )], 319 [ 320 AC_MSG_RESULT([yes]) 321 AC_DEFINE([HAVE_LINUX_SENDFILE_API], [1], [Whether linux sendfile() API is available]) 322 ], 323 [ 324 AC_MSG_RESULT([no]) 325 ]) 326 327AC_MSG_CHECKING([for darwin sendfile support]) 328AC_COMPILE_IFELSE( 329 [AC_LANG_PROGRAM( 330 [ 331 #include <stdlib.h> 332 #include <sys/types.h> 333 #include <sys/socket.h> 334 #include <sys/uio.h> 335 ], 336 [ 337 int fd = 0, s = 0; 338 off_t offset = 0, len; 339 struct sf_hdtr *hdtr = NULL; 340 int flags = 0; 341 int ret; 342 ret = sendfile(fd, s, offset, &len, hdtr, flags); 343 return ret; 344 ] 345 )], 346 [ 347 AC_MSG_RESULT([yes]) 348 AC_DEFINE([HAVE_DARWIN_SENDFILE_API], [1], [Whether darwin sendfile() API is available]) 349 ], 350 [ 351 AC_MSG_RESULT([no]) 352 ]) 353 354AC_MSG_CHECKING([for freebsd sendfile support]) 355AC_COMPILE_IFELSE( 356 [AC_LANG_PROGRAM( 357 [ 358 #include <stdlib.h> 359 #include <sys/types.h> 360 #include <sys/socket.h> 361 #include <sys/uio.h> 362 ], 363 [ 364 int fromfd=0, tofd=0, ret, total=0; 365 off_t offset=0, nwritten; 366 struct sf_hdtr hdr; 367 struct iovec hdtrl; 368 hdr.headers = &hdtrl; 369 hdr.hdr_cnt = 1; 370 hdr.trailers = NULL; 371 hdr.trl_cnt = 0; 372 hdtrl.iov_base = NULL; 373 hdtrl.iov_len = 0; 374 ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 0); 375 ] 376 )], 377 [ 378 AC_MSG_RESULT([yes]) 379 AC_DEFINE([HAVE_FREEBSD_SENDFILE_API], [1], [Whether freebsd sendfile() API is available]) 380 ], 381 [ 382 AC_MSG_RESULT([no]) 383 ]) 384CFLAGS="$CFLAGS_SAVE" 385 386LDFLAGS_SAVE="$LDFLAGS" 387for dir in "" /usr/local $SEARCH_DIR; do 388 if test -n "$dir"; then 389 LDFLAGS="$LDFLAGS -L$dir/lib" 390 fi 391 AC_CHECK_LIB([jpeg], [jpeg_set_defaults], [LIBJPEG_LIBS="-ljpeg"], [unset ac_cv_lib_jpeg_jpeg_set_defaults; LDFLAGS="$LDFLAGS_SAVE"; continue]) 392 break 393done 394test x"$ac_cv_lib_jpeg_jpeg_set_defaults" = x"yes" || AC_MSG_ERROR([Could not find libjpeg]) 395AC_SUBST(LIBJPEG_LIBS) 396 397LDFLAGS_SAVE="$LDFLAGS" 398for dir in "" /usr/local $SEARCH_DIR; do 399 if test -n "$dir"; then 400 LDFLAGS="$LDFLAGS -L$dir/lib" 401 fi 402 AC_CHECK_LIB([exif], [exif_data_new_from_file], [LIBEXIF_LIBS="-lexif"], [unset ac_cv_lib_exif_exif_data_new_from_file; LDFLAGS="$LDFLAGS_SAVE"; continue]) 403 break 404done 405test x"$ac_cv_lib_jpeg_jpeg_set_defaults" = x"yes" || AC_MSG_ERROR([Could not find libexif]) 406AC_SUBST(LIBEXIF_LIBS) 407 408LDFLAGS_SAVE="$LDFLAGS" 409for dir in "" /usr/local $SEARCH_DIR; do 410 if test -n "$dir"; then 411 LDFLAGS="$LDFLAGS -L$dir/lib" 412 fi 413 AC_CHECK_LIB([id3tag], [id3_file_open], [LIBID3TAG_LIBS="-lid3tag"], [unset ac_cv_lib_id3tag_id3_file_open; LDFLAGS="$LDFLAGS_SAVE"; continue]) 414 break 415done 416test x"$ac_cv_lib_id3tag_id3_file_open" = x"yes" || AC_MSG_ERROR([Could not find libid3tag]) 417AC_SUBST(LIBID3TAG_LIBS) 418 419LDFLAGS_SAVE="$LDFLAGS" 420for dir in "" /usr/local $SEARCH_DIR; do 421 if test -n "$dir"; then 422 LDFLAGS="$LDFLAGS -L$dir/lib" 423 fi 424 AC_CHECK_LIB(sqlite3, sqlite3_open, [LIBSQLITE3_LIBS="-lsqlite3"], [unset ac_cv_lib_sqlite3_sqlite3_open; LDFLAGS="$LDFLAGS_SAVE"; continue]) 425 AC_CHECK_LIB(sqlite3, sqlite3_malloc, [AC_DEFINE([HAVE_SQLITE3_MALLOC], [1], [Define to 1 if the sqlite3_malloc function exists.])]) 426 AC_CHECK_LIB(sqlite3, sqlite3_prepare_v2, [AC_DEFINE([HAVE_SQLITE3_PREPARE_V2], [1], [Define to 1 if the sqlite3_prepare_v2 function exists.])]) 427 break 428done 429test x"$ac_cv_lib_sqlite3_sqlite3_open" = x"yes" || AC_MSG_ERROR([Could not find libsqlite3]) 430AC_SUBST(LIBSQLITE3_LIBS) 431 432LDFLAGS_SAVE="$LDFLAGS" 433for dir in "" /usr/local $SEARCH_DIR; do 434 if test -n "$dir"; then 435 LDFLAGS="$LDFLAGS -L$dir/lib" 436 fi 437 AC_CHECK_LIB([avformat], [av_open_input_file], [LIBAVFORMAT_LIBS="-lavformat"], 438 [AC_CHECK_LIB([avformat], [avformat_open_input], [LIBAVFORMAT_LIBS="-lavformat"], 439 [unset ac_cv_lib_avformat_av_open_input_file; unset ac_cv_lib_avformat_avformat_open_input; LDFLAGS="$LDFLAGS_SAVE"; continue])]) 440 break 441done 442if test x"$ac_cv_lib_avformat_av_open_input_file" != x"yes" && 443 test x"$ac_cv_lib_avformat_avformat_open_input" != x"yes"; then 444 AC_MSG_ERROR([Could not find libavformat - part of ffmpeg]) 445fi 446AC_SUBST(LIBAVFORMAT_LIBS) 447 448AC_CHECK_LIB(avutil ,[av_rescale_q], [LIBAVUTIL_LIBS="-lavutil"], [AC_MSG_ERROR([Could not find libavutil - part of ffmpeg])]) 449AC_SUBST(LIBAVUTIL_LIBS) 450 451AC_CHECK_LIB(pthread, pthread_create) 452 453# test if we have vorbisfile 454# prior versions had ov_open_callbacks in libvorbis, test that, too. 455AC_CHECK_LIB(vorbisfile, ov_open_callbacks, 456 [AC_CHECK_HEADERS([vorbis/vorbisfile.h], 457 AM_CONDITIONAL(HAVE_VORBISFILE, true) 458 AC_DEFINE(HAVE_VORBISFILE,1,[Have vorbisfile]), 459 AM_CONDITIONAL(HAVE_VORBISFILE, false) 460 AC_DEFINE(HAVE_VORBISFILE,0,[lacking vorbisfile]))], 461 AM_CONDITIONAL(HAVE_VORBISFILE, false), 462 -lvorbis -logg) 463AC_CHECK_LIB(FLAC, FLAC__stream_decoder_init_stream, 464 [AC_CHECK_HEADERS([FLAC/all.h], 465 AM_CONDITIONAL(HAVE_FLAC, true) 466 AC_DEFINE(HAVE_FLAC,1,[Have flac]), 467 AM_CONDITIONAL(HAVE_FLAC, false))], 468 AM_CONDITIONAL(HAVE_FLAC, false), 469 -logg) 470# test without -logg to see whether we really need it (libflac can be without) 471AC_CHECK_LIB(FLAC, FLAC__stream_decoder_init_ogg_stream, 472 AM_CONDITIONAL(HAVE_FLAC, true) 473 AC_DEFINE(HAVE_FLAC,1,[Have flac]) 474 AM_CONDITIONAL(NEED_OGG, false), 475 [AM_CONDITIONAL(NEED_OGG, true)]) 476AC_CHECK_LIB(vorbisfile, vorbis_comment_query, 477 AM_CONDITIONAL(NEED_VORBIS, false), 478 AM_CONDITIONAL(NEED_VORBIS, true), 479 -logg) 480 481################################################################################################################ 482### Header checks 483 484AC_CHECK_HEADERS([arpa/inet.h asm/unistd.h endian.h machine/endian.h fcntl.h libintl.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/file.h sys/inotify.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h]) 485 486AC_CHECK_FUNCS(inotify_init, AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel has inotify support]), [ 487 AC_MSG_CHECKING([for __NR_inotify_init syscall]) 488 AC_COMPILE_IFELSE( 489 [AC_LANG_PROGRAM( 490 [ 491 #include <asm/unistd.h> 492 ], 493 [ 494 #ifndef __NR_inotify_init 495 #error 496 #endif 497 ] 498 )], 499 [ 500 AC_MSG_RESULT([yes]) 501 AC_DEFINE(HAVE_INOTIFY,1,[Whether kernel has inotify support]) 502 ], 503 [ 504 AC_MSG_RESULT([no]) 505 ]) 506]) 507 508################################################################################################################ 509### Build Options 510 511AC_ARG_WITH(log-path, 512 AS_HELP_STRING([--with-log-path=PATH],[Default log path]), 513 [with_logpath="$withval"],[with_logpath="/var/log"]) 514AC_DEFINE_UNQUOTED([DEFAULT_LOG_PATH],"${with_logpath}",[Log path]) 515 516 517AC_ARG_WITH(db-path, 518 AS_HELP_STRING([--with-db-path=PATH],[Default DB path]), 519 [with_dbpath="$withval"],[with_dbpath="/var/cache/minidlna"]) 520AC_DEFINE_UNQUOTED([DEFAULT_DB_PATH],"${with_dbpath}",[DB path]) 521 522AC_ARG_WITH(os-name, 523 AS_HELP_STRING([--with-os-name=NAME],[OS Name]), 524 [with_osname="$withval"],[with_osname="$(uname -s)"]) 525AC_DEFINE_UNQUOTED([OS_NAME],"${with_osname}",[OS Name]) 526 527AC_ARG_WITH(os-version, 528 AS_HELP_STRING([--with-os-version=VERS],[OS Version]), 529 [with_osver="$withval"],[with_osver="$(uname -r)"]) 530AC_DEFINE_UNQUOTED([OS_VERSION],"${with_osver}",[OS Version]) 531 532AC_ARG_WITH(os-url, 533 AS_HELP_STRING([--with-os-url=URL],[OS URL]), 534 [with_osurl="$withval"],[with_osurl="http://www.netgear.com"]) 535AC_DEFINE_UNQUOTED([OS_URL],"${with_osurl}",[OS URL]) 536 537 538AC_MSG_CHECKING([whether to enable TiVo support]) 539AC_ARG_ENABLE(tivo, 540 [ --enable-tivo enable TiVo support],[ 541 if test "$enableval" = "yes"; then 542 AC_DEFINE(TIVO_SUPPORT, 1, [Define to 1 if you want to enable TiVo support]) 543 AC_MSG_RESULT([yes]) 544 else 545 AC_MSG_RESULT([no]) 546 fi 547 ],[ 548 AC_MSG_RESULT([no]) 549 ] 550) 551 552AC_MSG_CHECKING([whether to enable generic NETGEAR device support]) 553AC_ARG_ENABLE(netgear, 554 [ --enable-netgear enable generic NETGEAR device support],[ 555 if test "$enableval" = "yes"; then 556 AC_DEFINE([NETGEAR],[1],[Define to 1 if you want to enable generic NETGEAR device support]) 557 AC_DEFINE_UNQUOTED([OS_URL],"http://www.netgear.com/") 558 AC_DEFINE_UNQUOTED([ROOTDEV_MANUFACTURERURL],"http://www.netgear.com/") 559 AC_DEFINE_UNQUOTED([ROOTDEV_MANUFACTURER],"NETGEAR") 560 AC_DEFINE_UNQUOTED([ROOTDEV_MODELNAME],"Windows Media Connect compatible (ReadyDLNA)") 561 AC_DEFINE_UNQUOTED([ROOTDEV_MODELDESCRIPTION],"ReadyDLNA") 562 AC_MSG_RESULT([yes]) 563 else 564 AC_MSG_RESULT([no]) 565 fi 566 ],[ 567 AC_MSG_RESULT([no]) 568 ] 569) 570 571AC_MSG_CHECKING([whether to enable NETGEAR ReadyNAS support]) 572AC_ARG_ENABLE(readynas, 573 [ --enable-readynas enable NETGEAR ReadyNAS support],[ 574 if test "$enableval" = "yes"; then 575 AC_DEFINE([NETGEAR],[1],[Define to 1 if you want to enable generic NETGEAR device support]) 576 AC_DEFINE([READYNAS],[1],[Define to 1 if you want to enable NETGEAR ReadyNAS support]) 577 AC_DEFINE([TIVO_SUPPORT], 1, [Define to 1 if you want to enable TiVo support]) 578 AC_DEFINE([PNPX],[5],[Define to 5 if you want to enable NETGEAR ReadyNAS PnP-X support]) 579 AC_DEFINE_UNQUOTED([OS_URL],"http://www.readynas.com/") 580 AC_DEFINE_UNQUOTED([ROOTDEV_MANUFACTURERURL],"http://www.netgear.com/") 581 AC_DEFINE_UNQUOTED([ROOTDEV_MANUFACTURER],"NETGEAR") 582 AC_DEFINE_UNQUOTED([ROOTDEV_MODELNAME],"Windows Media Connect compatible (ReadyDLNA)") 583 AC_DEFINE_UNQUOTED([ROOTDEV_MODELDESCRIPTION],"ReadyDLNA") 584 AC_MSG_RESULT([yes]) 585 else 586 AC_MSG_RESULT([no]) 587 fi 588 ],[ 589 AC_MSG_RESULT([no]) 590 ] 591) 592 593AC_MSG_CHECKING([whether to build a static binary executable]) 594AC_ARG_ENABLE(static, 595 [ --enable-static build a static binary executable],[ 596 if test "$enableval" = "yes"; then 597 STATIC_CFLAGS="-DSTATIC" 598 AC_SUBST(STATIC_CFLAGS) 599 STATIC_LDFLAGS="-Wl,-Bstatic" 600 AC_SUBST(STATIC_LDFLAGS) 601 AC_MSG_RESULT([yes]) 602 else 603 AC_MSG_RESULT([no]) 604 fi 605 ],[ 606 AC_MSG_RESULT([no]) 607 ] 608) 609 610 611case "$target_os" in 612 darwin*) 613 ;; 614 freebsd*) 615 VER=`grep '#define __FreeBSD_version' /usr/include/sys/param.h | awk '{print $3}'` 616 OS_URL=http://www.freebsd.org/ 617 ;; 618 solaris*) 619 AC_DEFINE([USE_IPF], [1], [Define to enable IPF]) 620 AC_DEFINE([LOG_PERROR], [0], [Define to enable logging]) 621 AC_DEFINE([SOLARIS_KSTATS], [1], [Define to enable Solaris Kernel Stats]) 622 ;; 623 kfreebsd*) 624 OS_URL=http://www.debian.org/ 625 ;; 626 linux*) 627 ;; 628 openbsd*) 629 OS_URL=http://www.openbsd.org/ 630 ;; 631 *) 632 echo "Unknown OS : $target_os" 633 ;; 634esac 635 636 637AC_OUTPUT([ po/Makefile.in 638Makefile 639]) 640