aboutsummaryrefslogtreecommitdiff
path: root/multimedia/libdvdnav/files/patch-configure2
blob: 921c3884f688b9d3b9c73aad46c883a8fcc55f36 (plain) (blame)
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
--- configure2.orig	2013-12-19 22:43:15.000000000 +0100
+++ configure2	2014-01-30 07:05:30.000000000 +0100
@@ -27,6 +27,7 @@
   echo "  --help                   print this message"
   echo "  --prefix=PREFIX          install in PREFIX [$PREFIX]"
   echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
+  echo "  --libdatadir=DIR         install pkgconfig files in DIR [PREFIX/lib/pkgconfig]"
   echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
   echo "  --incdir=DIR             install includes in DIR [PREFIX/include/dvdnav]"
   echo "  --enable-static          build static libraries [default=yes]"
@@ -76,6 +77,8 @@
   ;;
   --libdir=*) libdir="$optval"
   ;;
+  --libdatadir=*) libdatadir="$optval"
+  ;;
   --shlibdir=*) shlibdir="$optval"
   ;;
   --incdir=*) incdir="$optval"
@@ -101,9 +104,10 @@
   esac
 done
 
-PREFIX=`cd $PREFIX && pwd`
+#PREFIX=`cd $PREFIX && pwd`
 
 test -z "$libdir" && libdir=$PREFIX/lib
+test -z "$libdatadir" && libdir=$PREFIX/lib/pkgconfig
 test -z "$shlibdir" && shlibdir=$PREFIX/lib
 test -z "$incdir" && incdir=$PREFIX/include/dvdnav
 
@@ -133,10 +137,24 @@
   ;;
 esac
 
+echo -n "Checking if we're big-endian... "
+bigendian=no
+TMPD=`mktemp -d temp.XXXX`
+TMPC=$TMPD/endian.c
+TMPO=$TMPD/endian.o
+cat > $TMPC <<EOF
+unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
+EOF
+$cc $optimizations $cflags -c -o $TMPO $TMPC
+od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && bigendian=yes
+rm -rf $TMPD
+echo "$bigendian"
+
 cat > config.mak << EOF
 # Automatically generated by configure, do not edit
 PREFIX=$PREFIX
 libdir=$libdir
+libdatadir=$libdatadir
 shlibdir=$shlibdir
 incdir=$incdir
 THREADLIB=$threadlib
@@ -163,6 +181,7 @@
 /* Automatically generated by configure, do not edit */
 #include "version.h"
 EOF
+test "$bigendian" = "yes" && echo "#define WORDS_BIGENDIAN" >> config.h || echo "#undef WORDS_BIGENDIAN" >> config.h
 
 # build tree in object directory if source path is different from current one
 if test "$source_path_used" != "no"; then