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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(qucs,0.0.15,qucs-bugs@lists.sourceforge.net)
AC_CONFIG_SRCDIR([qucs/qucs.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([no-define])
AM_MAINTAINER_MODE
AC_PREFIX_DEFAULT([/usr/local])
test "x$prefix" = xNONE && prefix="/usr/local"
dnl Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar, :)
dnl Check for debugging option.
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug],
[include debug output @<:@default=no@:>@]),
[case "$enableval" in
yes) enable_debug="yes" ;;
no) enable_debug="no" ;;
*) enable_debug="no" ;;
esac],
[enable_debug="no"])
if test $USE_MAINTAINER_MODE = yes; then
enable_debug="yes"
fi
if test "$enable_debug" = yes; then
AC_DEFINE(DEBUG, 1, [Define if debug output should be supported.])
QT_DEF=""
else
AC_DEFINE(NDEBUG, 1, [Define if debug code should be suppressed.])
QT_DEF="-DQT_NO_DEBUG -DQT_NO_CHECK"
if test "x$GCC" = xyes; then
CFLAGS="`echo $CFLAGS | sed -e 's/\-g //g'`"
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/\-g //g'`"
# disable stripping (debian bug #437876)
# case $host_os in
# *darwin*) LDFLAGS="$LDFLAGS" ;;
# *) LDFLAGS="$LDFLAGS -s" ;;
# esac
fi
fi
unset enable_debug
dnl Check for Win32.
case $host_os in
*mingw*) WIN32=yes ;;
*) WIN32=no ;;
esac
AM_CONDITIONAL(COND_WIN32, test x$WIN32 = xyes)
dnl Check for MacOSX.
case $host_os in
*darwin*) MACOSX=yes ;;
*) MACOSX=no ;;
esac
AM_CONDITIONAL(COND_MACOSX, test x$MACOSX = xyes)
dnl Yet another compiler check.
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -pipe"
CXXFLAGS="$CXXFLAGS -pipe -fno-exceptions -fno-check-new"
if test x$WIN32 = xyes; then
CXXFLAGS="$CXXFLAGS -fno-rtti"
fi
if test $USE_MAINTAINER_MODE = yes; then
CFLAGS="$CFLAGS -W -Wall -Wmissing-prototypes"
CXXFLAGS="$CXXFLAGS -W -Wall"
fi
fi
dnl Check for new platforms.
osversion="`grep \"$host\" $srcdir/PLATFORMS 2>/dev/null`"
if test "x$osversion" = "x"; then
AC_MSG_RESULT([
The $PACKAGE package has never been compiled or run on this platform.
Please send an email to <qucs-devel@lists.sourceforge.net> including your
compiler and Qt version and whether it worked correctly or not. The
'$host' line will then be added to the PLATFORMS file included
in this package.
])
fi
unset osversion
dnl Release specific. Uncomment these as required.
AC_CONFIG_SUBDIRS(qucs-core)
# AC_CONFIG_SUBDIRS(freehdl)
RELEASEDIRS="qucs-core"
# RELEASEDIRS="$RELEASEDIRS freehdl"
AC_SUBST(RELEASEDIRS)
dnl Check for language support.
AC_PATH_PROGS(LRELEASE, lrelease-qt3 lrelease, :, [$QTDIR/bin:$PATH])
AC_PATH_PROGS(LUPDATE, lupdate-qt3 lupdate, :, [$QTDIR/bin:$PATH])
dnl Check for MOC/UIC support.
AC_PATH_PROGS(MOC, moc-qt3 moc, :, [$QTDIR/bin:$PATH])
AC_PATH_PROGS(UIC, uic-qt3 uic, :, [$QTDIR/bin:$PATH])
if test "$MOC" = ":"; then
AC_MSG_WARN([
The $PACKAGE package needs the 'Qt Meta Object Compiler' to compile properly.
Though Qt itself may be properly installed including headers and libraries
the 'moc' program is missing. Possibly you need to install the full
development package of Qt.])
fi
dnl Check for X11
if test x$WIN32 != xyes; then
AC_PATH_XTRA
X11_INCLUDES="$X_CFLAGS"
X11_LDFLAGS=""
X11_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
AC_SUBST(X11_INCLUDES)
AC_SUBST(X11_LDFLAGS)
AC_SUBST(X11_LIBS)
fi
dnl Check include path to Qt.
QT_INCLUDES=""
QT_VER=2
AC_MSG_CHECKING([for Qt headers])
paths="$QTDIR/include /usr/local/qt/include /usr/include/qt /usr/include/qt3 \
/usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/X11/qt \
/usr/X11R6/include/qt /usr/X11R6/include /sw/include/qt \
/usr/X11R6/include/qt2 $prefix/include/qt3"
for path in $paths; do
if test -f "$path/qapplication.h"; then
QT_INCLUDES=$path
if test -f "$path/qmemarray.h"; then
QT_VER=3
fi
break
fi
done
if test "x$QT_INCLUDES" != "x"; then
AC_MSG_RESULT([found in $QT_INCLUDES])
QT_INCLUDES="-I$QT_INCLUDES"
else
AC_MSG_ERROR([not found])
fi
AC_SUBST(QT_INCLUDES)
dnl Check for multi-threaded option.
AC_ARG_ENABLE([mt],
AC_HELP_STRING([--disable-mt],
[link to non-threaded Qt (deprecated)]),
enable_mt="$enableval",
[if test $QT_VER = 3; then
enable_mt="yes"
else
enable_mt="no"
fi])
if test "$enable_mt" = yes; then
QT_LDF=""
QT_LIB="-lqt-mt"
QT_INC="$QT_DEF -DQT_THREAD_SUPPORT -D_REENTRANT"
[case $host_os in
*freebsd4*) QT_LIB="$QT_LIB -pthread" ;;
*freebsd[567]*) QT_LIB="$QT_LIB -lpthread" ;;
*mingw*) QT_INC="$QT_INC -mthreads"; QT_LDF="$QT_LDF -mthreads" ;;
esac]
QT_MTS="multi-threaded"
else
QT_LDF=""
QT_LIB="-lqt"
QT_INC="$QT_DEF"
QT_MTS="non-threaded"
fi
case $host_os in
*mingw*)
QT_LIB="$QT_LIB -lqtmain"
QT_INC="$QT_INC -DQT_DLL -DUNICODE"
QT_LDF="$QT_LDF -mwindows"
;;
esac
unset enable_mt
dnl Check library path to Qt.
QT_LDFLAGS=""
QT_LIBS=""
AC_MSG_RESULT([checking for Qt... $QT_VER ($QT_MTS)])
AC_MSG_CHECKING([for Qt library])
paths="$QTDIR/lib $QTDIR/lib64 /usr/local/qt/lib /usr/lib/qt /usr/lib \
/usr/X11R6/lib/X11/qt /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt \
/usr/X11R6/lib /sw/lib /usr/lib64/qt /usr/X11R6/lib/qt2"
AC_LANG(C++)
for path in $paths; do
save_LIBS="$LIBS"
save_LDFLAGS="$LDFLAGS"
save_CXXFLAGS="$CXXFLAGS"
LIBS="$LIBS $X11_LIBS $QT_LIB"
LDFLAGS="$LDFLAGS $X11_LDFLAGS -L$path $QT_LDF"
CXXFLAGS="$CXXFLAGS $X11_INCLUDES $QT_INCLUDES $QT_INC"
AC_LINK_IFELSE(
[#include <qapplication.h>
int main (int argc, char ** argv) {
QApplication a (argc, argv); a.exec (); return 0; }],
[QT_LDFLAGS="$path";
QT_INCLUDES="$QT_INCLUDES $QT_INC";
break;])
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
CXXFLAGS="$save_CXXFLAGS"
done
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
CXXFLAGS="$save_CXXFLAGS"
if test "x$QT_LDFLAGS" != "x"; then
AC_MSG_RESULT([found in $QT_LDFLAGS])
QT_LDFLAGS="-L$QT_LDFLAGS $QT_LDF"
QT_LIBS="$QT_LIB"
else
AC_MSG_ERROR([not found])
fi
AC_SUBST(QT_LDFLAGS)
AC_SUBST(QT_LIBS)
AC_LANG(C)
dnl Check for additional header files.
AC_CHECK_HEADERS([ieeefp.h])
dnl Check for path transformation.
case $build_os in
mingw* | cygwin*)
PATHXFORM="cygpath -w"
;;
*)
PATHXFORM="echo"
;;
esac
AC_SUBST(PATHXFORM)
dnl Create path info.
BITMAP_PATH="$prefix/share/qucs/bitmaps/"
AC_DEFINE_UNQUOTED([BITMAPDIR], ["$BITMAP_PATH"],
[Where the data files go.])
unset BITMAP_PATH
BIN_PATH="$prefix/bin/"
AC_DEFINE_UNQUOTED([BINARYDIR], ["$BIN_PATH"],
[Where the binary files go.])
unset BIN_PATH
LANG_PATH="$prefix/share/qucs/lang/"
AC_DEFINE_UNQUOTED([LANGUAGEDIR], ["$LANG_PATH"],
[Where the language files go.])
unset LANG_PATH
LIBRARY_PATH="$prefix/share/qucs/library/"
AC_DEFINE_UNQUOTED([LIBRARYDIR], ["$LIBRARY_PATH"],
[Where the component library files go.])
unset LIBRARY_PATH
DOC_PATH="$prefix/share/qucs/docs/"
AC_DEFINE_UNQUOTED([DOCDIR], ["$DOC_PATH"],
[Where the documentation files go.])
unset DOC_PATH
dnl Definitions at top of <config.h>.
AH_TOP([
/* __BEGIN_DECLS should be used at the beginning of your declarations,
so that C++ compilers don't mangle their names. Use __END_DECLS at
the end of C declarations. */
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS
# define __END_DECLS
#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
])
dnl Add here all your Makefiles. These are created by configure.
AC_CONFIG_FILES([Makefile
contrib/Makefile
qucs-edit/Makefile
qucs-help/Makefile
qucs-help/docs/Makefile
qucs-help/docs/en/Makefile
qucs-help/docs/de/Makefile
qucs-help/docs/es/Makefile
qucs-help/docs/fr/Makefile
qucs-help/docs/ru/Makefile
qucs-help/docs/uk/Makefile
qucs-help/docs/cs/Makefile
qucs-help/docs/pt/Makefile
qucs-filter/Makefile
qucs-transcalc/Makefile
qucs-transcalc/bitmaps/Makefile
qucs-transcalc/examples/Makefile
qucs-lib/Makefile
qucs-lib/library/Makefile
qucs-attenuator/Makefile
qucs-attenuator/bitmaps/Makefile
qucs/Makefile
qucs/bitmaps/Makefile
qucs/components/Makefile
qucs/diagrams/Makefile
qucs/paintings/Makefile
qucs/dialogs/Makefile])
AC_OUTPUT
dnl Print results.
AC_MSG_RESULT([])
AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([])
|