Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 249 lines (200 sloc) 8.517 kB
bf17a24 @broxtronix Re-arranged the repository...
broxtronix authored
1 # __BEGIN_LICENSE__
2 #
3 # Copyright (C) 2006 United States Government as represented by the
4 # Administrator of the National Aeronautics and Space Administration
5 # (NASA). All Rights Reserved.
6 #
7 # This software is distributed under the NASA Open Source Agreement
8 # (NOSA), version 1.3. The NOSA has been approved by the Open Source
9 # Initiative. See the file COPYING at the top of the distribution
10 # directory tree for the complete NOSA document.
11 #
12 # THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY
13 # KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
14 # LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO
15 # SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
16 # A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT
17 # THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT
18 # DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE.
19 #
20 # __END_LICENSE__
21
22
23 AC_INIT([NASA Ames Stereo Pipeline], [2.0], [asp@nx.arc.nasa.gov], [StereoPipeline])
24 AC_CONFIG_AUX_DIR(config)
25 AC_CANONICAL_HOST
26 AM_INIT_AUTOMAKE
27 AX_CONFIG_HEADER_PREFIX([src/asp_config.h], [ASP_])
28
29 ##################################################
30 # configuration options
31 ##################################################
32
33 # This should be first, so everything else can use it
34 AC_ARG_ENABLE(verbose,
35 AC_HELP_STRING([--enable-verbose], [verbose configuration output @<:@no@:>@]),
36 [ ENABLE_VERBOSE=$enableval ],
37 [ if test -z $"ENABLE_VERBOSE"; then ENABLE_VERBOSE=no; fi ]
38 )
39
40 if ! test -f config.options && test -f config/config.options.default; then
41 if test "yes" = "$ENABLE_VERBOSE" ; then
42 AC_MSG_NOTICE([creating default config.options file])
43 fi
44 cp config/config.options.default config.options
45 fi
46
47 if test -f config.options; then
48 if test "yes" = "$ENABLE_VERBOSE" ; then
49 AC_MSG_NOTICE([sourcing config.options])
50 cat config.options
51 fi
52 source config.options
53 fi
54
55 AC_ARG_WITH(paths,
56 AC_HELP_STRING([--with-paths=PATHS], [additional search path(s) for packages]),
57 [ PKG_PATHS="$withval $PKG_PATHS" ]
58 )
59 PKG_PATHS="${PKG_PATHS} ${HOME} ${HOME}/local /sw /opt /opt/local /usr/local /usr/X11R6 /usr"
60
61
62 ##################################################
63 # compilation options
64 ##################################################
65
66 CPPFLAGS="$CPPFLAGS -I\${top_srcdir}/src"
67
68 AC_ARG_ENABLE(debug,
69 AC_HELP_STRING([--enable-debug], [generate debugging symbols @<:@no@:>@]),
70 [ ENABLE_DEBUG=$enableval ],
71 [ if test -z "$ENABLE_DEBUG"; then ENABLE_DEBUG=no; fi ]
72 )
73
74 if test "yes" = "$ENABLE_DEBUG"; then
75 AX_CFLAGS="$AX_CFLAGS -g -DDEBUG"
76 else
77 AX_CFLAGS="$AX_CFLAGS -DNDEBUG"
78 fi
79
80 AC_ARG_ENABLE(optimize,
81 AC_HELP_STRING([--enable-optimize@<:@=LEVEL@:>@], [compiler optimization level @<:@yes@:>@]),
82 [ ENABLE_OPTIMIZE=$enableval ],
83 [ if test -z "$ENABLE_OPTIMIZE"; then ENABLE_OPTIMIZE=yes; fi ]
84 )
85
86 if test "yes" = "$ENABLE_OPTIMIZE" || test "3" = "$ENABLE_OPTIMIZE"; then
87 AX_CFLAGS="$AX_CFLAGS -O3"
88 elif test "2" = "$ENABLE_OPTIMIZE"; then
89 AX_CFLAGS="$AX_CFLAGS -O2"
90 elif test "1" = "$ENABLE_OPTIMIZE"; then
91 AX_CFLAGS="$AX_CFLAGS -O1"
92 elif test "coreduo" = "$ENABLE_OPTIMIZE"; then
93 AX_CFLAGS="$AX_CFLAGS -O4 -march=prescott -mtune=prescott -funroll-loops -fexpensive-optimizations -msse -msse2 -msse3 -mfpmath=sse"
94 elif test "sse3" = "$ENABLE_OPTIMIZE"; then
95 AX_CFLAGS="$AX_CFLAGS -O4 -funroll-loops -fexpensive-optimizations -msse -msse2 -msse3 -mfpmath=sse"
96 else
97 AX_CFLAGS="$AX_CFLAGS -O0"
98 fi
99
100 CFLAGS="$CFLAGS $AX_CFLAGS"
101 CXXFLAGS="$CXXFLAGS $AX_CFLAGS"
102
103 if test "yes" = "$ENABLE_VERBOSE" ; then
104 AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
105 AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
106 AC_MSG_NOTICE([using CXXFLAGS=$CXXFLAGS])
107 fi
108
109 # We set up the include paths ourselves, so
110 # we ask autoconf to get out of the way.
111 DEFAULT_INCLUDES=
112 AC_SUBST(DEFAULT_INCLUDES)
113
114 ##################################################
115 # installation options
116 ##################################################
117
118 AC_ARG_ENABLE(custom-arch-name,
119 AC_HELP_STRING([--enable-custom-arch-name=NAME], [custom architecture name, used for generating the default intallation prefix]),
120 [ENABLE_CUSTOM_ARCH_NAME=$enableval]
121 )
122
123 if test ${prefix} = NONE; then
124 if test ! -z ${ENABLE_CUSTOM_ARCH_NAME} ; then
125 prefix=`pwd`/build/${ENABLE_CUSTOM_ARCH_NAME}
126 else
127 prefix=`pwd`/build/${host}
128 fi
129 fi
130
131 AC_MSG_NOTICE([using installation prefix ${prefix}])
132
133
134 ##################################################
135 # distribution options
136 ##################################################
137
138 AC_ARG_WITH(dist-license,
139 AC_HELP_STRING([--with-dist-license=LICENSE], [special distribution license file to be included as the COPYING file in the distribution]),
140 [DIST_LICENSE=$withval]
141 )
142 AC_SUBST(DIST_LICENSE)
143 AM_CONDITIONAL(DIST_LICENSE, [test ! -z "$DIST_LICENSE"])
144
145 if test ! -z "$DIST_LICENSE" ; then
146 AC_MSG_NOTICE([using distribution license file $DIST_LICENSE])
147 fi
148
149 AC_ARG_WITH(dist-license-summary,
150 AC_HELP_STRING([--with-dist-license-summary=SUMMARY], [special distribution license summary file to be included in the headers of source files in the distribution]),
151 [DIST_LICENSE_SUMMARY=$withval]
152 )
153 AC_SUBST(DIST_LICENSE_SUMMARY)
154 AM_CONDITIONAL(DIST_LICENSE_SUMMARY, [test ! -z "$DIST_LICENSE_SUMMARY"])
155
156 if test ! -z "$DIST_LICENSE_SUMMARY" ; then
157 AC_MSG_NOTICE([using distribution license summary file $DIST_LICENSE_SUMMARY])
158 fi
159
160 AC_ARG_WITH(dist-config-options-default,
161 AC_HELP_STRING([--with-dist-config-options-default@<:@=FILE@:>@], [special distribution config.options.default file]),
162 [DIST_CONFIG_OPTIONS_DEFAULT=$withval]
163 )
164 AC_SUBST(DIST_CONFIG_OPTIONS_DEFAULT)
165 AM_CONDITIONAL(DIST_CONFIG_OPTIONS_DEFAULT, [test ! -z "$DIST_CONFIG_OPTIONS_DEFAULT"])
166
167 if test ! -z "$DIST_CONFIG_OPTIONS_DEFAULT" ; then
168 if test "yes" = "$DIST_CONFIG_OPTIONS_DEFAULT" ; then
169 DIST_CONFIG_OPTIONS_DEFAULT="config/config.options.default"
170 fi
171 AC_MSG_NOTICE([using distribution config.options.default file: $DIST_CONFIG_OPTIONS_DEFAULT])
172 fi
173
174
175 ##################################################
176 # package checks
177 ##################################################
178
179 AC_PROG_CC
180 AC_PROG_CXX
181 AC_PROG_INSTALL
182 AC_PROG_LIBTOOL
183 AC_PROG_MAKE_SET
184
185 if test "yes" = "$ENABLE_VERBOSE"; then
186 AC_MSG_NOTICE([using PKG_PATHS=$PKG_PATHS])
187 fi
188
189 AX_PKG_PTHREADS
190
191 AX_PKG_BOOST
192 AX_PKG_BOOST_LIB(PROGRAM_OPTIONS, [-lboost_program_options], [boost/program_options.hpp])
193 AX_PKG_BOOST_LIB(FILESYSTEM, [-lboost_filesystem], [boost/filesystem/path.hpp])
194 AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp])
195
196 if test `uname -s` == Darwin; then
197 AX_PKG_LAPACK
198 fi
199
200 AX_PKG(M, [], [-lm], [math.h])
201 AX_PKG(Z, [], [-lz], [zlib.h])
202 AX_PKG(PNG, [], [-lpng], [png.h])
203 AX_PKG(TIFF, [], [-ltiff], [tiff.h])
204 AX_PKG(JPEG, [], [-ljpeg], [jpeglib.h])
205
206 AX_PKG(VW, [], [-lvw], [vw/Image/ImageView.h])
207 AX_PKG(VW_MATH, [], [-lvwMath], [vw/Math/LinearAlgebra.h])
208 AX_PKG(VW_STEREO, [], [-lvwStereo], [vw/Stereo/OptimizedCorrelator.h])
209 AX_PKG(VW_CAMERA, [], [-lvwCamera], [vw/Camera/CAHVModel.h])
210 AX_PKG(VW_CARTOGRAPHY, [], [-lvwCartography], [vw/Cartography/GeoReference.h])
211 AX_PKG(VW_INTEREST_POINT, [], [-lvwInterestPoint])
212
213 AX_PKG(GDAL, [], [-lgdal], [gdal.h])
214 AM_CONDITIONAL(HAVE_PKG_GDAL, [test "$HAVE_PKG_GDAL" = "yes"])
215
216 AX_PKG(MBA, [], [-lMBA_1.0_gpl_nopt], [MBA.h])
217
218 AX_PKG(SPICE, [], [-lcspice -lcsupport], [SpiceUsr.h SpiceZfc.h])
219 AX_PKG(SIFT, [], [-llowesift], [key.h])
220
221 ##################################################
222 # module definitions
223 ##################################################
224
225 if test `uname -s` == Darwin; then
226 AX_MODULE(STEREOPIPELINE, src, yes, [BOOST BOOST_PROGRAM_OPTIONS BOOST_FILESYSTEM BOOST_THREAD VW VW_CAMERA VW_CARTOGRAPHY VW_STEREO VW_MATH LAPACK Z PNG TIFF JPEG MBA SPICE], [SIFT VW_INTEREST_POINT GDAL])
227 else
228 AX_MODULE(STEREOPIPELINE, src, yes, [BOOST BOOST_PROGRAM_OPTIONS BOOST_FILESYSTEM BOOST_THREAD VW VW_CAMERA VW_CARTOGRAPHY VW_STEREO VW_MATH Z PNG TIFF JPEG MBA SPICE], [SIFT VW_INTEREST_POINT GDAL])
229 fi
230
231 if test ${MAKE_MODULE_STEREOPIPELINE} != "yes"; then
232 AC_MSG_ERROR([cannot build the Stereo Pipeline!])
233 fi
234
235 ##################################################
236 # makefiles to process
237 ##################################################
238
239 AC_CONFIG_FILES([ \
240 Makefile \
241 src/Makefile \
242 ])
243
244 # This hideous hack makes it possible to use GNU make's conditionals.
245 ENDIF=endif
246 AC_SUBST(ENDIF)
247
248 AC_OUTPUT
Something went wrong with that request. Please try again.