-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.common
152 lines (123 loc) · 4.47 KB
/
configure.common
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LIBTOOL
OSNAME=`uname -s`
# GCC version
if test "x$GXX" = "xyes"; then
AC_MSG_CHECKING([GNU compiler version])
# Don't pass CXXFLAGS to the following CXX command as some
# of them can't be specified along with '-v'.
cc_version=["`$CXX -v 2>&1 </dev/null |grep 'gcc version' |\
sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"]
AC_MSG_RESULT([$cc_version])
# Some version numbers
cc_vers_major=`echo $cc_version | cut -f1 -d.`
cc_vers_minor=`echo $cc_version | cut -f2 -d.`
cc_vers_patch=`echo $cc_version | cut -f3 -d.`
test -n "$cc_vers_major" || cc_vers_major=0
test -n "$cc_vers_minor" || cc_vers_minor=0
test -n "$cc_vers_patch" || cc_vers_patch=0
cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`
if test $cc_vers_major -lt 3; then
AC_MSG_ERROR([gcc >= 3.0 is needed to compile `])
fi
fi
# On linux, some gcc versions build shared libraries unusable in java when using
# the -O2 optimization. Switch it off here:
if test $cc_vers_major -gt 3; then
case $host in
*-*-linux*) CXXFLAGS="-g -O";;
esac
fi
#----------------------------------------------------------------
# LINKFORSHARED are the flags passed to the $(CC) command that links
# -- this is only needed for a few systems
#----------------------------------------------------------------
AC_MSG_CHECKING(LINKFORSHARED)
if test -z "$LINKFORSHARED"
then
case $host in
*-*-aix*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
*-*-hp*) LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
*-*-linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
*-*-next*) LINKFORSHARED="-u libsys_s";;
*-sco-sysv*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
*-*-irix6*) LINKFORSHARED="-all";; esac
fi
AC_MSG_RESULT($LINKFORSHARED)
AC_SUBST(LINKFORSHARED)
#---------------------------------------------------
# Platform dependent flags
#---------------------------------------------------
case $host in
*-*-linux*)
LPTHREAD="-lpthread"
DEVICEADAPTERPATH="\${libdir}/micro-manager"
JARPATH="/usr/share/java"
;;
esac
AC_MSG_RESULT($LPTHREAD)
AC_SUBST(LPTHREAD)
build_platform="$build_cpu"
case "$build_cpu" in
i*86)
build_platform="i386"
;;
esac
# Specify architecture when building Universal Binaries on Mac
AC_ARG_ENABLE([arch], [AS_HELP_STRING([--enable-arch=arch],[Mac OS X only: ppc, i386, or x86_64])], [ARCH=$enableval], [ARCH=])
#----------------------------------------------------------------
# ImageJ
#----------------------------------------------------------------
# Determine if we need to look for ImageJ
AC_MSG_CHECKING(whether to build for imagej)
AC_ARG_WITH([imagej], [AS_HELP_STRING([--with-imagej=path],[path to ImageJ-based GUI])], [IMAGEJDIR="$withval"], [IMAGEJDIR="yes"])
AC_MSG_RESULT($IMAGEJDIR)
# Debian IJ settings
DEBIANIJ="/usr/share/java/ij.jar";
DEBIANIJPLUGIN="/usr/share/imagej";
AM_CONDITIONAL(BUILD_WITH_JAVA, test "$IMAGEJDIR" != "no")
if test "$IMAGEJDIR" != "no" ; then
#----------------------------------------------------------------
# Find ImageJ directory
#----------------------------------------------------------------
AC_MSG_CHECKING(for ImageJ directory)
if test "$IMAGEJDIR" = "yes"; then
IMAGEJDIR="/Applications/ImageJ /usr/local/ImageJ /usr/local/imagej "
fi
IJPATH=""
for d in $IMAGEJDIR ; do
if test -d "$d" ; then
AC_MSG_RESULT($d)
IJPATH=$d
break
fi
done
if test -e "$DEBIANIJ"; then
IJPATH="$DEBIANIJPLUGIN";
fi
if test "$IJPATH" = "" ; then
AC_MSG_ERROR([not found, Use the without-imagej directive to build without ImageJ or install ImageJ (http://rsb.info.nih.gov/ij/ and rerun configure, possibly using the --with-imagej=path directive])
fi
#----------------------------------------------------------------
# .so-directory
#----------------------------------------------------------------
if test -z "$DEVICEADAPTERPATH"; then
DEVICEADAPTERPATH="$IJPATH"
fi
#----------------------------------------------------------------
# .jar-directory
#----------------------------------------------------------------
if test -z "$JARPATH"; then
JARPATH="$IJPATH/plugins/Micro-Manager"
fi
fi
AC_SUBST(IJPATH)
AC_SUBST(DEVICEADAPTERPATH)
AC_SUBST(JARPATH)
AC_SUBST(OSNAME)
AC_MSG_CHECKING(device adapter path)
AC_MSG_RESULT($DEVICEADAPTERPATH)
AC_MSG_CHECKING(jar path)
AC_MSG_RESULT($JARPATH)