Skip to content

Commit

Permalink
- Added compilation check of the sendData dependencies to the configu…
Browse files Browse the repository at this point in the history
…re scripts

- Added support for LDFLAGS="-L/my/path/to/lib/" for LIBSENDDATA_LDFLAGS


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5696 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jun 21, 2010
1 parent 1986af6 commit 2c38446
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
32 changes: 25 additions & 7 deletions configure
Expand Up @@ -626,8 +626,6 @@ USE_CORBA
LIBLPSOLVE55
LIBNSL
LIBSOCKET
readlinelib
readlineinc
antlrlib
antlrinc
omc_antlr_jar
Expand Down Expand Up @@ -2178,8 +2176,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu








Expand Down Expand Up @@ -4527,7 +4523,7 @@ $as_echo_n "checking for CORBA... " >&6; };
$as_echo "$DESIRED_CORBA" >&6; };


for ac_prog in qmake-qt4 qmake qmake-mac
for ac_prog in qmake-qt4 qmake-mac qmake
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
Expand Down Expand Up @@ -4592,15 +4588,37 @@ if test "${with_sendData_Qt+set}" = set; then :
fi
LIBSENDDATA="sendData"
if test "Darwin" = `uname`; then
LIBSENDDATA_LDFLAGS="-lsendData -framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
LIBSENDDATA_LDFLAGS="-framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
if test -d /opt/local/Library/Frameworks/; then
LIBSENDDATA_LDFLAGS="-F/opt/local/Library/Frameworks/ $LIBSENDDATA_LDFLAGS"
fi
else
LIBSENDDATA_LDFLAGS="-lsendData -lQtNetwork -lQtCore -lQtGui"
LIBSENDDATA_LDFLAGS="-lQtNetwork -lQtCore -lQtGui"
fi

LDFLAGS_BAK=$LDFLAGS
LDFLAGS+=$LIBSENDDATA_LDFLAGS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
else
as_fn_error "Compilation failed using LDFLAGS='$LDFLAGS'. Try specifying your own LDFLAGS to link to Qt." "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$LDFLAGS_BAK
LIBSENDDATA_LDFLAGS="$LDFLAGS -lsendData $LIBSENDDATA_LDFLAGS"

else

Expand Down
13 changes: 9 additions & 4 deletions configure.in
Expand Up @@ -250,7 +250,7 @@ AC_MSG_RESULT([$DESIRED_CORBA]);

dnl Check for Qt

AC_CHECK_PROGS(QMAKE,qmake-qt4 qmake qmake-mac,"")
AC_CHECK_PROGS(QMAKE,qmake-qt4 qmake-mac qmake,"")

if test -n "$QMAKE"; then
AC_MSG_CHECKING([for qmake arguments])
Expand All @@ -268,14 +268,19 @@ AC_ARG_WITH(sendData-Qt, [ --with-sendData-Qt Compile with support for plot
fi
LIBSENDDATA="sendData"
if test "Darwin" = `uname`; then
LIBSENDDATA_LDFLAGS="-lsendData -framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
LIBSENDDATA_LDFLAGS="-framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon"
if test -d /opt/local/Library/Frameworks/; then
LIBSENDDATA_LDFLAGS="-F/opt/local/Library/Frameworks/ $LIBSENDDATA_LDFLAGS"
fi
else
LIBSENDDATA_LDFLAGS="-lsendData -lQtNetwork -lQtCore -lQtGui"
LIBSENDDATA_LDFLAGS="-lQtNetwork -lQtCore -lQtGui"
fi
AC_MSG_RESULT([ok])

LDFLAGS_BAK=$LDFLAGS
LDFLAGS+=$LIBSENDDATA_LDFLAGS
AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([ok]),AC_MSG_ERROR([Compilation failed using LDFLAGS='$LDFLAGS'. Try specifying your own LDFLAGS to link to Qt.]))
LDFLAGS=$LDFLAGS_BAK
LIBSENDDATA_LDFLAGS="$LDFLAGS -lsendData $LIBSENDDATA_LDFLAGS"
],
[
LIBSENDDATA="sendDataHumbug"
Expand Down

0 comments on commit 2c38446

Please sign in to comment.