vips: moved to github
[openwrt.org/packages.git] / multimedia / 010-genconfig-checks.patch
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
--- a/genconfig.sh
+++ b/genconfig.sh
@@ -23,14 +23,18 @@ RM="rm -f"
 CONFIGFILE="config.h"
 CONFIGMACRO="__CONFIG_H__"
 
+PREFIX="${PREFIX:-/usr}"
+ICONV_PREFIX="${ICONV_PREFIX:-$PREFIX}"
+INTL_PREFIX="${INTL_PREFIX:-$PREFIX}"
+
 # Database path
-DB_PATH="/tmp/minidlna"
+DB_PATH="${DB_PATH:-/tmp/minidlna}"
 # Log path
-LOG_PATH="${DB_PATH}"
+LOG_PATH="${LOG_PATH:-$DB_PATH}"
 
 # detecting the OS name and version
-OS_NAME=`uname -s`
-OS_VERSION=`uname -r`
+OS_NAME="${OS_NAME:-$(uname -s)}"
+OS_VERSION="${OS_VERSION:-$(uname -r)}"
 TIVO="/*#define TIVO_SUPPORT*/"
 NETGEAR="/*#define NETGEAR*/"
 READYNAS="/*#define READYNAS*/"
@@ -40,22 +44,22 @@ ${RM} ${CONFIGFILE}
 
 # Detect if there are missing headers
 # NOTE: This check only works with a normal distro
-[ ! -e "/usr/include/sqlite3.h" ] && MISSING="libsqlite3 $MISSING"
-[ ! -e "/usr/include/jpeglib.h" ] && MISSING="libjpeg $MISSING"
-[ ! -e "/usr/include/libexif/exif-loader.h" ] && MISSING="libexif $MISSING"
-[ ! -e "/usr/include/id3tag.h" ] && MISSING="libid3tag $MISSING"
-[ ! -e "/usr/include/ogg/ogg.h" ] && MISSING="libogg $MISSING"
-[ ! -e "/usr/include/vorbis/codec.h" ] && MISSING="libvorbis $MISSING"
-[ ! -e "/usr/include/FLAC/metadata.h" ] && MISSING="libflac $MISSING"
-[ ! -e "/usr/include/ffmpeg/avutil.h" -a \
-  ! -e "/usr/include/libavutil/avutil.h" -a \
-  ! -e "/usr/include/ffmpeg/libavutil/avutil.h" ] && MISSING="libavutil $MISSING"
-[ ! -e "/usr/include/ffmpeg/avformat.h" -a \
-  ! -e "/usr/include/libavformat/avformat.h" -a \
-  ! -e "/usr/include/ffmpeg/libavformat/avformat.h" ] && MISSING="libavformat $MISSING"
-[ ! -e "/usr/include/ffmpeg/avcodec.h" -a \
-  ! -e "/usr/include/libavcodec/avcodec.h" -a \
-  ! -e "/usr/include/ffmpeg/libavcodec/avcodec.h" ] && MISSING="libavcodec $MISSING"
+[ ! -e "${PREFIX}/include/sqlite3.h" ] && MISSING="libsqlite3 $MISSING"
+[ ! -e "${PREFIX}/include/jpeglib.h" ] && MISSING="libjpeg $MISSING"
+[ ! -e "${PREFIX}/include/libexif/exif-loader.h" ] && MISSING="libexif $MISSING"
+[ ! -e "${PREFIX}/include/id3tag.h" ] && MISSING="libid3tag $MISSING"
+[ ! -e "${PREFIX}/include/ogg/ogg.h" ] && MISSING="libogg $MISSING"
+[ ! -e "${PREFIX}/include/vorbis/codec.h" ] && MISSING="libvorbis $MISSING"
+[ ! -e "${PREFIX}/include/FLAC/metadata.h" ] && MISSING="libflac $MISSING"
+[ ! -e "${PREFIX}/include/ffmpeg/avutil.h" -a \
+  ! -e "${PREFIX}/include/libavutil/avutil.h" -a \
+  ! -e "${PREFIX}/include/ffmpeg/libavutil/avutil.h" ] && MISSING="libavutil $MISSING"
+[ ! -e "${PREFIX}/include/ffmpeg/avformat.h" -a \
+  ! -e "${PREFIX}/include/libavformat/avformat.h" -a \
+  ! -e "${PREFIX}/include/ffmpeg/libavformat/avformat.h" ] && MISSING="libavformat $MISSING"
+[ ! -e "${PREFIX}/include/ffmpeg/avcodec.h" -a \
+  ! -e "${PREFIX}/include/libavcodec/avcodec.h" -a \
+  ! -e "${PREFIX}/include/ffmpeg/libavcodec/avcodec.h" ] && MISSING="libavcodec $MISSING"
 if [ -n "$MISSING" ]; then
        echo -e "\nERROR!  Cannot continue."
        echo -e "The following required libraries are either missing, or are missing development headers:\n"
@@ -151,8 +155,7 @@ case $OS_NAME in
                fi
                ;;
        *)
-               echo "Unknown OS : $OS_NAME"
-               exit 1
+               echo "WARNING: Unknown OS : $OS_NAME" 1>&2
                ;;
 esac
 
@@ -183,7 +186,7 @@ fi
 echo "" >> ${CONFIGFILE}
 
 echo "/* Enable if the system iconv.h exists.  ID3 tag reading in various character sets will not work properly otherwise. */" >> ${CONFIGFILE}
-if [ -f /usr/include/iconv.h ]; then
+if [ -f ${ICONV_PREFIX}/include/iconv.h ]; then
 echo "#define HAVE_ICONV_H" >> ${CONFIGFILE}
 else
 echo -e "\nWARNING!!  Iconv support not found.  ID3 tag reading may not work."
@@ -192,7 +195,7 @@ fi
 echo "" >> ${CONFIGFILE}
 
 echo "/* Enable if the system libintl.h exists for NLS support. */" >> ${CONFIGFILE}
-if [ -f /usr/include/libintl.h ]; then
+if [ -f ${INTL_PREFIX}/include/libintl.h ]; then
 echo "#define ENABLE_NLS" >> ${CONFIGFILE}
 else
 echo "/*#define ENABLE_NLS*/" >> ${CONFIGFILE}
 
comments