Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 7

Qt-interest Archive, July 2007
qmake autotools


Message 1 in thread

using: qt 3.3 kdevelop 3.5

Hi,
I am making an interface for an existing program that uses autotools, so 
it has a configure.ac and a Makefile.am. Instead of using autotools, I 
wanted to use qmake. I tried, but I seem to have problems, is there any 
easy way to do that? or is it possible to use autotools. Is there 
anything simpler?
Thanks,
Marie



---------
this is what my configure.ac for the part that does not use qt looks like


AC_PREREQ(2.59)
AC_INIT(smech, 1.0, BUG-REPORT-ADDRESS)
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([src/alf_gmp.c])
AM_CONFIG_HEADER([config.h])


# Checks for programs.
AC_PROG_INSTALL


# Checks for libraries.
AC_PATH_PROG(CC_PATH, $CC, NO_PATH)
if test "$CC_PATH" = NO_PATH; then
 CC="icc"
fi

AC_PATH_PROG(FC_PATH, $F77, NO_PATH)
if test "$FC_PATH" = NO_PATH; then
 F77="ifort"
fi

AC_MSG_RESULT(2. $OSTYPE F77:$F77 CC:$CC)
AC_PROG_F77([$F77])
AC_PROG_CC([$CC])
AC_PROG_CXX([$CC])

############end test###############


# Check system type
case "$OSTYPE" in
#mac configuration
*darwin* | *rhapsody* | *macosx*)
    case  "${F77}" in
      ## Intel compiler
      *ifort*)
          FFLAGS="-c -u -O3 -mp1 -w90 -w95 -cpp $FFLAGS"
         LIBRARIES="-L"`echo $DYLD_LIBRARY_PATH| awk '{ gsub(/:/, " 
-L"); print }'`
          LDFLAGS="-O3 -Kc++ -mp1 -bind_at_load $LDFLAGS $LIBRARIES"
          ;;
      esac
    case  "${CC}" in
      ## Intel compiler
      *icc*)
          CPPFLAGS="-c -O3 -mp1 -Kc++ -Dintel $CFLAGS"
          ;;
      esac
     AC_CHECK_LIB(imf,main,,AC_MSG_ERROR(Cannot find lib imf ))
     AC_CHECK_LIB(irc,main,,AC_MSG_ERROR(Cannot find lib irc ))
     AC_CHECK_LIB(ifcore,main,,AC_MSG_ERROR(Cannot find lib ifcore $LIBS))
     AC_MSG_RESULT(8. icc loop F77:$F77 CC:$CC FFLAGS:$FFLAGS)
;;
#linux configuration
linux*)

    case  "${F77}" in
      ## Intel compiler
      *ifort*)
          LIBRARIES="-L"`echo $DYLD_LIBRARY_PATH| awk '{ gsub(/:/, " 
-L"); print }'`
          LDFLAGS="-C -Kc++ -mp1 $LDFLAGS $LIBRARIES"
          FFLAGS="-c -u -C -mp1 -w90 -w95 -cpp $FFLAGS"
          AC_CHECK_LIB(ifcore,main,,AC_MSG_ERROR(Cannot find lib ifcore 
$LIBS))
          ;;
      *g77*)#if lib not found then stop the configuration
          LIBRARIES="-L"`locate libg2c.a | sed -e "s/libg2c.a//"`
          LDFLAGS="-O $LDFLAGS $LIBRARIES"
          FFLAGS="-c -u -O -x f77-cpp-input $FFLAGS"
          AC_CHECK_LIB([g2c], [main],,AC_MSG_ERROR(Cannot find lib g2c  
in $LIBRARIES))
          AC_CHECK_LIB(stdc++,main,,AC_MSG_ERROR(Cannot find lib stdc++))
          AC_CHECK_LIB(gcc,main,,AC_MSG_ERROR(Cannot find lib gcc))
          AC_CHECK_LIB(c,main,,AC_MSG_ERROR(Cannot find lib c))
          ;;
      esac
    case  "${CC}" in
      ## Intel compiler
      *icc*)
          AC_MSG_RESULT(6. icc loop F77:$F77 CC:$CC)
          CPPFLAGS="-c -C -mp1 -Kc++ -Dintel $CPPFLAGS"
          ;;
      *g++*)
          AC_MSG_RESULT(7. g++ loop F77:$F77 CC:$CC)
          CPPFLAGS="-c -Wall -O $CPPFLAGS"
          ;;
      esac
;;
*)

     AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
;;
esac

#common libraries
AC_CHECK_LIB(gmp,main,,AC_MSG_ERROR(Cannot find lib gmp ))
AC_CHECK_LIB(m, main,,AC_MSG_ERROR(Cannot find lib m ))
AC_CHECK_LIB(GL,main,,AC_MSG_ERROR(Cannot find lib gl ))
AC_CHECK_LIB(GLU,main,,AC_MSG_ERROR(Cannot find lib glu ))

# substitutions
 #  AC_SUBST(ifcore_libraries)
AC_SUBST(LDFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(FFLAGS)


# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([float.h stddef.h stdlib.h string.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_FUNC_OBSTACK
AC_TYPE_SIZE_T

AC_CONFIG_FILES([ Makefile
 src/Makefile
])
#
# # Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_CHECK_FUNCS([floor modf sqrt])


# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT

--
 [ signature omitted ] 

Message 2 in thread

On 30.07.07 16:35:42, Marie-Christine Vallet wrote:
> using: qt 3.3 kdevelop 3.5
> 
> Hi,
> I am making an interface for an existing program that uses autotools, so it has 
> a configure.ac and a Makefile.am. Instead of using autotools, I wanted to use 
> qmake. I tried, but I seem to have problems, is there any easy way to do that? 
> or is it possible to use autotools. Is there anything simpler?

Why do you want to use qmake, if the project already works with
autotools?

> ---------
> this is what my configure.ac for the part that does not use qt looks like

You'd need to convert this into qmake syntax, but I think not much of
this is needed with qmake. Probably only the opengl parts. Note that
depending on the exact meaning of those macro's (I didn't look very
close) it might be nearly impossible to do this with plain qmake.
Autotools are much more complex than qmake.

And no there's no automatic way to do the conversion.

Andreas

-- 
 [ signature omitted ] 

Message 3 in thread

I can see one reason to use qmake, rather than autotools.

Qmake is more readily available on Windows, for those who do cross-platform development.

But within the unix/linux environments, autotools is more powerful, yes.

Cheers
 
--
 [ signature omitted ] 

Message 4 in thread

On 30.07.07 18:07:09, Erik Haugen Bakke wrote:
> I can see one reason to use qmake, rather than autotools.
> 
> Qmake is more readily available on Windows, for those who do cross-platform development.
> 
> But within the unix/linux environments, autotools is more powerful, yes.

There's as well a solution for that problem, i.e. a powerful but
portable buildsystem: CMake.

Andreas

-- 
 [ signature omitted ]