| 1 |
# ************** <auto-copyright.pl BEGIN do not edit this line> ************** |
|---|
| 2 |
# |
|---|
| 3 |
# VR Juggler is (C) Copyright 1998-2007 by Iowa State University |
|---|
| 4 |
# |
|---|
| 5 |
# Original Authors: |
|---|
| 6 |
# Allen Bierbaum, Christopher Just, |
|---|
| 7 |
# Patrick Hartling, Kevin Meinert, |
|---|
| 8 |
# Carolina Cruz-Neira, Albert Baker |
|---|
| 9 |
# |
|---|
| 10 |
# This library is free software; you can redistribute it and/or |
|---|
| 11 |
# modify it under the terms of the GNU Library General Public |
|---|
| 12 |
# License as published by the Free Software Foundation; either |
|---|
| 13 |
# version 2 of the License, or (at your option) any later version. |
|---|
| 14 |
# |
|---|
| 15 |
# This library is distributed in the hope that it will be useful, |
|---|
| 16 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 17 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 18 |
# Library General Public License for more details. |
|---|
| 19 |
# |
|---|
| 20 |
# You should have received a copy of the GNU Library General Public |
|---|
| 21 |
# License along with this library; if not, write to the |
|---|
| 22 |
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|---|
| 23 |
# Boston, MA 02111-1307, USA. |
|---|
| 24 |
# |
|---|
| 25 |
# *************** <auto-copyright.pl END do not edit this line> *************** |
|---|
| 26 |
|
|---|
| 27 |
# ----------------------------------------------------------------------------- |
|---|
| 28 |
# Base configure.in for Gadgeteer. |
|---|
| 29 |
# ----------------------------------------------------------------------------- |
|---|
| 30 |
# This file is "compiled" by GNU autoconf to generate the configure script |
|---|
| 31 |
# that is actually run. |
|---|
| 32 |
# ----------------------------------------------------------------------------- |
|---|
| 33 |
|
|---|
| 34 |
AC_INIT([Gadgeteer], [1.2], [vrjuggler-devel@lists.sourceforge.net]) |
|---|
| 35 |
AC_CONFIG_HEADERS([gadget/gadgetDefines.h]) |
|---|
| 36 |
AC_PREREQ([2.53]) |
|---|
| 37 |
AC_COPYRIGHT([VR Juggler is (C) Copyright 1998-2007 by Iowa State University]) |
|---|
| 38 |
AC_CONFIG_SRCDIR([gadget/gadgetConfig.h]) |
|---|
| 39 |
AC_REVISION($Revision$) |
|---|
| 40 |
AC_CONFIG_AUX_DIR([../../share/config]) |
|---|
| 41 |
DPP_PREREQ([2.1.2]) |
|---|
| 42 |
DPP_INIT |
|---|
| 43 |
|
|---|
| 44 |
# Generate the reconfig script first so that it's easy to run configure again |
|---|
| 45 |
# if it fails later on. |
|---|
| 46 |
DPP_GEN_RECONFIG |
|---|
| 47 |
|
|---|
| 48 |
# ----------------------------------------------------------------------------- |
|---|
| 49 |
# Command-line arguments (--enable-option, --with-pkg=package_name). |
|---|
| 50 |
# ----------------------------------------------------------------------------- |
|---|
| 51 |
|
|---|
| 52 |
# ------------------------------------------------------ # |
|---|
| 53 |
# --enable-feature[=arg] and --disable-feature arguments # |
|---|
| 54 |
# ------------------------------------------------------ # |
|---|
| 55 |
|
|---|
| 56 |
AC_ARG_ENABLE([xwindows], |
|---|
| 57 |
[ --enable-xwindows Use X11 for windowing code on |
|---|
| 58 |
Mac OS X instead of Cocoa default=no], |
|---|
| 59 |
[XWIN_UI="$enableval"], [XWIN_UI='no']) |
|---|
| 60 |
|
|---|
| 61 |
DPP_STD_CPP(yes) |
|---|
| 62 |
|
|---|
| 63 |
# -------------------------------------------- # |
|---|
| 64 |
# --with-pkg[=arg] and --without-pkg arguments # |
|---|
| 65 |
# -------------------------------------------- # |
|---|
| 66 |
|
|---|
| 67 |
# ------------------------------------------------------ # |
|---|
| 68 |
# --enable-feature[=arg] and --disable-feature arguments # |
|---|
| 69 |
# ------------------------------------------------------ # |
|---|
| 70 |
AC_ARG_ENABLE([versioning], |
|---|
| 71 |
[ --disable-versioning Disable all versioning capabilities], |
|---|
| 72 |
[ENABLE_VERSIONING="$enableval"], [ENABLE_VERSIONING='yes']) |
|---|
| 73 |
|
|---|
| 74 |
# Allow forcing the use of GCC as the compiler. |
|---|
| 75 |
DPP_WITH_GCC(no) |
|---|
| 76 |
|
|---|
| 77 |
# Define the binary format. |
|---|
| 78 |
DPP_ABI_SETUP |
|---|
| 79 |
|
|---|
| 80 |
# ----------------------------------------------------------------------------- |
|---|
| 81 |
# System-dependent stuff. |
|---|
| 82 |
# ----------------------------------------------------------------------------- |
|---|
| 83 |
DPP_WIN32_SETUP |
|---|
| 84 |
DPP_SYSTEM_SETUP |
|---|
| 85 |
|
|---|
| 86 |
# Templates for Autoheader. |
|---|
| 87 |
AH_TEMPLATE([_CMA_NOWRAPPERS_], [Define if building on HP-UX.]) |
|---|
| 88 |
|
|---|
| 89 |
# Depending on the target operating system, set various command options and |
|---|
| 90 |
# such. |
|---|
| 91 |
case $target_os in |
|---|
| 92 |
# SGI running IRIX 6.*. |
|---|
| 93 |
irix6*) |
|---|
| 94 |
if test "x$USE_GCC" != "xyes" ; then |
|---|
| 95 |
DBG_FLAGS="$DBG_FLAGS -gslim" |
|---|
| 96 |
fi |
|---|
| 97 |
;; |
|---|
| 98 |
# HP PA-RISC machine running HP-UX 10.20. |
|---|
| 99 |
hpux10.20) |
|---|
| 100 |
AC_DEFINE(_CMA_NOWRAPPERS_,) |
|---|
| 101 |
;; |
|---|
| 102 |
# HP PA-RISC machine running HP-UX 11.x. |
|---|
| 103 |
hpux11*) |
|---|
| 104 |
AC_DEFINE(_CMA_NOWRAPPERS_,) |
|---|
| 105 |
;; |
|---|
| 106 |
esac |
|---|
| 107 |
|
|---|
| 108 |
# ----------------------------------------------------------------------------- |
|---|
| 109 |
# Path setup. |
|---|
| 110 |
# ----------------------------------------------------------------------------- |
|---|
| 111 |
|
|---|
| 112 |
# $srcdir is the root directory of the juggler source tree. To get a value for |
|---|
| 113 |
# $GADGETROOT_ABS, we cd there and save the value of running pwd. Then return |
|---|
| 114 |
# to the directory where configure is being run ($topdir). |
|---|
| 115 |
cd "$srcdir" |
|---|
| 116 |
GADGETROOT_ABS=`pwd` |
|---|
| 117 |
|
|---|
| 118 |
cd "$GADGETROOT_ABS/../.." |
|---|
| 119 |
UNIX_JUGGLERROOT_ABS=`pwd` |
|---|
| 120 |
cd "$topdir" |
|---|
| 121 |
|
|---|
| 122 |
if test "x$CYGPATH" != "xno" ; then |
|---|
| 123 |
JUGGLERROOT_ABS=`cygpath -w "$UNIX_JUGGLERROOT_ABS" | sed -e 's/\\\\/\\//g'` |
|---|
| 124 |
else |
|---|
| 125 |
JUGGLERROOT_ABS="$UNIX_JUGGLERROOT_ABS" |
|---|
| 126 |
fi |
|---|
| 127 |
|
|---|
| 128 |
# ----------------------------------------------------------------------------- |
|---|
| 129 |
# Checks for programs. |
|---|
| 130 |
# ----------------------------------------------------------------------------- |
|---|
| 131 |
VJ_COMPILER_SETUP |
|---|
| 132 |
|
|---|
| 133 |
# If we are not using X11 on Mac OS X, then we need to make sure that we can |
|---|
| 134 |
# build Objective-C and Objective-C++ code. |
|---|
| 135 |
if test "x$PLATFORM" = "xDarwin" -a "x$XWIN_UI" != "xyes" ; then |
|---|
| 136 |
DPP_PROG_OBJC |
|---|
| 137 |
DPP_PROG_OBJCXX |
|---|
| 138 |
fi |
|---|
| 139 |
|
|---|
| 140 |
VJ_PROG_CC_PROF_FLAG(yes) |
|---|
| 141 |
VJ_PROG_CXX_PROF_FLAG(yes) |
|---|
| 142 |
|
|---|
| 143 |
# Ensure that the C++ compiler we've found is capable of compiling the newer |
|---|
| 144 |
# newer C++ features that we need. |
|---|
| 145 |
DPP_CXX_NAMESPACE([AC_MSG_ERROR([*** The library requires C++ namesapce support ***])]) |
|---|
| 146 |
DPP_CXX_HAVE_STD |
|---|
| 147 |
DPP_CXX_INLINE([AC_MSG_ERROR([*** The library requires C++ inline support ***])]) |
|---|
| 148 |
DPP_CXX_RTTI([AC_MSG_ERROR([*** The library requires C++ RTTI support ***])]) |
|---|
| 149 |
DPP_CXX_STATIC_CAST([AC_MSG_ERROR([*** The library requires C++ static_cast<> ***])]) |
|---|
| 150 |
DPP_CXX_DYNAMIC_CAST([AC_MSG_ERROR([*** The library requires C++ dynamic_cast<> ***])]) |
|---|
| 151 |
|
|---|
| 152 |
# Ensure that a version of Perl greater than or equal to 5.004 is available. |
|---|
| 153 |
DPP_PERL_VER(5.004, , , [AC_MSG_ERROR([*** Perl is required ***])]) |
|---|
| 154 |
AC_CHECK_PROG(MTREE_CMD, mtree, mtree, [\$(PERL) \$(scriptdir)/mtree.pl]) |
|---|
| 155 |
DPP_HAVE_GNU_MAKE(3.78, , |
|---|
| 156 |
[AC_MSG_ERROR([*** The build system requires GNU make 3.78 or newer ***])]) |
|---|
| 157 |
DPP_BASIC_PROGS($PLATFORM, $OS_TYPE) |
|---|
| 158 |
DPP_PROG_INSTALL |
|---|
| 159 |
VJ_LINKER_SETUP |
|---|
| 160 |
|
|---|
| 161 |
# ----------------------------------------------------------------------------- |
|---|
| 162 |
# Checks for libraries. |
|---|
| 163 |
# ----------------------------------------------------------------------------- |
|---|
| 164 |
MIN_VPR_VERSION='1.1.49' |
|---|
| 165 |
VPR_PATH([$MIN_VPR_VERSION], , |
|---|
| 166 |
[AC_MSG_ERROR([*** VPR required for Gadgeteer ***])]) |
|---|
| 167 |
#VPR_SUBSYSTEM=`$VPR_CONFIG --subsystem` |
|---|
| 168 |
MIN_JCCL_VERSION='1.1.5' |
|---|
| 169 |
JCCL_PATH_CXX([$MIN_JCCL_VERSION], , |
|---|
| 170 |
[AC_MSG_ERROR([*** JCCL C++ API required for Gadgeteer ***])]) |
|---|
| 171 |
|
|---|
| 172 |
MIN_GMTL_VERSION='0.4.11' |
|---|
| 173 |
GMTL_PATH([$MIN_GMTL_VERSION], , |
|---|
| 174 |
[AC_MSG_ERROR([*** GMTL required for Gadgeteer ***])]) |
|---|
| 175 |
|
|---|
| 176 |
gadget_use_x11='no' |
|---|
| 177 |
gadget_use_cocoa='no' |
|---|
| 178 |
|
|---|
| 179 |
AH_TEMPLATE([GADGET_USE_X11], [Define if the X Window System will be used]) |
|---|
| 180 |
|
|---|
| 181 |
AC_PATH_XTRA |
|---|
| 182 |
|
|---|
| 183 |
if test "x$PLATFORM" = "xDarwin" ; then |
|---|
| 184 |
if test "x$XWIN_UI" = "xyes" ; then |
|---|
| 185 |
if test "x$have_x" = "xyes" ; then |
|---|
| 186 |
gadget_use_x11='yes' |
|---|
| 187 |
AC_DEFINE([GADGET_USE_X11],) |
|---|
| 188 |
# If --enable-xwindows was passed on the command line but X11 was not |
|---|
| 189 |
# found, then we have a problem. |
|---|
| 190 |
else |
|---|
| 191 |
AC_MSG_ERROR([*** Use of the X Window System requested, but it was not found ***]) |
|---|
| 192 |
fi |
|---|
| 193 |
else |
|---|
| 194 |
gadget_use_cocoa='yes' |
|---|
| 195 |
AC_DEFINE([GADGET_USE_COCOA], , [Define if Cocoa will be used]) |
|---|
| 196 |
fi |
|---|
| 197 |
elif test "x$OS_TYPE" = "xUNIX" ; then |
|---|
| 198 |
if test "x$have_x" = "xyes" ; then |
|---|
| 199 |
gadget_use_x11='yes' |
|---|
| 200 |
AC_DEFINE([GADGET_USE_X11],) |
|---|
| 201 |
else |
|---|
| 202 |
AC_MSG_ERROR([*** Use of the X Window System is required ***]) |
|---|
| 203 |
fi |
|---|
| 204 |
fi |
|---|
| 205 |
|
|---|
| 206 |
# ----------------------------------------------------------------------------- |
|---|
| 207 |
# Checks for header files. |
|---|
| 208 |
# ----------------------------------------------------------------------------- |
|---|
| 209 |
AC_HEADER_STDC |
|---|
| 210 |
AC_CHECK_HEADERS([sys/time.h unistd.h]) |
|---|
| 211 |
|
|---|
| 212 |
# ----------------------------------------------------------------------------- |
|---|
| 213 |
# Checks for typedefs, structures, and compiler characteristics. |
|---|
| 214 |
# ----------------------------------------------------------------------------- |
|---|
| 215 |
AC_TYPE_SIZE_T |
|---|
| 216 |
|
|---|
| 217 |
# ----------------------------------------------------------------------------- |
|---|
| 218 |
# Checks for library functions. |
|---|
| 219 |
# ----------------------------------------------------------------------------- |
|---|
| 220 |
AC_CHECK_FUNCS(strdup strerror) |
|---|
| 221 |
|
|---|
| 222 |
# ----------------------------------------------------------------------------- |
|---|
| 223 |
# Miscellaneous checks. |
|---|
| 224 |
# ----------------------------------------------------------------------------- |
|---|
| 225 |
DPP_INSTALLER(vrjuggler, 0644, 0755, 0755) |
|---|
| 226 |
|
|---|
| 227 |
# ----------------------------------------------------------------------------- |
|---|
| 228 |
# Do Makefile substitutions. |
|---|
| 229 |
# ----------------------------------------------------------------------------- |
|---|
| 230 |
VJ_VERSION_GROK(VERSION) |
|---|
| 231 |
|
|---|
| 232 |
# Set the form of the version number used for versioned directory and file |
|---|
| 233 |
# naming. Unstable builds use all three version numbers; stable builds use |
|---|
| 234 |
# only the major and minor version numbers. |
|---|
| 235 |
if test "x$ENABLE_VERSIONING" = "xyes" ; then |
|---|
| 236 |
VERSION_DOT="$MAJOR_VERSION.$MINOR_VERSION" |
|---|
| 237 |
VERSION_UNDERSCORE="${MAJOR_VERSION}_${MINOR_VERSION}" |
|---|
| 238 |
HEADER_VERSION="gadgeteer-$VERSION_DOT" |
|---|
| 239 |
CLOSE_HEADER_VERSION='..' |
|---|
| 240 |
LIBRARY_VERSION="-$VERSION_UNDERSCORE" |
|---|
| 241 |
DATA_VERSION="gadgeteer-$VERSION_DOT" |
|---|
| 242 |
PLUGIN_VERSION="gadgeteer-$VERSION_DOT" |
|---|
| 243 |
|
|---|
| 244 |
AC_DEFINE([GADGET_USE_VERSIONING], , |
|---|
| 245 |
[Define if full package versioning capabilities are enabled]) |
|---|
| 246 |
AC_DEFINE_UNQUOTED([GADGET_VERSION_DOT], ["$VERSION_DOT"], |
|---|
| 247 |
[Gadgeteer version string]) |
|---|
| 248 |
|
|---|
| 249 |
# If versioning is disabled, then none of the version variables need to be |
|---|
| 250 |
# set except for $DATA_VERSION and $PLUGIN_VERSION. Their use is different |
|---|
| 251 |
# than the others. The important thing to note is that the directory name is |
|---|
| 252 |
# unversioned in this case. |
|---|
| 253 |
else |
|---|
| 254 |
DATA_VERSION="gadgeteer" |
|---|
| 255 |
PLUGIN_VERSION="gadgeteer" |
|---|
| 256 |
fi |
|---|
| 257 |
|
|---|
| 258 |
# Add these C++ options when compiling with G++. |
|---|
| 259 |
#if test "x$GXX" = "xyes" ; then |
|---|
| 260 |
# CXXFLAGS="-fhonor-std $CXXFLAGS" |
|---|
| 261 |
#fi |
|---|
| 262 |
|
|---|
| 263 |
CXXFLAGS="$CXXFLAGS $CXX_VISIBILITY_FLAGS $VPR_CXXFLAGS $JCCL_CXXFLAGS $GMTL_INCLUDES" |
|---|
| 264 |
OBJCXXFLAGS="$CXXFLAGS -fobjc-exceptions" |
|---|
| 265 |
BASE_APP_LINK_FLAGS="$STDFLAGS $BASE_APP_LINK_FLAGS" |
|---|
| 266 |
DEPEND_FLAGS="$VPR_CXXFLAGS $JCCL_CXXFLAGS $GMTL_INCLUDES" |
|---|
| 267 |
gadget_cxxflags="$STDFLAGS" |
|---|
| 268 |
|
|---|
| 269 |
if test "x$PLATFORM" = "xIRIX" -a "x$USE_GCC" != "xyes" ; then |
|---|
| 270 |
# CFLAGS="$CFLAGS -woff 1685,515,608,658,799,803,852,1048,1233,1499" |
|---|
| 271 |
CXXFLAGS="$CXXFLAGS -w2" |
|---|
| 272 |
BASE_APP_LINK_FLAGS="$BASE_APP_LINK_FLAGS -J4 -all" |
|---|
| 273 |
elif test "x$PLATFORM" = "xDarwin" ; then |
|---|
| 274 |
changequote(<<, >>) |
|---|
| 275 |
vpr_gcc_major=`echo $dpp_gcc_ver | sed -e 's/^\([0-9]*\)\..*/\1/'` |
|---|
| 276 |
changequote([, ]) |
|---|
| 277 |
|
|---|
| 278 |
# GCC 4.0 in Darwin removed -fexport-coalesced. |
|---|
| 279 |
if test $vpr_gcc_major -lt 4 ; then |
|---|
| 280 |
CXXFLAGS_DYNLIB="$CXXFLAGS_DYNLIB -fexport-coalesced" |
|---|
| 281 |
OBJCXXFLAGS_DYNLIB="$OBJCXXFLAGS_DYNLIB -fexport-coalesced" |
|---|
| 282 |
fi |
|---|
| 283 |
|
|---|
| 284 |
BASE_APP_LINK_FLAGS="$BASE_APP_LINK_FLAGS -Wl,-bind_at_load" |
|---|
| 285 |
elif test "x$OS_TYPE" = "xWin32" -a "x$USE_GCC" != "xyes" ; then |
|---|
| 286 |
vc_cflags='/QIfdiv /QI0f' |
|---|
| 287 |
vc_cxxflags='/GR /GX /EHc /QIfdiv /QI0f' |
|---|
| 288 |
CFLAGS="$CFLAGS $vc_cflags" |
|---|
| 289 |
CXXFLAGS="$CXXFLAGS $vc_cxxflags" |
|---|
| 290 |
BASE_APP_LINK_FLAGS="$BASE_APP_LINK_FLAGS /nologo /incremental:no" |
|---|
| 291 |
DBG_FLAGS="$DBG_FLAGS /MDd" |
|---|
| 292 |
OPT_FLAGS="$OPT_FLAGS /MD" |
|---|
| 293 |
gadget_cxxflags="$vc_cxxflags $gadget_cxxflags" |
|---|
| 294 |
fi |
|---|
| 295 |
|
|---|
| 296 |
# For makedepend(1) to work properly on HP-UX with aCC, we have to include |
|---|
| 297 |
# these extra paths. |
|---|
| 298 |
if test "x$PLATFORM" = "xHP" ; then |
|---|
| 299 |
_aCC_ROOT="/opt/aCC" |
|---|
| 300 |
DEPEND_EXTRAS="$DEPEND_EXTRAS -I${_aCC_ROOT} -I${_aCC_ROOT}/include -I${_aCC_ROOT}/include/iostream" |
|---|
| 301 |
elif test "x$OS_TYPE" = "xWin32" ; then |
|---|
| 302 |
DEPEND_EXTRAS="$DEPEND_EXTRAS -D__cplusplus" |
|---|
| 303 |
fi |
|---|
| 304 |
|
|---|
| 305 |
# Define the base path to the source directory using $(GADGETROOT_ABS) as an |
|---|
| 306 |
# alternative to using $(srcdir). |
|---|
| 307 |
UNIX_GADGETROOT_ABS="$GADGETROOT_ABS" |
|---|
| 308 |
|
|---|
| 309 |
# $APP_EXTRA_LIBS must list all the libraries need to link a Gadgeteer-based |
|---|
| 310 |
# application. |
|---|
| 311 |
if test "x$OS_TYPE" = "xWin32" ; then |
|---|
| 312 |
APP_EXTRA_LIBS="$LDFLAGS $JCCL_LIBS $LIBS comctl32.lib gdi32.lib user32.lib" |
|---|
| 313 |
APP_EXTRA_PROF_LIBS="$APP_EXTRA_LIBS" |
|---|
| 314 |
else |
|---|
| 315 |
APP_EXTRA_LIBS="$LDFLAGS $JCCL_LIBS $LIBS $DTK_LDFLAGS" |
|---|
| 316 |
APP_EXTRA_PROF_LIBS="$LDFLAGS $JCCL_PROF_LIBS $LIBS $DTK_LDFLAGS" |
|---|
| 317 |
|
|---|
| 318 |
if test "x$gadget_use_x11" = "xyes" ; then |
|---|
| 319 |
APP_EXTRA_LIBS="$APP_EXTRA_LIBS $X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" |
|---|
| 320 |
APP_EXTRA_PROF_LIBS="$APP_EXTRA_PROF_LIBS $X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" |
|---|
| 321 |
elif test "x$PLATFORM" = "xDarwin" ; then |
|---|
| 322 |
APP_EXTRA_LIBS="$APP_EXTRA_LIBS -framework Cocoa" |
|---|
| 323 |
APP_EXTRA_PROF_LIBS="$APP_EXTRA_PROF_LIBS -framework Cocoa" |
|---|
| 324 |
fi |
|---|
| 325 |
fi |
|---|
| 326 |
|
|---|
| 327 |
if test "x$OS_TYPE" = "xUNIX" ; then |
|---|
| 328 |
if test "x$gadget_use_x11" = "xyes" ; then |
|---|
| 329 |
INCLUDES="$INCLUDES $X_CFLAGS" |
|---|
| 330 |
gadget_cxxflags="$gadget_cxxflags $X_CFLAGS" |
|---|
| 331 |
APP_EXTRA_LIBS_X11="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" |
|---|
| 332 |
fi |
|---|
| 333 |
fi |
|---|
| 334 |
|
|---|
| 335 |
gadget_lib_name="gadget$LIBRARY_VERSION" |
|---|
| 336 |
gadget_prof_lib_name="gadget_p$LIBRARY_VERSION" |
|---|
| 337 |
|
|---|
| 338 |
# Remove duplicated arguments from each of the following. This can help speed |
|---|
| 339 |
# up compile times, and it reduces the (perceived) complexity of the commands. |
|---|
| 340 |
# These steps are performed here because no further additions are made to any |
|---|
| 341 |
# of these variables after this point. |
|---|
| 342 |
VJ_STRIP_DUPLICATE_ARGS(CFLAGS, [$CFLAGS]) |
|---|
| 343 |
VJ_STRIP_DUPLICATE_ARGS(CXXFLAGS, [$CXXFLAGS]) |
|---|
| 344 |
VJ_STRIP_DUPLICATE_ARGS(OBJCXXFLAGS, [$OBJCXXFLAGS]) |
|---|
| 345 |
VJ_STRIP_DUPLICATE_ARGS(DEPEND_FLAGS, [$DEPEND_FLAGS]) |
|---|
| 346 |
VJ_STRIP_DUPLICATE_ARGS(DEPEND_EXTRAS, [$DEPEND_EXTRAS]) |
|---|
| 347 |
VJ_STRIP_DUPLICATE_ARGS(INCLUDES, [$INCLUDES]) |
|---|
| 348 |
VJ_STRIP_DUPLICATE_ARGS(gadget_cxxflags, [$gadget_cxxflags]) |
|---|
| 349 |
|
|---|
| 350 |
# Put together the basic information needed to compile Gadgeteer applications. |
|---|
| 351 |
VJ_APP_COMPILER($CC, $CFLAGS, $CXX, $CXXFLAGS, $DBG_FLAGS, $OPT_FLAGS, |
|---|
| 352 |
GADGET_BASE_DIR, $DEFS, $INCLUDES, ${_EXTRA_FLAGS}, |
|---|
| 353 |
$HEADER_VERSION) |
|---|
| 354 |
VJ_APP_LINKER([$CXX], [$BASE_APP_LINK_FLAGS], [$LDOPTS_DBG], [$LDOPTS_OPT], |
|---|
| 355 |
[GADGET_BASE_DIR], [$gadget_lib_name], [$APP_EXTRA_LIBS]) |
|---|
| 356 |
|
|---|
| 357 |
APP_BASE_DIR='$(topdir)/instlinks' |
|---|
| 358 |
APP_BASE_DIR_INST='$(GADGET_BASE_DIR)' |
|---|
| 359 |
|
|---|
| 360 |
DYLIB_DEPS="$APP_EXTRA_LIBS" |
|---|
| 361 |
DYLIB_PROF_DEPS="$APP_EXTRA_PROF_LIBS" |
|---|
| 362 |
|
|---|
| 363 |
VJ_STRIP_DUPLICATE_ARGS([CXXFLAGS], [$CXXFLAGS]) |
|---|
| 364 |
VJ_STRIP_DUPLICATE_ARGS([DEPEND_FLAGS], [$DEPEND_FLAGS]) |
|---|
| 365 |
#VJ_STRIP_DUPLICATE_ARGS_REVERSE([DYLIB_DEPS], [$DYLIB_DEPS]) |
|---|
| 366 |
#VJ_STRIP_DUPLICATE_ARGS_REVERSE([DYLIB_PROF_DEPS], [$DYLIB_PROF_DEPS]) |
|---|
| 367 |
|
|---|
| 368 |
VJ_BUILD_LIB_FILE_LIST([$DYLIB_DEPS], [DYLIB_DEP_FILES]) |
|---|
| 369 |
VJ_BUILD_LIB_FILE_LIST([$DYLIB_PROF_DEPS], [DYLIB_PROF_DEP_FILES]) |
|---|
| 370 |
|
|---|
| 371 |
# Translate paths from UNIX-style to Win32. |
|---|
| 372 |
if test "x$OS_TYPE" = "xWin32" ; then |
|---|
| 373 |
GADGETROOT_ABS=`dospath -p "$GADGETROOT_ABS"` |
|---|
| 374 |
JUGGLERROOT_ABS=`dospath -p "$JUGGLERROOT_ABS"` |
|---|
| 375 |
|
|---|
| 376 |
DEPEND_EXTRAS=`dospath "$DEPEND_EXTRAS"` |
|---|
| 377 |
INCLUDES=`dospath "$INCLUDES"` |
|---|
| 378 |
LIBS=`dospath "$LIBS"` |
|---|
| 379 |
LN_S='cp -r' |
|---|
| 380 |
RM_LN='rm -rf' |
|---|
| 381 |
MTREE_CMD=`dospath "$MTREE_CMD"` |
|---|
| 382 |
|
|---|
| 383 |
# APP_EXTRA_LIBS=`dospath "$APP_EXTRA_LIBS"` |
|---|
| 384 |
else |
|---|
| 385 |
RM_LN='rm -f' |
|---|
| 386 |
GADGETROOT_ABS="$GADGETROOT_ABS" |
|---|
| 387 |
JUGGLERROOT_ABS="$JUGGLERROOT_ABS" |
|---|
| 388 |
fi |
|---|
| 389 |
|
|---|
| 390 |
# Set up some sed expressions that will help separate the share directory from |
|---|
| 391 |
# the full installation prefix. |
|---|
| 392 |
if test "x$prefix" = "xNONE" ; then |
|---|
| 393 |
_prefix_exp="s|^$ac_default_prefix/||" |
|---|
| 394 |
else |
|---|
| 395 |
_prefix_exp="s|^$prefix/||" |
|---|
| 396 |
fi |
|---|
| 397 |
|
|---|
| 398 |
# In Autoconf 2.60, datadir has been renamed to datarootdir. |
|---|
| 399 |
if test "x$datarootdir" != "x" ; then |
|---|
| 400 |
data_var="$datarootdir" |
|---|
| 401 |
else |
|---|
| 402 |
data_var="$datadir" |
|---|
| 403 |
fi |
|---|
| 404 |
|
|---|
| 405 |
# Make a best-effort attempt to extract the actual share directory from the |
|---|
| 406 |
# full installation prefix. This is not foolproof, but it will work in almost |
|---|
| 407 |
# all cases. A person would have to be doing something malicious or foolish |
|---|
| 408 |
# to make it break. |
|---|
| 409 |
data_subdir=`echo "$data_var" | sed -e 's|^${prefix}/||' -e "${_prefix_exp}"` |
|---|
| 410 |
GADGET_SHARE_DIR="$data_subdir/$DATA_VERSION" |
|---|
| 411 |
|
|---|
| 412 |
# Information needed to generate gadgeteer.fpc. |
|---|
| 413 |
if test "x$GNU_LD" = "xyes" ; then |
|---|
| 414 |
static_begin="-Wl,-Bstatic" |
|---|
| 415 |
static_end="-Wl,-Bdynamic" |
|---|
| 416 |
else |
|---|
| 417 |
static_begin="-B static" |
|---|
| 418 |
static_end="-B dynamic" |
|---|
| 419 |
fi |
|---|
| 420 |
|
|---|
| 421 |
gadget_ldflags="-L\$prefix/lib\$LIBBITSUF" |
|---|
| 422 |
gadget_libs="-l$gadget_lib_name" |
|---|
| 423 |
gadget_prof_libs="-l$gadget_prof_lib_name" |
|---|
| 424 |
gadget_extra_libs="$LDFLAGS $LIBS $DTK_LDFLAGS $APP_EXTRA_LIBS_X11" |
|---|
| 425 |
|
|---|
| 426 |
if test "x$PLATFORM" = "xIRIX" -a "x$USE_GCC" != "xyes" ; then |
|---|
| 427 |
gadget32_flags='-n32' |
|---|
| 428 |
gadget64_flags='-64' |
|---|
| 429 |
elif test "x$GCC" = "xyes" ; then |
|---|
| 430 |
gadget32_flags='-m32' |
|---|
| 431 |
gadget64_flags='-m64' |
|---|
| 432 |
fi |
|---|
| 433 |
|
|---|
| 434 |
gadget_extra_ldflags="$APP_EXTRA_LIBS_BEGIN" |
|---|
| 435 |
|
|---|
| 436 |
includedir="$includedir/$HEADER_VERSION" |
|---|
| 437 |
gadget_header_subdir="$HEADER_VERSION" |
|---|
| 438 |
gadget_data_subdir="$DATA_VERSION" |
|---|
| 439 |
gadget_plugin_subdir="$PLUGIN_VERSION" |
|---|
| 440 |
|
|---|
| 441 |
DPP_SUBST |
|---|
| 442 |
|
|---|
| 443 |
AC_SUBST(data_subdir) |
|---|
| 444 |
AC_SUBST(topdir) |
|---|
| 445 |
AC_SUBST(UNIX_GADGETROOT_ABS) |
|---|
| 446 |
AC_SUBST(UNIX_JUGGLERROOT_ABS) |
|---|
| 447 |
AC_SUBST(GADGETROOT_ABS) |
|---|
| 448 |
AC_SUBST(JUGGLERROOT_ABS) |
|---|
| 449 |
AC_SUBST(GADGET_SHARE_DIR) |
|---|
| 450 |
|
|---|
| 451 |
AC_SUBST(EXTRA_LDFLAGS) |
|---|
| 452 |
AC_SUBST(RM_LN) |
|---|
| 453 |
|
|---|
| 454 |
AC_SUBST(VERSION_DOT) |
|---|
| 455 |
AC_SUBST(VERSION_UNDERSCORE) |
|---|
| 456 |
AC_SUBST(HEADER_VERSION) |
|---|
| 457 |
AC_SUBST(CLOSE_HEADER_VERSION) |
|---|
| 458 |
AC_SUBST(LIBRARY_VERSION) |
|---|
| 459 |
AC_SUBST(DATA_VERSION) |
|---|
| 460 |
|
|---|
| 461 |
AC_SUBST(MIN_VPR_VERSION) |
|---|
| 462 |
AC_SUBST(MIN_JCCL_VERSION) |
|---|
| 463 |
AC_SUBST(MIN_GMTL_VERSION) |
|---|
| 464 |
|
|---|
| 465 |
AC_SUBST(APP_BASE_DIR) |
|---|
| 466 |
AC_SUBST(APP_BASE_DIR_INST) |
|---|
| 467 |
|
|---|
| 468 |
AC_SUBST(DYLIB_DEPS) |
|---|
| 469 |
AC_SUBST(DYLIB_DEP_FILES) |
|---|
| 470 |
AC_SUBST(DYLIB_PROF_DEPS) |
|---|
| 471 |
AC_SUBST(DYLIB_PROF_DEP_FILES) |
|---|
| 472 |
|
|---|
| 473 |
AC_SUBST(APP_EXTRA_LIBS_X11) |
|---|
| 474 |
|
|---|
| 475 |
AC_SUBST(static_begin) |
|---|
| 476 |
AC_SUBST(static_end) |
|---|
| 477 |
AC_SUBST(gadget_cxxflags) |
|---|
| 478 |
AC_SUBST(gadget_extra_cxxflags) |
|---|
| 479 |
AC_SUBST(gadget_ldflags) |
|---|
| 480 |
AC_SUBST(gadget_libs) |
|---|
| 481 |
AC_SUBST(gadget_prof_libs) |
|---|
| 482 |
AC_SUBST(gadget_extra_ldflags) |
|---|
| 483 |
AC_SUBST(gadget_extra_libs) |
|---|
| 484 |
AC_SUBST(gadget32_flags) |
|---|
| 485 |
AC_SUBST(gadget64_flags) |
|---|
| 486 |
AC_SUBST(gadget_use_x11) |
|---|
| 487 |
AC_SUBST(gadget_use_cocoa) |
|---|
| 488 |
AC_SUBST(gadget_header_subdir) |
|---|
| 489 |
AC_SUBST(gadget_data_subdir) |
|---|
| 490 |
AC_SUBST(gadget_plugin_subdir) |
|---|
| 491 |
|
|---|
| 492 |
# ----------------------------------------------------------------------------- |
|---|
| 493 |
# Final file generation step. |
|---|
| 494 |
# ----------------------------------------------------------------------------- |
|---|
| 495 |
|
|---|
| 496 |
VJ_MTREE_LIB_GEN(GADGET, mtree, $PLATFORM, $ISA) |
|---|
| 497 |
|
|---|
| 498 |
AC_CONFIG_FILES([ |
|---|
| 499 |
gadgeteer.fpc |
|---|
| 500 |
Makefile |
|---|
| 501 |
Makefile.inc |
|---|
| 502 |
common.defs.mk |
|---|
| 503 |
make.defs.mk |
|---|
| 504 |
cluster/Makefile |
|---|
| 505 |
cluster/Packets/Makefile |
|---|
| 506 |
gadget/Makefile |
|---|
| 507 |
gadget/Devices/Makefile |
|---|
| 508 |
gadget/Devices/KeyboardMouseDevice/Makefile |
|---|
| 509 |
gadget/Devices/Sim/Makefile |
|---|
| 510 |
gadget/Filter/Makefile |
|---|
| 511 |
gadget/Filter/Position/Makefile |
|---|
| 512 |
gadget/Type/Makefile |
|---|
| 513 |
gadget/Type/KeyboardMouse/Makefile |
|---|
| 514 |
gadget/Type/Position/Makefile |
|---|
| 515 |
gadget/Util/Makefile |
|---|
| 516 |
test/Makefile |
|---|
| 517 |
mtree/GADGET.data.dist |
|---|
| 518 |
mtree/GADGET.include.dist |
|---|
| 519 |
mtree/GADGET.install.dist |
|---|
| 520 |
mtree/GADGET.samples.dist |
|---|
| 521 |
mtree/GADGET.test.dist |
|---|
| 522 |
mtree/GADGET.tools.dist |
|---|
| 523 |
VARS.pl |
|---|
| 524 |
] |
|---|
| 525 |
) |
|---|
| 526 |
|
|---|
| 527 |
AC_OUTPUT |
|---|