Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Fürstenberg <azatoth@gmail.com>2011-03-27 04:05:52 +0400
committerCarl Fürstenberg <azatoth@gmail.com>2011-03-27 04:14:43 +0400
commitfe3ac9085ed8c2fcee81661a3a6d6b171503fb26 (patch)
treeab00c5f21801ccc49cf6e436be8e1e8978d1a2aa
parent14af0b4acb527a529e34accda4c67ab004b409aa (diff)
SCons build system
Changing build system to scons instead of the the old makefile olus custom genconf script. This will enable users to verify their system got all required dependices before any building occurs The only difference when building is to type "scons" instead of "make"
-rw-r--r--.gitignore7
-rw-r--r--INSTALL7
-rw-r--r--Makefile133
-rw-r--r--SConstruct298
-rw-r--r--daemonize.c2
-rw-r--r--daemonize.h2
-rw-r--r--inotify.c2
-rw-r--r--metadata.c6
-rw-r--r--minidlna.c15
-rw-r--r--minidlnapath.h2
-rw-r--r--minidlnatypes.h2
-rw-r--r--minissdp.c2
-rw-r--r--options.h2
-rw-r--r--scanner.c2
-rw-r--r--tagutils/tagutils-plist.c2
-rw-r--r--testupnpdescgen.c2
-rw-r--r--tivo_beacon.c2
-rw-r--r--tivo_beacon.h2
-rw-r--r--tivo_commands.c2
-rw-r--r--tivo_commands.h2
-rw-r--r--tivo_utils.c2
-rw-r--r--tivo_utils.h2
-rw-r--r--upnpdescgen.c2
-rw-r--r--upnpdescgen.h2
-rw-r--r--upnpdescstrings.h2
-rw-r--r--upnpevents.c2
-rw-r--r--upnpglobalvars.c2
-rw-r--r--upnpglobalvars.h2
-rw-r--r--upnphttp.c2
-rw-r--r--upnphttp.h2
-rw-r--r--upnpsoap.c2
31 files changed, 374 insertions, 142 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4b6de2e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+.sconsign.dblite
+.sconf_temp
+config.log
+*.o
+minidlna
+testupnpdescgen
+config.h
diff --git a/INSTALL b/INSTALL
index b3bbd16..8647f07 100644
--- a/INSTALL
+++ b/INSTALL
@@ -14,6 +14,11 @@ Prerequisites :
- libavformat (the ffmpeg libraries)
- libuuid
+Build depends are:
+- scons
+- pkg-config
+
To Build and install :
-- Just run make, and hope it works. :)
+- Just run scons, and hope it works. :)
+- To install, run "sudo scons install", or just copy the binaries
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 5c1320d..0000000
--- a/Makefile
+++ /dev/null
@@ -1,133 +0,0 @@
-# $Id$
-# MiniDLNA project
-# http://sourceforge.net/projects/minidlna/
-# (c) 2008-2009 Justin Maggard
-# for use with GNU Make
-# To install use :
-# $ DESTDIR=/dummyinstalldir make install
-# or :
-# $ INSTALLPREFIX=/usr/local make install
-# or :
-# $ make install
-#
-#CFLAGS = -Wall -O -D_GNU_SOURCE -g -DDEBUG
-#CFLAGS = -Wall -g -Os -D_GNU_SOURCE
-CFLAGS = -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
- -I/usr/include/ffmpeg \
- -I/usr/include/libavutil -I/usr/include/libavcodec -I/usr/include/libavformat \
- -I/usr/include/ffmpeg/libavutil -I/usr/include/ffmpeg/libavcodec -I/usr/include/ffmpeg/libavformat
-#STATIC_LINKING: CFLAGS += -DSTATIC
-#STATIC_LINKING: LDFLAGS = -static
-CC = gcc
-RM = rm -f
-INSTALL = install
-
-INSTALLPREFIX ?= $(DESTDIR)/usr
-SBININSTALLDIR = $(INSTALLPREFIX)/sbin
-ETCINSTALLDIR = $(DESTDIR)/etc
-
-BASEOBJS = minidlna.o upnphttp.o upnpdescgen.o upnpsoap.o \
- upnpreplyparse.o minixml.o \
- getifaddr.o daemonize.o upnpglobalvars.o \
- options.o minissdp.o uuid.o upnpevents.o \
- sql.o utils.o metadata.o scanner.o inotify.o \
- tivo_utils.o tivo_beacon.o tivo_commands.o \
- tagutils/textutils.o tagutils/misc.o tagutils/tagutils.o \
- playlist.o image_utils.o albumart.o log.o
-
-ALLOBJS = $(BASEOBJS) $(LNXOBJS)
-
-LIBS = -lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec -lid3tag -lFLAC -logg -lvorbis
-#STATIC_LINKING: LIBS = -lvorbis -logg -lm -lsqlite3 -lpthread -lexif -ljpeg -lFLAC -lm -lid3tag -lz -lavformat -lavutil -lavcodec -lm
-
-TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
-
-EXECUTABLES = minidlna testupnpdescgen
-
-.PHONY: all clean distclean install depend
-
-all: $(EXECUTABLES)
-
-clean:
- $(RM) $(ALLOBJS)
- $(RM) $(EXECUTABLES)
- $(RM) testupnpdescgen.o
-
-distclean: clean
- $(RM) config.h
-
-install: minidlna
- $(INSTALL) -d $(SBININSTALLDIR)
- $(INSTALL) minidlna $(SBININSTALLDIR)
- $(INSTALL) -d $(ETCINSTALLDIR)
- $(INSTALL) --mode=0644 minidlna.conf $(ETCINSTALLDIR)
-
-minidlna: $(BASEOBJS) $(LNXOBJS) $(LIBS)
- @echo Linking $@
- @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS)
-
-
-testupnpdescgen: $(TESTUPNPDESCGENOBJS)
- @echo Linking $@
- @$(CC) $(CFLAGS) -o $@ $(TESTUPNPDESCGENOBJS)
-
-config.h: genconfig.sh
- ./genconfig.sh
-
-depend: config.h
- makedepend -f$(MAKEFILE_LIST) -Y \
- $(ALLOBJS:.o=.c) $(TESTUPNPDESCGENOBJS:.o=.c) 2>/dev/null
-
-# DO NOT DELETE
-
-minidlna.o: config.h upnpglobalvars.h minidlnatypes.h
-minidlna.o: upnphttp.h upnpdescgen.h minidlnapath.h getifaddr.h upnpsoap.h
-minidlna.o: options.h minissdp.h daemonize.h upnpevents.h log.h
-upnphttp.o: config.h upnphttp.h upnpdescgen.h minidlnapath.h upnpsoap.h
-upnphttp.o: upnpevents.h image_utils.h sql.h log.h icons.c
-upnpdescgen.o: config.h upnpdescgen.h minidlnapath.h upnpglobalvars.h
-upnpdescgen.o: minidlnatypes.h upnpdescstrings.h log.h
-upnpsoap.o: config.h upnpglobalvars.h minidlnatypes.h log.h utils.h sql.h
-upnpsoap.o: upnphttp.h upnpsoap.h upnpreplyparse.h getifaddr.h log.h
-upnpreplyparse.o: upnpreplyparse.h minixml.h log.h
-minixml.o: minixml.h
-getifaddr.o: getifaddr.h log.h
-daemonize.o: daemonize.h config.h log.h
-upnpglobalvars.o: config.h upnpglobalvars.h
-upnpglobalvars.o: minidlnatypes.h
-options.o: options.h config.h upnpglobalvars.h
-options.o: minidlnatypes.h
-minissdp.o: config.h upnpdescstrings.h minidlnapath.h upnphttp.h
-minissdp.o: upnpglobalvars.h minidlnatypes.h minissdp.h log.h
-upnpevents.o: config.h upnpevents.h minidlnapath.h upnpglobalvars.h
-upnpevents.o: minidlnatypes.h upnpdescgen.h log.h uuid.h
-uuid.o: uuid.h
-testupnpdescgen.o: config.h upnpdescgen.h
-upnpdescgen.o: config.h upnpdescgen.h minidlnapath.h upnpglobalvars.h
-upnpdescgen.o: minidlnatypes.h upnpdescstrings.h
-scanner.o: upnpglobalvars.h metadata.h utils.h sql.h scanner.h log.h playlist.h
-metadata.o: upnpglobalvars.h metadata.h albumart.h utils.h sql.h log.h
-albumart.o: upnpglobalvars.h albumart.h utils.h image_utils.h sql.h log.h
-tagutils/misc.o: tagutils/misc.h
-tagutils/textutils.o: tagutils/misc.h tagutils/textutils.h log.h
-tagutils/tagutils.o: tagutils/tagutils-asf.c tagutils/tagutils-flc.c tagutils/tagutils-plist.c tagutils/tagutils-misc.c
-tagutils/tagutils.o: tagutils/tagutils-aac.c tagutils/tagutils-asf.h tagutils/tagutils-flc.h tagutils/tagutils-mp3.c tagutils/tagutils-wav.c
-tagutils/tagutils.o: tagutils/tagutils-ogg.c tagutils/tagutils-aac.h tagutils/tagutils.h tagutils/tagutils-mp3.h tagutils/tagutils-ogg.h log.h
-playlist.o: playlist.h
-inotify.o: inotify.h playlist.h
-image_utils.o: image_utils.h
-tivo_utils.o: config.h tivo_utils.h
-tivo_beacon.o: config.h tivo_beacon.h tivo_utils.h
-tivo_commands.o: config.h tivo_commands.h tivo_utils.h
-utils.o: utils.h
-sql.o: sql.h
-log.o: log.h
-
-.SUFFIXES: .c .o
-
-.c.o:
- @echo Compiling $*.c
- @$(CC) $(CFLAGS) -o $@ -c $< && exit 0;\
- echo "The following command failed:" 1>&2;\
- echo "$(CC) $(CFLAGS) -o $@ -c $<";\
- $(CC) $(CFLAGS) -o $@ -c $< &>/dev/null
diff --git a/SConstruct b/SConstruct
new file mode 100644
index 0000000..4b59566
--- /dev/null
+++ b/SConstruct
@@ -0,0 +1,298 @@
+#!/usr/bin/python
+# vim: set fileencoding=utf-8 :
+
+
+import SCons
+import SCons.Script as scons
+from distutils import sysconfig, version
+import platform
+import os
+import re
+
+EnsurePythonVersion(2, 5)
+EnsureSConsVersion(2, 0)
+
+env = Environment()
+AddOption(
+ '--prefix',
+ dest='prefix',
+ type='string',
+ nargs=1,
+ action='store',
+ metavar='DIR',
+ default='/usr',
+ help='installation prefix'
+)
+prefix = GetOption('prefix')
+
+AddOption(
+ '--bindir',
+ dest='bindir',
+ type='string',
+ nargs=1,
+ action='store',
+ metavar='DIR',
+ default='%s/bin' % prefix,
+ help='installation binary files prefix'
+)
+
+bindir = GetOption('bindir')
+
+# below three variables are not yet used
+libdir = "%s/lib" % prefix
+includedir = "%s/include" % prefix
+datadir = "%s/share" % prefix
+
+AddOption(
+ "--db-path",
+ dest="db_path",
+ action="store",
+ metavar="DIR",
+ nargs=1,
+ default='/tmp/minidlna',
+ help="full path of the file database."
+)
+
+AddOption(
+ "--log-path",
+ dest="log_path",
+ action="store",
+ metavar="DIR",
+ nargs=1,
+ default='/tmp/minidlna',
+ help="full path of the log directory."
+)
+
+AddOption(
+ "--enable-bsd-daemon",
+ dest="bsd_daemon",
+ action="store_true",
+ default=True,
+ help="utilize BSD daemon() instead of using home brew daemonize function."
+)
+
+db_path = GetOption("db_path")
+log_path = GetOption("log_path")
+bsd_daemon = GetOption("bsd_daemon")
+# Configuration:
+
+def CheckPKGConfig(context, version):
+ context.Message( 'Checking for pkg-config... ' )
+ ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
+ context.Result( ret )
+ return ret
+
+def CheckPKG(context, name):
+ context.Message( 'Checking for %s... ' % name )
+ ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
+ context.sconf.config_h_text += "\n"
+ context.sconf.Define(
+ 'HAVE_%s' % name.upper().replace('\W','_'),
+ 1,
+ "Define to 1 if you have the `%(name)s' package installed"
+ % { 'name': name }
+ )
+ context.Result( ret )
+ return ret
+
+conf = Configure(
+ env,
+ config_h="config.h",
+ custom_tests = {
+ 'CheckPKGConfig' : CheckPKGConfig,
+ 'CheckPKG' : CheckPKG
+ }
+)
+
+env.Append(CCFLAGS='-Wall -g -O3')
+
+if not env.GetOption('clean') and not env.GetOption('help'):
+ if 'CC' in os.environ:
+ env.Replace(CC = os.environ['CC'])
+ print(">> Using compiler " + os.environ['CC'])
+
+ if 'CFLAGS' in os.environ:
+ env.Replace(CFLAGS = os.environ['CFLAGS'])
+ print(">> Appending custom build flags : " + os.environ['CFLAGS'])
+
+ if 'LDFLAGS' in os.environ:
+ env.Append(LINKFLAGS = os.environ['LDFLAGS'])
+ print(">> Appending custom link flags : " + os.environ['LDFLAGS'])
+
+
+ if not conf.CheckPKGConfig('0.15.0'):
+ print 'pkg-config >= 0.15.0 not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('libavformat'):
+ print 'libavformat not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('libavutil'):
+ print 'libavutil not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('libavcodec'):
+ print 'libavcodec not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('sqlite3'):
+ print 'sqlite3 not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('libexif'):
+ print 'libexif not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('id3tag'):
+ print 'id3tag not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('flac'):
+ print 'flac not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('ogg'):
+ print 'ogg not found.'
+ Exit(1)
+
+ if not conf.CheckPKG('vorbis'):
+ print 'vorbis not found.'
+ Exit(1)
+
+ if not conf.CheckLib('pthread'):
+ print 'pthread library not found'
+ Exit(1)
+
+ if not conf.CheckLib('jpeg'):
+ print 'jpeg library not found'
+ Exit(1)
+
+ if conf.CheckCHeader('sys/inotify.h'):
+ conf.config_h_text += "\n"
+ conf.Define('HAVE_INOTIFY_H',1)
+
+ conf.CheckCHeader('iconv.h')
+
+ if conf.CheckCHeader('libintl.h'):
+ conf.config_h_text += "\n"
+ conf.Define('ENABLE_NLS',1)
+
+ if bsd_daemon:
+ conf.config_h_text += "\n"
+ conf.Define('USE_DAEMON', 1, "Use BSD daemon() instead of home made function")
+
+ conf.config_h_text += "\n"
+ conf.Define("DEFAULT_DB_PATH", '"%s"' % db_path, "Default database path")
+ conf.config_h_text += "\n"
+ conf.Define("DEFAULT_LOG_PATH", '"%s"' % log_path, "Default log path")
+
+
+ os_url = ""
+ os_name = platform.system();
+ os_version = version.LooseVersion(platform.release());
+ tivo = netgear = readynas = False
+ pnpx = 0
+
+ if os_name == "OpenBSD":
+
+ # rtableid was introduced in OpenBSD 4.0
+ if os_version >= "4.0":
+ conf.Define("PFRULE_HAS_RTABLEID")
+
+ # from the 3.8 version, packets and bytes counters are double : in/out
+ if os_version >= "3.8":
+ conf.Define("PFRULE_INOUT_COUNTS")
+
+ os_url = "http://www.openbsd.org/"
+
+ elif os_name == "FreeBSD":
+ for line in open('/usr/include/sys/param.h'):
+ m = re.match(r"#define __FreeBSD_version (\d+)", line)
+ if m and m[1] >= 700049:
+ conf.Define("PFRULE_INOUT_COUNTS")
+ break
+ os_url = "http://www.freebsd.org/"
+ elif os_name == "pfSense":
+ os_url = "http://www.pfsense.org/"
+ elif os_name == "NetBSD":
+ os_url = "http://www.freebsd.org/"
+ elif os_name == "SunOS":
+ conf.Define("USE_IPF","1")
+ conf.Define("LOG_PERROR","0")
+ conf.Define("SOLARIS_KSTATS","1")
+ # TODO fix typedefs
+ os_url = "http://www.sun.com/solaris/"
+ elif os_name == "Linux":
+ os_url = "http://www.kernel.org/"
+ dist = platform.linux_distribution()
+ os_name = dist[0]
+ os_version = dist[1]
+
+ # NETGEAR ReadyNAS special case
+ if os.path.exists("/etc/raidiator_version"):
+ radiator_version = open("/etc/radiator_version").readline()
+ m = re.match("^(.*?)!!version=(.*?),", radiator_version)
+ os_name = m[1]
+ os_version = m[2]
+ os_url = "http://www.readynas.com/"
+ log_path = "/var/log"
+ db_path = "/var/cache/minidlna"
+ tivo = netgear = readynas = True
+ pnpx = 5
+ elif dist[0] == "debian":
+ os_url = "http://www.debian.org"
+ log_path = "/var/log"
+ else :
+ pass # unknown linux dist
+ else :
+ print("Unknown operating system '%s'" % os_name)
+ Exit(2)
+
+ conf.config_h_text += "\n"
+ conf.Define('OS_VERSION', '"%s"'%str(os_version), "Version of the operating system")
+ conf.config_h_text += "\n"
+ conf.Define('OS_NAME', '"%s"'%str(os_name), "Name of the operating system")
+ conf.config_h_text += "\n"
+ conf.Define('OS_URL', '"%s"'%str(os_url), "URL for operating system")
+
+ if tivo:
+ conf.config_h_text += "\n"
+ conf.Define('TIVO_SUPPORT', 1, "Compile in TiVo support.")
+ if netgear:
+ conf.config_h_text += "\n"
+ conf.Define('NETGEAR', 1, "Enable NETGEAR-specific tweaks.")
+ if readynas:
+ conf.config_h_text += "\n"
+ conf.Define('READYNAS', 1, "Enable ReadyNAS-specific tweaks.")
+
+ conf.config_h_text += "\n"
+ conf.Define('PNPX', pnpx, "Enable PnPX support.")
+
+
+env.ParseConfig('pkg-config --cflags --libs libavformat libavutil libavcodec sqlite3 libexif id3tag flac ogg vorbis')
+
+env.Append(CPPDEFINES=['_GNU_SOURCE', ('_FILE_OFFSET_BITS','64'), '_REENTRANT',
+ 'HAVE_CONFIG_H'])
+
+env = conf.Finish()
+# -----
+
+minidlna_sources = [
+ "minidlna.c", "upnphttp.c", "upnpdescgen.c", "upnpsoap.c",
+ "upnpreplyparse.c", "minixml.c",
+ "getifaddr.c", "daemonize.c", "upnpglobalvars.c",
+ "options.c", "minissdp.c", "uuid.c", "upnpevents.c",
+ "sql.c", "utils.c", "metadata.c", "scanner.c", "inotify.c",
+ "tivo_utils.c", "tivo_beacon.c", "tivo_commands.c",
+ "tagutils/textutils.c", "tagutils/misc.c", "tagutils/tagutils.c",
+ "playlist.c", "image_utils.c", "albumart.c", "log.c"
+]
+testupnpdescgen_sources = [ "testupnpdescgen.c", "upnpdescgen.c" ]
+
+minidlna = env.Program(target = "minidlna", source = minidlna_sources);
+testupnpdescgen = env.Program(target = "testupnpdescgen", source = testupnpdescgen_sources);
+
+env.Install(bindir, [minidlna, testupnpdescgen])
+
+env.Alias('install', bindir)
diff --git a/daemonize.c b/daemonize.c
index b1bfe9c..57edbec 100644
--- a/daemonize.c
+++ b/daemonize.c
@@ -38,7 +38,9 @@
#include <signal.h>
#include "daemonize.h"
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "log.h"
#ifndef USE_DAEMON
diff --git a/daemonize.h b/daemonize.h
index ee763bd..0d83626 100644
--- a/daemonize.h
+++ b/daemonize.h
@@ -29,7 +29,9 @@
#ifndef __DAEMONIZE_H__
#define __DAEMONIZE_H__
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifndef USE_DAEMON
/* daemonize()
diff --git a/inotify.c b/inotify.c
index 3d089e4..7353940 100644
--- a/inotify.c
+++ b/inotify.c
@@ -15,7 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/metadata.c b/metadata.c
index 926481b..1f2cde4 100644
--- a/metadata.c
+++ b/metadata.c
@@ -30,9 +30,9 @@
#include "image_utils.h"
#include <jpeglib.h>
#include <setjmp.h>
-#include <avutil.h>
-#include <avcodec.h>
-#include <avformat.h>
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
#include "tagutils/tagutils.h"
#include "upnpglobalvars.h"
diff --git a/minidlna.c b/minidlna.c
index a8853f9..8fe7885 100644
--- a/minidlna.c
+++ b/minidlna.c
@@ -46,26 +46,33 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <sys/file.h>
#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
#include <time.h>
#include <signal.h>
-#include <sys/param.h>
#include <errno.h>
#include <pthread.h>
#include <pwd.h>
-#include "config.h"
#ifdef ENABLE_NLS
#include <libintl.h>
diff --git a/minidlnapath.h b/minidlnapath.h
index 4043d0f..0501531 100644
--- a/minidlnapath.h
+++ b/minidlnapath.h
@@ -29,7 +29,9 @@
#ifndef __MINIDLNAPATH_H__
#define __MINIDLNAPATH_H__
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
/* Paths and other URLs in the minidlna http server */
diff --git a/minidlnatypes.h b/minidlnatypes.h
index 7ded991..3dbf6e1 100644
--- a/minidlnatypes.h
+++ b/minidlnatypes.h
@@ -29,7 +29,9 @@
#ifndef __MINIDLNATYPES_H__
#define __MINIDLNATYPES_H__
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include <netinet/in.h>
/* structure for storing lan addresses
diff --git a/minissdp.c b/minissdp.c
index 72cc201..bc16964 100644
--- a/minissdp.c
+++ b/minissdp.c
@@ -36,7 +36,9 @@
#include <arpa/inet.h>
#include <errno.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "upnpdescstrings.h"
#include "minidlnapath.h"
#include "upnphttp.h"
diff --git a/options.h b/options.h
index 88a517a..a02d7d4 100644
--- a/options.h
+++ b/options.h
@@ -30,7 +30,9 @@
#ifndef __OPTIONS_H__
#define __OPTIONS_H__
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
/* enum of option available in the miniupnpd.conf */
enum upnpconfigoptions {
diff --git a/scanner.c b/scanner.c
index 3114401..9b07c29 100644
--- a/scanner.c
+++ b/scanner.c
@@ -26,7 +26,9 @@
#include <sys/time.h>
#include <sys/resource.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifdef ENABLE_NLS
#include <libintl.h>
diff --git a/tagutils/tagutils-plist.c b/tagutils/tagutils-plist.c
index cbd0f7e..feaaaff 100644
--- a/tagutils/tagutils-plist.c
+++ b/tagutils/tagutils-plist.c
@@ -27,7 +27,7 @@
#include "misc.h"
#include "tagutils.h"
#include "textutils.h"
-#include "log.h"
+#include "../log.h"
#define MAX_BUF 4096
diff --git a/testupnpdescgen.c b/testupnpdescgen.c
index 398d731..18be48e 100644
--- a/testupnpdescgen.c
+++ b/testupnpdescgen.c
@@ -31,7 +31,9 @@
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "upnpdescgen.h"
char uuidvalue[] = "uuid:12345678-0000-0000-0000-00000000abcd";
diff --git a/tivo_beacon.c b/tivo_beacon.c
index 8de73af..112826a 100644
--- a/tivo_beacon.c
+++ b/tivo_beacon.c
@@ -26,7 +26,9 @@
* You should have received a copy of the GNU General Public License
* along with byRequest. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifdef TIVO_SUPPORT
#include <stdlib.h>
#include <stdio.h>
diff --git a/tivo_beacon.h b/tivo_beacon.h
index 738042c..fa6c3ea 100644
--- a/tivo_beacon.h
+++ b/tivo_beacon.h
@@ -21,7 +21,9 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifdef TIVO_SUPPORT
/*
* * A saved copy of a beacon from another tivo or another server
diff --git a/tivo_commands.c b/tivo_commands.c
index bd48e98..d6a69f0 100644
--- a/tivo_commands.c
+++ b/tivo_commands.c
@@ -15,7 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifdef TIVO_SUPPORT
#include <stdio.h>
#include <stdlib.h>
diff --git a/tivo_commands.h b/tivo_commands.h
index 40ba4f0..f88bb61 100644
--- a/tivo_commands.h
+++ b/tivo_commands.h
@@ -21,7 +21,9 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifdef TIVO_SUPPORT
void
diff --git a/tivo_utils.c b/tivo_utils.c
index 8adbe57..20692fc 100644
--- a/tivo_utils.c
+++ b/tivo_utils.c
@@ -15,7 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifdef TIVO_SUPPORT
#include <stdlib.h>
#include <stdint.h>
diff --git a/tivo_utils.h b/tivo_utils.h
index 2f40d3c..1830ea9 100644
--- a/tivo_utils.h
+++ b/tivo_utils.h
@@ -21,7 +21,9 @@
* You should have received a copy of the GNU General Public License
* along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#ifdef TIVO_SUPPORT
#include <sqlite3.h>
diff --git a/upnpdescgen.c b/upnpdescgen.c
index bc577a9..8663522 100644
--- a/upnpdescgen.c
+++ b/upnpdescgen.c
@@ -31,7 +31,9 @@
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "getifaddr.h"
#include "upnpdescgen.h"
#include "minidlnapath.h"
diff --git a/upnpdescgen.h b/upnpdescgen.h
index edfd9f5..83f2a52 100644
--- a/upnpdescgen.h
+++ b/upnpdescgen.h
@@ -29,7 +29,9 @@
#ifndef __UPNPDESCGEN_H__
#define __UPNPDESCGEN_H__
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
/* for the root description
* The child list reference is stored in "data" member using the
diff --git a/upnpdescstrings.h b/upnpdescstrings.h
index 991f532..39a828e 100644
--- a/upnpdescstrings.h
+++ b/upnpdescstrings.h
@@ -29,7 +29,9 @@
#ifndef __UPNPDESCSTRINGS_H__
#define __UPNPDESCSTRINGS_H__
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
/* strings used in the root device xml description */
#ifdef NETGEAR
diff --git a/upnpevents.c b/upnpevents.c
index e9f8e08..f4c5564 100644
--- a/upnpevents.c
+++ b/upnpevents.c
@@ -59,7 +59,9 @@
#include <fcntl.h>
#include <errno.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "upnpevents.h"
#include "minidlnapath.h"
#include "upnpglobalvars.h"
diff --git a/upnpglobalvars.c b/upnpglobalvars.c
index d059daa..0c71f42 100644
--- a/upnpglobalvars.c
+++ b/upnpglobalvars.c
@@ -50,7 +50,9 @@
#include <netinet/in.h>
#include <linux/limits.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "upnpglobalvars.h"
#include "upnpdescstrings.h"
diff --git a/upnpglobalvars.h b/upnpglobalvars.h
index be8dbac..fbb9dc3 100644
--- a/upnpglobalvars.h
+++ b/upnpglobalvars.h
@@ -52,7 +52,9 @@
#include <time.h>
#include "minidlnatypes.h"
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include <sqlite3.h>
diff --git a/upnphttp.c b/upnphttp.c
index 87b3e40..3017a19 100644
--- a/upnphttp.c
+++ b/upnphttp.c
@@ -54,7 +54,9 @@
#include <sys/socket.h>
#include <sys/param.h>
#include <ctype.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "upnphttp.h"
#include "upnpdescgen.h"
#include "minidlnapath.h"
diff --git a/upnphttp.h b/upnphttp.h
index 75436cc..3011ee9 100644
--- a/upnphttp.h
+++ b/upnphttp.h
@@ -33,7 +33,9 @@
#include <sys/queue.h>
#include "minidlnatypes.h"
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
/* server: HTTP header returned in all HTTP responses : */
#define MINIDLNA_SERVER_STRING OS_VERSION " DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0"
diff --git a/upnpsoap.c b/upnpsoap.c
index 0afca85..cef9729 100644
--- a/upnpsoap.c
+++ b/upnpsoap.c
@@ -59,7 +59,9 @@
#include <netdb.h>
#include <ctype.h>
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif /* HAVE_CONFIG_H */
#include "upnpglobalvars.h"
#include "upnphttp.h"
#include "upnpsoap.h"