~midori/midori/innernodeselect

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
#! /bin/sh
#
# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# See the file COPYING for the full license text.
#
#~  Usage:
#~    ./configure [OPTIONS]
#~  Options:
#~    --prefix=PREFIX        Installation prefix
#~    --enable-gtk3          Use GTK+3
#~    --disable-zeitgeist    Disable Zeitgeist history integration
#~    --enable-granite       Fancy notebook and pop-overs
#~    --enable-apidocs       API documentation
#

if [ -z `command -v cmake` ]; then
    echo Fatal: cmake not installed
    exit 1
fi

while [ $# != 0 ]; do
    case $1 in
        --enable-gtk3)
            ARGS="$ARGS -DUSE_GTK3=1";;
        --disable-zeitgeist)
            ARGS="$ARGS -DUSE_ZEITGEIST=0";;
        --enable-granite)
            ARGS="$ARGS -DUSE_GRANITE=1";;
        --enable-apidocs)
            ARGS="$ARGS -DUSE_APIDOCS=1";;
        --prefix=*)
            ARGS="$ARGS -DCMAKE_INSTALL_PREFIX=${1#*=}";;
        *)
            grep -e '^#~' $0 | sed s/#~//
            exit
    esac
    shift
done

BUILD_DIR="_build"

if [ ! -f GNUmakefile ]; then
    cp -v GNUmakefile.in GNUmakefile || exit 1
fi

mkdir -p $BUILD_DIR && cd $BUILD_DIR || exit 1
cmake $ARGS .. || exit 1

echo
echo "Configuring done, run \"make\" to compile"