forked from PolMine/RcppCWB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-win32
More file actions
executable file
·132 lines (97 loc) · 3.99 KB
/
Copy pathbuild-win32
File metadata and controls
executable file
·132 lines (97 loc) · 3.99 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/sh
##
## IMS Open Corpus Workbench (CWB)
## Copyright (C) 1993-2006 by IMS, University of Stuttgart
## Copyright (C) 2007- by the respective contributers (see file AUTHORS)
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by the
## Free Software Foundation; either version 2, or (at your option) any later
## version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
## Public License for more details (in the file "COPYING", or available via
## WWW at http://www.gnu.org/copyleft/gpl.html).
# Note : this is a build script, not an install script, for cross-compilation.
# So no need to run as root.
# ALSO NOTE, we assume cross-compilation, not native via MinGW-on-Windows
# (since we still haven't really got the latter to work yet).
# load config.mk
config_file=$(cat config.mk)
# alter platform
target="PLATFORM=darwin-brew"
rep="PLATFORM=mingw-cross"
## TODO this search/repolace syntax is a bashism!
config_file=${config_file/"$target"/"$rep"}
# alter site: coming from EITHER standard OR beta-install
target="SITE=standard"
rep="SITE=windows-release"
config_file=${config_file/"$target"/"$rep"}
target="SITE=beta-install"
rep="SITE=windows-release"
config_file=${config_file/"$target"/"$rep"}
##
## GUESSWORK SKIPPED from now on.
## users are told to set the MINGW_CROSS_HOME environment variable instead.
##
if false ; then
# find out where the dlls are, and save that folder
# this is a lot easier said than done
# we need to go through the directories in the library search path of the cross-compiler,
# and if libpcre.la is there, we can try to extract its dlname= variable.
# note, this will only work for this particular crosscompiler executable!
paths=$(i586-mingw32msvc-gcc --print-search-dirs | grep "programs: =")
paths=${paths/"programs: ="/" "}
paths=$(echo $paths | tr ":" " ")
for i in $paths
do
echo "looking in ${i}libpcre.la ......"
if [ -f "${i}libpcre.la" ] ; then
echo "found!"
LIBPRCE_LA=$(cat "${i}libpcre.la")
LIBPCRE_LA_FOUND_IN=$i
break
fi
done
if [ -n "$LIBPCRE_LA_FOUND_IN" ] ; then
echo "-----------> $LIBPCRE_LA_FOUND_IN"
DLNAME_LINE=$(grep "^dlname='" < "${LIBPCRE_LA_FOUND_IN}libpcre.la")
echo "dlname line == $DLNAME_LINE"
DLNAME_LINE=$(echo $DLNAME_LINE | tr -d "'")
dlname=${DLNAME_LINE/"dlname="/""}
echo "$LIBPCRE_LA_FOUND_IN$dlname"
deduced_path=$(dirname $LIBPCRE_LA_FOUND_IN$dlname)
deduced_path=$(cd "$deduced_path" && pwd)
echo "Deduced path to DLLS as $deduced_path..... "
# if either (LIBPCRE_DLL_PATH and LIBGLIB_DLL_PATH) or LIB_DLL_PATH are set
# in the config file, our guess for the dll location will be overridden,
# because we put it at the beginning of the config.mk file.
prepend=$( cat <<HERE
LIB_DLL_PATH=$deduced_path
HERE
)
config_file="$prepend
$config_file"
else
echo "Couldn't find libpcre.la!! If you did not specify dll paths in your config.mk, then make will fail."
fi
fi
# save config.mk
rm -f config.mk.bak
mv config.mk config.mk.bak
echo "$config_file" > config.mk
if [ -f config.mk ] ; then echo "config.mk exists" ; else echo "config.mk doesn't exist" ; exit ; fi
if [ -f config.mk.bak ] ; then echo "config.mk.bak exists" ; else echo "config.mk.bak doesn't exist" ; exit ; fi
# make cwb
make clean
make depend
make cl
make utils
make cqp
# and finally....
make release
# restore original state of config file (so subversion doesn't get confused if this directory is under version control)
rm config.mk
mv config.mk.bak config.mk