forked from deater/linux_logo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·110 lines (89 loc) · 2.11 KB
/
configure
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/sh
# This is not a real autoconf configure script.
# I will not ship a configure script that is larger than
# the generated linux_logo executable.
# This is a simple shell script that gathers the info linux_logo
# needs, and should be compatible enough.
# Tested on Linux, Irix, Solaris and FreeBSD
# - vmw
usage() {
echo "Usage: $0 [ --prefix=PATH ]"
exit 1
}
while [ $# -gt 0 ]
do
case "${1%=*}" in
-h|--help) usage;;
--prefix) PREFIX="${1#*=}";;
esac
shift
done
if [ -z "$ARCH" ]; then
ARCH=`uname -m`
fi
OS=`uname`
INSTALL=`which install`
if [ -z "$PREFIX" ]; then
PREFIX=/usr/local
fi
which xgettext
XGETTEXT_MISSING=$?
if [ $XGETTEXT_MISSING -eq 0 ]; then
XGETTEXT=xgettext
fi
which gcc
GCC_MISSING=$?
if [ $GCC_MISSING -eq 1 ]; then
which cc
CC_MISSING=$?
if [ $CC_MISSING -eq 1 ]; then
echo "C compiler not found!"
else
CC=cc
fi
else
CC=gcc
fi
LIBSYSINFO=libsysinfo-0.2.2
LDFLAGS=""
if [ $CC = gcc ]; then
CFLAGS="-Wall -O2"
else
CFLAGS="-O2"
fi
$CROSS$CC $CFLAGS -c intl_test.c
INTL_MISSING=$?
echo
echo "CONFIGURING LINUX_LOGO"
echo " Detected Architecture: "$ARCH
echo " Detected Operating System: "$OS
echo " Install prefix: "$PREFIX
echo " Install program: "$INSTALL
echo " xgettext: "$XGETTEXT
if [ $INTL_MISSING -ne 0 ]; then
echo " libintl.h not found, disabling i18n support"
USE_I18N=0
else
USE_I18N=1
fi
echo " libsysinfo: "$LIBSYSINFO
echo " C Compiler : "$CC
echo " CFLAGS : "$CFLAGS
echo "CC=$CC" > Makefile.default
echo "ARCH=$ARCH" >> Makefile.default
echo "OS=$OS" >> Makefile.default
echo "PREFIX=$PREFIX" >> Makefile.default
echo "INSTALL=$INSTALL" >> Makefile.default
echo "CFLAGS=$CFLAGS" >> Makefile.default
echo "LIBSYSINFO=$LIBSYSINFO" >> Makefile.default
echo "LDFLAGS=$LDFLAGS" >> Makefile.default
echo "XGETTEXT=$XGETTEXT" >> Makefile.default
echo "USE_I18N=$USE_I18N" >> Makefile.default
echo "CONFIGURE_RAN=1" >> Makefile.default
echo
cd $LIBSYSINFO && ./configure
echo
echo "If cross compiling set the CROSS and ARCH variables"
echo
echo "Done configuring, run 'make'"
echo