Skip to content

Commit

Permalink
Some additional useful m4 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed May 2, 2015
1 parent e3db361 commit 7dd9c1a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
46 changes: 25 additions & 21 deletions m4/omhome.m4
@@ -1,5 +1,29 @@
AC_ARG_WITH(openmodelicahome, [ --with-openmodelicahome=[$OPENMODELICAHOME|$prefix] (Find OPENMODELICAHOME - the directory where all OpenModelica dependencies are installed.)],[OMHOME="$withval"],[OMHOME=no])

test "$prefix" = NONE && prefix=$ac_default_prefix

if echo $host | grep -iq darwin; then
APP=".app"
EXE=".app"
SHREXT=".dylib"
RPATH="-Wl,-rpath,'@loader_path/../lib/$host_short/omc/'"
RPATH_QMAKE="-Wl,-rpath,'@loader_path/../../../../lib/$host_short/omc',-rpath,'@loader_path/../../../../lib/',-rpath,'$PREFIX/lib/$host_short/omc',-rpath,'$PREFIX/lib/'"
elif test "$host" = "i586-pc-mingw32msvc"; then
APP=".exe"
EXE=".exe"
# Yes, we build static libs on Windows, so the "shared" extension is .a
SHREXT=".a"
RPATH="-Wl,-z,origin -Wl,-rpath,'\$\$ORIGIN/../lib/$host_short/omc' -Wl,-rpath,'\$\$ORIGIN'"
RPATH_QMAKE="-Wl,-z,origin -Wl,-rpath,\\'\\\$\$ORIGIN/../lib/$host_short/omc\\' -Wl,-rpath,\\'\\\$\$ORIGIN\\'"
else
APP=""
EXE=""
SHREXT=".so"
RPATH="-Wl,-z,origin -Wl,-rpath,'\$\$ORIGIN/../lib/$host_short/omc' -Wl,-rpath,'\$\$ORIGIN'"
RPATH_QMAKE="-Wl,-z,origin -Wl,-rpath,\\'\\\$\$ORIGIN/../lib/$host_short/omc\\' -Wl,-rpath,\\'\\\$\$ORIGIN\\'"
fi

define(FIND_OPENMODELICAHOME, [
AC_MSG_CHECKING([for OPENMODELICAHOME])
if test "$OMHOME" = "no"; then
if test -z "$OPENMODELICAHOME"; then
Expand All @@ -26,27 +50,7 @@ if test -f "$OPENMODELICAHOME/share/omc/omc_communication.idl"; then
else
AC_MSG_ERROR(failed)
fi

if echo $host | grep -iq darwin; then
APP=".app"
EXE=".app"
SHREXT=".dylib"
RPATH="-Wl,-rpath,'@loader_path/../lib/$host_short/omc/'"
RPATH_QMAKE="-Wl,-rpath,'@loader_path/../../../../lib/$host_short/omc',-rpath,'@loader_path/../../../../lib/',-rpath,'$PREFIX/lib/$host_short/omc',-rpath,'$PREFIX/lib/'"
elif test "$host" = "i586-pc-mingw32msvc"; then
APP=".exe"
EXE=".exe"
# Yes, we build static libs on Windows, so the "shared" extension is .a
SHREXT=".a"
RPATH="-Wl,-z,origin -Wl,-rpath,'\$\$ORIGIN/../lib/$host_short/omc' -Wl,-rpath,'\$\$ORIGIN'"
RPATH_QMAKE="-Wl,-z,origin -Wl,-rpath,\\'\\\$\$ORIGIN/../lib/$host_short/omc\\' -Wl,-rpath,\\'\\\$\$ORIGIN\\'"
else
APP=""
EXE=""
SHREXT=".so"
RPATH="-Wl,-z,origin -Wl,-rpath,'\$\$ORIGIN/../lib/$host_short/omc' -Wl,-rpath,'\$\$ORIGIN'"
RPATH_QMAKE="-Wl,-z,origin -Wl,-rpath,\\'\\\$\$ORIGIN/../lib/$host_short/omc\\' -Wl,-rpath,\\'\\\$\$ORIGIN\\'"
fi
])

define(FIND_LIBOPENMODELICACOMPILER, [
AC_LANG_PUSH([C])
Expand Down
2 changes: 2 additions & 0 deletions m4/qmake.m4
@@ -1,5 +1,7 @@
dnl Check for Qt

AC_SUBST(QMAKE)

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

Expand Down

0 comments on commit 7dd9c1a

Please sign in to comment.