Revise configure script and makeinclude file to use OPTIM variable,

and to provide new "--with-optim=flags" option.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1929 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2002-01-13 19:17:36 +00:00
parent a33a9e34d4
commit 7a82535b93
3 changed files with 78 additions and 37 deletions
+6
View File
@@ -1,5 +1,11 @@
CHANGES IN FLTK 1.1.0b11 CHANGES IN FLTK 1.1.0b11
- Updated the test makefile to work with more versions
of "make".
- Added new "--with-optim" configure option to set the
optimization flags to use when compiling FLTK.
- The fltk-config script no longer reports the
optimization flags that were used to compile FLTK.
- Initial port of FLTK 2.0 drag-and-drop support. - Initial port of FLTK 2.0 drag-and-drop support.
+67 -33
View File
@@ -1,7 +1,7 @@
dnl -*- sh -*- dnl -*- sh -*-
dnl the "configure" script is made from this by running GNU "autoconf" dnl the "configure" script is made from this by running GNU "autoconf"
dnl dnl
dnl "$Id: configure.in,v 1.33.2.31.2.48 2002/01/11 21:42:04 easysw Exp $" dnl "$Id: configure.in,v 1.33.2.31.2.49 2002/01/13 19:17:36 easysw Exp $"
dnl dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK). dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl dnl
@@ -55,6 +55,9 @@ dnl Don't automatically add "-g" to compiler options...
CFLAGS="${CFLAGS:=}" CFLAGS="${CFLAGS:=}"
CPPFLAGS="${CPPFLAGS:=}" CPPFLAGS="${CPPFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}" CXXFLAGS="${CXXFLAGS:=}"
OPTIM="${OPTIM:=}"
AC_SUBST(OPTIM)
dnl Handle Cygwin option *first*, before all other tests. dnl Handle Cygwin option *first*, before all other tests.
case $uname in case $uname in
@@ -165,7 +168,9 @@ AC_SUBST(DSOLINK)
AC_SUBST(DSONAME) AC_SUBST(DSONAME)
AC_SUBST(GLDSONAME) AC_SUBST(GLDSONAME)
AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support]) AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])
AC_ARG_WITH(optim, [ --with-optim=\"flags\" use custom optimization flags])
dnl Find commands... dnl Find commands...
AC_PROG_CC AC_PROG_CC
@@ -308,9 +313,8 @@ THREADS=
case $uname in case $uname in
CYGWIN*) CYGWIN*)
dnl Cygwin environment... dnl Cygwin environment...
LIBS="$LIBS -mwindows -lcomctl32 -lwsock32" LIBS="$LIBS -lcomctl32 -lwsock32"
CFLAGS="$CFLAGS -mwindows -DWIN32" OPTIM="$OPTIM -mwindows -DWIN32"
CXXFLAGS="$CXXFLAGS -mwindows -DWIN32"
if test x$enable_gl != xno; then if test x$enable_gl != xno; then
AC_CHECK_HEADER(GL/gl.h, AC_CHECK_HEADER(GL/gl.h,
@@ -423,12 +427,17 @@ case $uname in
fi) fi)
dnl Check for overlay visuals... dnl Check for overlay visuals...
AC_CACHE_CHECK("for X overlay visuals", ac_cv_have_overlay, AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay,
if xprop -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then if xprop -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then
ac_cv_have_overlay=yes ac_cv_have_overlay=yes
else else
ac_cv_have_overlay=no ac_cv_have_overlay=no
fi) fi)
if test x$ac_cv_have_overlay = xyes; then
AC_DEFINE(HAVE_OVERLAY)
fi
;;
esac esac
AC_SUBST(GLDEMOS) AC_SUBST(GLDEMOS)
@@ -520,8 +529,10 @@ if test -n "$GXX"; then
CXX="$CC" CXX="$CC"
CFLAGS="-Wall $CFLAGS" # Show all warnings when compiling...
CXXFLAGS="-Wall $CXXFLAGS" OPTIM="-Wall $OPTIM"
# Set the default compiler optimizations...
if test -z "$DEBUGFLAG"; then if test -z "$DEBUGFLAG"; then
# #
# Note: Can't use -fomit-frame-pointer - prevents tools like # Note: Can't use -fomit-frame-pointer - prevents tools like
@@ -536,12 +547,17 @@ if test -n "$GXX"; then
# difference in the speed of the code, but does bloat the # difference in the speed of the code, but does bloat the
# library 10+%. # library 10+%.
# #
CFLAGS="-O2 $CFLAGS"
CXXFLAGS="-O2 $CXXFLAGS" if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
fi
fi fi
# Generate position-independent code when needed...
if test $PICFLAG = 1; then if test $PICFLAG = 1; then
CFLAGS="-fPIC $CFLAGS" OPTIM="$OPTIM -fPIC"
CXXFLAGS="-fPIC $CXXFLAGS"
fi fi
# See if GCC supports -fno-exceptions... # See if GCC supports -fno-exceptions...
@@ -549,13 +565,18 @@ if test -n "$GXX"; then
OLDCFLAGS="$CFLAGS" OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-exceptions" CFLAGS="$CFLAGS -fno-exceptions"
AC_TRY_COMPILE(,, AC_TRY_COMPILE(,,
CXXFLAGS="$CXXFLAGS -fno-exceptions" OPTIM="$OPTIM -fno-exceptions"
AC_MSG_RESULT(yes), AC_MSG_RESULT(yes),
CFLAGS="$OLDCFLAGS"
AC_MSG_RESULT(no)) AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS" CFLAGS="$OLDCFLAGS"
# See if we are running Solaris; if so, try the -fpermissive option... # See if we are running Solaris; if so, try the -fpermissive option...
# This option is required on some versions of Solaris to work around
# bugs in the X headers up through Solaris 7.
#
# Unlike the other compiler/optimization settings, this one is placed
# in CFLAGS and CXXFLAGS so that fltk-config will provide the option
# to clients - otherwise client apps will not compile properly...
if test "$uname" = SunOS; then if test "$uname" = SunOS; then
AC_MSG_CHECKING(if GCC supports -fpermissive) AC_MSG_CHECKING(if GCC supports -fpermissive)
@@ -585,41 +606,55 @@ else
AC_MSG_WARN(FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI \"-n32 -mips3\") AC_MSG_WARN(FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI \"-n32 -mips3\")
fi fi
CFLAGS="-fullwarn $CFLAGS" OPTIM="-fullwarn $OPTIM"
CXXFLAGS="-fullwarn $CXXFLAGS"
else
CXXFLAGS="+w +pp $CXXFLAGS"
fi fi
if test -z "$DEBUGFLAG"; then if test -z "$DEBUGFLAG"; then
CFLAGS="-O2 $CFLAGS" if test "x$with_optim" != x; then
CXXFLAGS="-O2 $CXXFLAGS" OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
fi
fi fi
;; ;;
HP-UX*) HP-UX*)
# Running HP-UX; these options should work for the HP compilers. # Running HP-UX; these options should work for the HP compilers.
if test -z "$DEBUGFLAG"; then if test -z "$DEBUGFLAG"; then
CFLAGS="+O2 $CFLAGS" if test "x$with_optim" != x; then
CXXFLAGS="+O2 +W336,501,736,740,749,829 $CXXFLAGS" OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
fi
fi fi
CFLAGS="+DAportable $CFLAGS"
CXXFLAGS="+DAportable $CXXFLAGS" if test "x$with_optim" != x; then
OPTIM="$OPTIM +DAportable"
fi
OPTIM="$OPTIM +W336,501,736,740,749,829"
;; ;;
SunOS*) SunOS*)
# Solaris # Solaris
if test -z "$DEBUGFLAG"; then if test -z "$DEBUGFLAG"; then
CFLAGS="-xO3" if test "x$with_optim" != x; then
CXXFLAGS="-xO3" OPTIM="$with_optim $OPTIM"
else
OPTIM="-xO3 $OPTIM"
fi
fi fi
if test $PICFLAG = 1; then if test $PICFLAG = 1; then
CFLAGS="-KPIC $CFLAGS" OPTIM="-KPIC $OPTIM"
CXXFLAGS="-PIC $CXXFLAGS"
fi fi
;; ;;
AIX*) AIX*)
if test -z "$DEBUGFLAG"; then if test -z "$DEBUGFLAG"; then
CFLAGS="-O2 $CFLAGS" if test "x$with_optim" != x; then
CXXFLAGS="-O2 $CXXFLAGS" OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
fi
fi fi
AC_MSG_WARN(The AIX C and C++ compilers are known not to correctly compile the FLTK library.) AC_MSG_WARN(The AIX C and C++ compilers are known not to correctly compile the FLTK library.)
;; ;;
*) *)
@@ -631,8 +666,7 @@ else
esac esac
fi fi
CFLAGS="$DEBUGFLAG $CFLAGS" OPTIM="$DEBUGFLAG $OPTIM"
CXXFLAGS="$DEBUGFLAG $CXXFLAGS"
dnl Define the FLTK documentation directory... dnl Define the FLTK documentation directory...
if test x$prefix = xNONE; then if test x$prefix = xNONE; then
@@ -649,5 +683,5 @@ dnl Make sure the fltk-config script is executable...
chmod +x fltk-config chmod +x fltk-config
dnl dnl
dnl End of "$Id: configure.in,v 1.33.2.31.2.48 2002/01/11 21:42:04 easysw Exp $". dnl End of "$Id: configure.in,v 1.33.2.31.2.49 2002/01/13 19:17:36 easysw Exp $".
dnl dnl
+5 -4
View File
@@ -1,5 +1,5 @@
# #
# "$Id: makeinclude.in,v 1.7.2.11.2.14 2002/01/01 15:11:27 easysw Exp $" # "$Id: makeinclude.in,v 1.7.2.11.2.15 2002/01/13 19:17:36 easysw Exp $"
# #
# Make include file for the Fast Light Tool Kit (FLTK). # Make include file for the Fast Light Tool Kit (FLTK).
# @configure_input@ # @configure_input@
@@ -45,8 +45,9 @@ CC =@CC@
MAKEDEPEND =@MAKEDEPEND@ MAKEDEPEND =@MAKEDEPEND@
# flags for C++ compiler: # flags for C++ compiler:
CFLAGS =@CPPFLAGS@ @CFLAGS@ OPTIM =@OPTIM@
CXXFLAGS =@CPPFLAGS@ @CXXFLAGS@ CFLAGS =$(OPTIM) @CFLAGS@
CXXFLAGS =$(OPTIM) @CXXFLAGS@
# program to make the archive: # program to make the archive:
LIBNAME =@LIBNAME@ LIBNAME =@LIBNAME@
@@ -112,5 +113,5 @@ CAT3EXT =@CAT3EXT@
mv t.z $@ mv t.z $@
# #
# End of "$Id: makeinclude.in,v 1.7.2.11.2.14 2002/01/01 15:11:27 easysw Exp $". # End of "$Id: makeinclude.in,v 1.7.2.11.2.15 2002/01/13 19:17:36 easysw Exp $".
# #