IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9800


Ignore:
Timestamp:
Oct 30, 2006, 5:42:14 PM (20 years ago)
Author:
jhoblitt
Message:

first pass attempt to made the library probes use values from the environment (instead of ignoring them) yet prevent them from modifying them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r9638 r9800  
    115115dnl ----------------- MYSQL options --------------------
    116116
    117 dnl MYSQL_LDFLAGS="-L${libdir}/mysql"
    118 dnl MYSQL_CFLAGS="-I${includedir}/mysql"
     117dnl save LIBS/CFLAGS/LDFLAGS
     118TMP_LIBS=${LIBS}
     119TMP_CFLAGS=${CFLAGS}
     120TMP_LDFLAGS=${LDFLAGS}
     121TMP_CPPFLAGS=${CPPFLAGS}
     122
    119123AC_ARG_ENABLE(mysql,
    120124 [AS_HELP_STRING(--disable-mysql,Disable MySQL functionality)],
     
    144148
    145149dnl AC_RUN_IFELSE() uses CFLAGS to find mysql_version.h
    146   TMP_CFLAGS=${CFLAGS}
    147   CFLAGS=${MYSQL_CFLAGS}
     150  CFLAGS="${CFLAGS} ${MYSQL_CFLAGS}"
    148151  AC_RUN_IFELSE([AC_LANG_PROGRAM(
    149152[[#include <stdlib.h>
     
    157160    }
    158161]])], [], [AC_MSG_ERROR([MySQL 4.1.2 or newer is required.  Obtain it at  http://www.mysql.com or use --with-mysql to specify location.])])
    159   CFLAGS=${TMP_CFLAGS}
    160162else
    161   dnl FIXME
    162   CFLAGS="${CFLAGS=} -DOMIT_PSDB"
    163163  PSLIB_CFLAGS="${PSLIB_CFLAGS=} -DOMIT_PSDB"
    164164  AC_MSG_RESULT([disable building MySQL functionality])
     
    167167AC_SUBST([MYSQL_CFLAGS])
    168168
     169dnl restore the CFLAGS/LDFLAGS
     170LIBS=${TMP_LIBS}
     171CFLAGS=${TMP_CFLAGS}
     172LDFLAGS=${TMP_LDFLAGS}
     173CPPFLAGS=${TMP_CPPFLAGS}
     174
    169175dnl ----------------- CFITSIO options --------------------
     176
     177dnl save LIBS/CFLAGS/LDFLAGS
     178TMP_LIBS=${LIBS}
     179TMP_CFLAGS=${CFLAGS}
     180TMP_LDFLAGS=${LDFLAGS}
     181TMP_CPPFLAGS=${CPPFLAGS}
     182
    170183AC_ARG_WITH(cfitsio,
    171184[AS_HELP_STRING(--with-cfitsio=DIR,Specify location of CFITSIO.)],
     
    181194PSLIB_LIBS="${PSLIB_LIBS=} $CFITSIO_LDFLAGS -lcfitsio -lm"
    182195
    183 dnl Store off CFLAGS/LDFLAGS so that they can be restored after tests
    184 TMP_CFLAGS=${CPPFLAGS}
    185 TMP_CFLAGS=${CFLAGS}
    186 TMP_LDFLAGS=${LDFLAGS}
    187 
    188 CPPFLAGS=${PSLIB_CFLAGS}
    189 CFLAGS=${PSLIB_CFLAGS}
    190 LDFLAGS=${PSLIB_LIBS}
     196CFLAGS=${CFLAGS} ${CFITSIO_CFLAGS}
     197LDFLAGS=${LDFLAGS} ${CFITSIO_LDFLAGS}
     198
    191199AC_CHECK_HEADERS([fitsio.h],[],
    192200   [AC_MSG_ERROR([CFITSIO headers not found.  Obtain CFITSIO at  http://heasarc.gsfc.nasa.gov/docs/software/fitsio or use --with-cfitsio to specify location.])]
     
    202210   CFITSIO_DISKFILE=0],[-lm]
    203211)
    204 LIBS=${TMP_LIBS}
    205 
    206 dnl restore the CFLAGS/LDFLAGS
    207 CPPFLAGS=${TMP_CPPFLAGS}
    208 CFLAGS=${TMP_CFLAGS}
    209 LDFLAGS=${TMP_LDFLAGS}
    210212
    211213AC_DEFINE_UNQUOTED([CFITSIO_DISKFILE],${CFITSIO_DISKFILE},[Define to 1 if you have fits_open_diskfile in CFITSIO])
    212214AC_SUBST([CFITSIO_CFLAGS])
    213215
     216dnl restore the LIBS/CFLAGS/LDFLAGS
     217LIBS=${TMP_LIBS}
     218CFLAGS=${TMP_CFLAGS}
     219LDFLAGS=${TMP_LDFLAGS}
     220CPPFLAGS=${TMP_CPPFLAGS}
     221
    214222dnl ------------------ FFTW3 options ---------------------
     223
     224dnl save LIBS/CFLAGS/LDFLAGS
     225TMP_LIBS=${LIBS}
     226TMP_CFLAGS=${CFLAGS}
     227TMP_LDFLAGS=${LDFLAGS}
     228TMP_CPPFLAGS=${CPPFLAGS}
     229
    215230AC_ARG_WITH(fftw3,
    216231[AS_HELP_STRING(--with-fftw3=DIR,Specify location of FFTW version 3.)],
     
    226241PSLIB_LIBS="${PSLIB_LIBS=} $FFTW3_LDFLAGS -lfftw3f"
    227242
    228 dnl Store off CPPFLAGS/CFLAGS/LDFLAGS so that they can be restored after tests
    229 TMP_CPPFLAGS=${CPPFLAGS}
    230 TMP_CFLAGS=${CFLAGS}
    231 TMP_LDFLAGS=${LDFLAGS}
    232 
    233 CFLAGS="${TMP_CFLAGS} ${PSLIB_CFLAGS}"
    234 CPPFLAGS="$CFLAGS"
    235 LDFLAGS="${TMP_LDFLAGS} ${PSLIB_LIBS}"
     243CFLAGS="${CFLAGS} ${FFTW3_CFLAGS}"
     244CPPFLAGS=${CFLAGS}
     245LDFLAGS="${LDFLAGS} ${FFTW3_LIBS}"
     246
    236247AC_CHECK_HEADERS([fftw3.h],[],
    237248  [AC_MSG_ERROR([FFTW version 3 (--enable-float) headers not found.  Obtain it at http://www.fftw.org/ or use --with-fftw3 to specify location.])]
     
    240251  [AC_MSG_ERROR([FFTW version 3 (--enable-float) library not found.  Obtain it at http://www.fftw.org/ or use --with-fftw3 to specify location.])],[-lm]
    241252)
    242 LIBS=${TMP_LIBS}
    243 
    244 dnl restore the CFLAGS/LDFLAGS
    245 CPPFLAGS=${TMP_CPPFLAGS}
    246 CFLAGS=${TMP_CFLAGS}
    247 LDFLAGS=${TMP_LDFLAGS}
    248253
    249254AC_SUBST([FFTW3_CFLAGS])
    250255
     256dnl restore the CFLAGS/LDFLAGS
     257LIBS=${TMP_LIBS}
     258CFLAGS=${TMP_CFLAGS}
     259LDFLAGS=${TMP_LDFLAGS}
     260CPPFLAGS=${TMP_CPPFLAGS}
     261
    251262dnl -------------------- GSL options ---------------------
     263
     264dnl save LIBS/CFLAGS/LDFLAGS
     265TMP_LIBS=${LIBS}
     266TMP_CFLAGS=${CFLAGS}
     267TMP_LDFLAGS=${LDFLAGS}
     268TMP_CPPFLAGS=${CPPFLAGS}
     269
    252270AC_ARG_WITH(gsl-config,
    253271[AS_HELP_STRING(--with-gsl-config=FILE,Specify location of gsl-config.)],
     
    270288AC_SUBST([GSL_CFLAGS])
    271289
     290dnl restore the CFLAGS/LDFLAGS
     291LIBS=${TMP_LIBS}
     292CFLAGS=${TMP_CFLAGS}
     293LDFLAGS=${TMP_LDFLAGS}
     294CPPFLAGS=${TMP_CPPFLAGS}
     295
    272296dnl ------------------ libjpeg options ---------------------
     297
     298dnl save LIBS/CFLAGS/LDFLAGS
     299TMP_LIBS=${LIBS}
     300TMP_CFLAGS=${CFLAGS}
     301TMP_LDFLAGS=${LDFLAGS}
     302TMP_CPPFLAGS=${CPPFLAGS}
    273303
    274304AC_ARG_WITH(jpeg,
     
    283313[JPEG_LDFLAGS="-L$withval"])
    284314
    285 dnl Store off CPPFLAGS/CFLAGS/LDFLAGS so that they can be restored after tests
    286 TMP_CPPFLAGS=${CPPFLAGS}
    287 TMP_CFLAGS=${CFLAGS}
    288 TMP_LDFLAGS=${LDFLAGS}
    289 
    290 CFLAGS="${TMP_CFLAGS} ${JPEG_CFLAGS}"
    291 CPPFLAGS="$CFLAGS"
    292 LDFLAGS="${TMP_LDFLAGS} ${JPEG_LDFLAGS}"
     315CFLAGS="${CFLAGS} ${JPEG_CFLAGS}"
     316CPPFLAGS=${CFLAGS}
     317LDFLAGS="${LDFLAGS} ${JPEG_LDFLAGS}"
    293318
    294319AC_CHECK_HEADERS([jpeglib.h],[PSLIB_CFLAGS="$PSLIB_CFLAGS $JPEG_CFLAGS"
     
    301326)
    302327
    303 dnl restore the CFLAGS/LDFLAGS in case we decide to make missing libjpeg only a warning
    304 CPPFLAGS=${TMP_CPPFLAGS}
    305 CFLAGS=${TMP_CFLAGS}
    306 LDFLAGS=${TMP_LDFLAGS}
     328dnl restore the CFLAGS/LDFLAGS
     329LIBS=${TMP_LIBS}
     330CFLAGS=${TMP_CFLAGS}
     331LDFLAGS=${TMP_LDFLAGS}
     332CPPFLAGS=${TMP_CPPFLAGS}
    307333
    308334dnl ------------------- XML2 options ---------------------
     
    340366
    341367dnl ------------------- SWIG options ---------------------
     368
     369dnl save LIBS/CFLAGS/LDFLAGS
     370TMP_LIBS=${LIBS}
     371TMP_CFLAGS=${CFLAGS}
     372TMP_LDFLAGS=${LDFLAGS}
     373TMP_CPPFLAGS=${CPPFLAGS}
     374
    342375AC_ARG_ENABLE(perlmodule,
    343376 [AS_HELP_STRING(--enable-perlmodule,Enables creation of perl module)],
     
    358391  SUBDIR="${SUBDIR=} swig"
    359392
     393dnl restore the CFLAGS/LDFLAGS
     394LIBS=${TMP_LIBS}
     395CFLAGS=${TMP_CFLAGS}
     396LDFLAGS=${TMP_LDFLAGS}
     397CPPFLAGS=${TMP_CPPFLAGS}
     398
    360399dnl ---------------- PERLPREFIX option -------------------
     400
     401dnl save LIBS/CFLAGS/LDFLAGS
     402TMP_LIBS=${LIBS}
     403TMP_CFLAGS=${CFLAGS}
     404TMP_LDFLAGS=${LDFLAGS}
     405TMP_CPPFLAGS=${CPPFLAGS}
     406
    361407  AC_ARG_WITH(perlprefix,
    362408    [AS_HELP_STRING(--with-perlprefix=DIR,Specify prefix of Perl Module's installation. (default=PREFIX))],
     
    370416fi
    371417
     418dnl restore the CFLAGS/LDFLAGS
     419LIBS=${TMP_LIBS}
     420CFLAGS=${TMP_CFLAGS}
     421LDFLAGS=${TMP_LDFLAGS}
     422CPPFLAGS=${TMP_CPPFLAGS}
     423
    372424dnl for MacOSX suppport -- check if sqrtf is in mx library.
    373 TMP_LIBS=${LIBS}
     425
     426dnl save LIBS/CFLAGS/LDFLAGS
     427TMP_LIBS=${LIBS}
     428TMP_CFLAGS=${CFLAGS}
     429TMP_LDFLAGS=${LDFLAGS}
     430TMP_CPPFLAGS=${CPPFLAGS}
     431
    374432AC_CHECK_LIB(mx,sqrtf,
    375433  [PSLIB_LIBS="${PSLIB_LIBS=} -lmx"])
     
    378436  [AC_MSG_ERROR([The C99 function, atoll, is required; update your compiler version?])])
    379437
     438dnl restore the CFLAGS/LDFLAGS
     439LIBS=${TMP_LIBS}
     440CFLAGS=${TMP_CFLAGS}
     441LDFLAGS=${TMP_LDFLAGS}
     442CPPFLAGS=${TMP_CPPFLAGS}
    380443
    381444dnl doxygen doc generation is very, very slow so we're turing it off by default
     445
     446dnl save LIBS/CFLAGS/LDFLAGS
     447TMP_LIBS=${LIBS}
     448TMP_CFLAGS=${CFLAGS}
     449TMP_LDFLAGS=${LDFLAGS}
     450TMP_CPPFLAGS=${CPPFLAGS}
     451
    382452AC_ARG_ENABLE(doxygen,
    383453  [AS_HELP_STRING(--enable-doxygen ,enable manpage generation)],
     
    391461AM_CONDITIONAL([HAVE_DOXYGEN], test -n "$DOXYGEN" -a "x$doxygen" != "xoff")
    392462
    393 
    394 dnl ------- restore CFLAGS / LDFLAGS (tests done) --------
     463dnl restore the CFLAGS/LDFLAGS
     464LIBS=${TMP_LIBS}
     465CFLAGS=${TMP_CFLAGS}
     466LDFLAGS=${TMP_LDFLAGS}
     467CPPFLAGS=${TMP_CPPFLAGS}
     468
     469dnl ------- enable -Werror after all of the probes have run ---------
    395470CFLAGS="${CFLAGS} -Wall -Werror"
    396471
Note: See TracChangeset for help on using the changeset viewer.