~ubuntu-branches/debian/sid/unixodbc-gui-qt/sid

« back to all changes in this revision

Viewing changes to qt.m4

  • Committer: Package Import Robot
  • Author(s): Steve Langasek, Steve Langasek, Colin Watson
  • Date: 2011-11-18 14:38:30 UTC
  • Revision ID: package-import@ubuntu.com-20111118143830-sxnbtccvosb25x1k
Tags: 2.3.0-2
[ Steve Langasek ]
* Update debian/copyright with current information for the new source.
* Fix Vcs-* fields for new source package name

[ Colin Watson ]
* Fix build failure with multiarch Qt: test whether the Qt libraries are
  on the default linker path, and if so don't bother trying /usr/lib64 and
  /usr/lib.  Closes: #649166.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
  # No lib location given? Lets check a few known places.
57
57
  #
58
58
  if test "x$qt_dir_lib" = x; then
59
 
    if test -e "/usr/lib64/libQtCore.so"; then
60
 
      qt_dir_lib="/usr/lib64"
61
 
    elif test -e "/usr/lib/libQtCore.so"; then 
62
 
      qt_dir_lib="/usr/lib"
63
 
    fi
 
59
    qt_dir_lib=default
 
60
    FUN_QT_COMPILE([], [
 
61
      if test -e "/usr/lib64/libQtCore.so"; then
 
62
        qt_dir_lib="/usr/lib64"
 
63
      elif test -e "/usr/lib/libQtCore.so"; then 
 
64
        qt_dir_lib="/usr/lib"
 
65
      else
 
66
        qt_dir_lib=""
 
67
      fi
 
68
    ])
64
69
  fi
 
70
  CXXFLAGS="$ac_cxxflags_save"
 
71
  LIBS="$ac_libs_save"
65
72
 
66
73
  #
67
74
  # No bin location given? Lets check a few known places.
110
117
  MOC="$qt_dir_bin"/moc
111
118
  UIC="$qt_dir_bin"/uic
112
119
 
113
 
  FUN_QT_COMPILE
 
120
  AC_MSG_NOTICE([qt_dir_lib=$qt_dir_lib])
 
121
  AC_MSG_NOTICE([LDFLAGS=$LDFLAGS])
 
122
  AC_MSG_NOTICE([X_LIBS=$X_LIBS])
 
123
 
 
124
  AC_MSG_CHECKING([whether a simple Qt program compiles])
 
125
  FUN_QT_COMPILE([AC_MSG_RESULT([yes])], [
 
126
    AC_MSG_RESULT([no])
 
127
    AC_MSG_ERROR([cannot compile a Qt program!])
 
128
  ])
114
129
 
115
130
  AC_SUBST(MOC)
116
131
  AC_SUBST(UIC)
117
132
  QT_CXXFLAGS="-I$qt_dir_include -I$qt_dir_include/QtCore -I$qt_dir_include/QtGui -I$qt_dir_include/QtAssistant -I$qt_dir_include/QtNetwork"
118
133
  AC_SUBST(QT_CXXFLAGS)
119
 
  QT_LDFLAGS="-L$qt_dir_lib"
 
134
  if test "x$qt_dir_lib" = xdefault; then
 
135
    QT_LDFLAGS=""
 
136
  else
 
137
    QT_LDFLAGS="-L$qt_dir_lib"
 
138
  fi
120
139
  AC_SUBST(QT_LDFLAGS)
121
140
  QT_LIBS="$qt_libs"
122
141
  AC_SUBST(QT_LIBS)
134
153
 
135
154
  AC_LANG_PUSH(C++)
136
155
 
137
 
  AC_MSG_NOTICE([qt_dir_lib=$qt_dir_lib])
138
 
  AC_MSG_NOTICE([LDFLAGS=$LDFLAGS])
139
 
  AC_MSG_NOTICE([X_LIBS=$X_LIBS])
140
 
 
141
 
  AC_MSG_CHECKING([whether a simple Qt program compiles])
142
 
 
143
156
  ac_cxxflags_save="$CXXFLAGS"
144
157
  ac_ldflags_save="$LDFLAGS"
145
158
  ac_libs_save="$LIBS"
146
159
  CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS -I$qt_dir_include -I$qt_dir_include/QtCore -I$qt_dir_include/QtGui $X_CFLAGS $all_includes"
147
 
  LDFLAGS="$LDFLAGS -L$qt_dir_lib"
 
160
  if test "x$qt_dir_lib" != xdefault; then
 
161
    LDFLAGS="$LDFLAGS -L$qt_dir_lib"
 
162
  fi
148
163
  LIBS="$LIBS $PTHREAD_LIBS $qt_libs"
149
164
 
150
165
  AC_TRY_LINK([
161
176
 
162
177
  AC_LANG_POP(C++)
163
178
 
164
 
  if test "x$qt_compile" = "xyes" ; then
165
 
    AC_MSG_RESULT([yes])
166
 
  else
167
 
    AC_MSG_RESULT([no])
168
 
    AC_MSG_ERROR([cannot compile a Qt program!])
169
 
  fi
 
179
  AS_IF([test "x$qt_compile" = "xyes"], [$1], [$2])
170
180
])#FUN_QT_COMPILE