From 3998160a07b7885b0650699113f5cd7bde1e3a0c Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 5 Oct 2003 06:47:44 +0000 Subject: [PATCH] r7941: add test for getenv --- Makefile.in | 4 +-- config.h.in | 18 ++++++++++++ configure | 73 +++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- tools/Makefile.in | 2 +- 5 files changed, 95 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index be18d3c..c6a9269 100644 --- a/Makefile.in +++ b/Makefile.in @@ -162,12 +162,12 @@ wxconfig = @wxconfig@ wxlibs = @wxlibs@ @INCLUDED_GETOPT_LONG_FALSE@EXTRA_DIRS1 = @INCLUDED_GETOPT_LONG_TRUE@EXTRA_DIRS1 = getopt -@HAVE_SGP_FALSE@EXTRA_DIRS2 = @HAVE_SGP_TRUE@EXTRA_DIRS2 = libctgraphics -@HAVE_WXWINDOWS_FALSE@EXTRA_DIRS3 = +@HAVE_SGP_FALSE@EXTRA_DIRS2 = @HAVE_WXWINDOWS_TRUE@EXTRA_DIRS3 = src +@HAVE_WXWINDOWS_FALSE@EXTRA_DIRS3 = SUBDIRS = man libctsupport libctsim html cgi-bin include $(EXTRA_DIRS1) $(EXTRA_DIRS2) $(EXTRA_DIRS3) tools helical diff --git a/config.h.in b/config.h.in index 2b395ab..8d7ac6b 100644 --- a/config.h.in +++ b/config.h.in @@ -6,6 +6,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H +/* Define to 1 if you have the `basename' function. */ +#undef HAVE_BASENAME + /* ctn dicom library */ #undef HAVE_CTN_DICOM @@ -27,12 +30,18 @@ /* FFTW library */ #undef HAVE_FFTW +/* Define to 1 if you have the `getenv' function. */ +#undef HAVE_GETENV + /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* getopt_long library */ #undef HAVE_GETOPT_LONG +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + /* Define to 1 if you have the `htonl' function. */ #undef HAVE_HTONL @@ -63,9 +72,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H +/* Define to 1 if you have the `setjmp' function. */ +#undef HAVE_SETJMP + /* Define to 1 if you have the header file. */ #undef HAVE_SETJMP_H +/* Define to 1 if you have the `setpriority' function. */ +#undef HAVE_SETPRIORITY + /* use sgp library */ #undef HAVE_SGP @@ -120,6 +135,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the `time' function. */ +#undef HAVE_TIME + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H diff --git a/configure b/configure index 0a32152..3668003 100755 --- a/configure +++ b/configure @@ -7979,6 +7979,79 @@ else getopt=false fi +echo "$as_me:$LINENO: checking for getenv" >&5 +echo $ECHO_N "checking for getenv... $ECHO_C" >&6 +if test "${ac_cv_func_getenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getenv (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getenv (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_getenv) || defined (__stub___getenv) +choke me +#else +char (*f) () = getenv; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != getenv; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_getenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_getenv=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_getenv" >&5 +echo "${ECHO_T}$ac_cv_func_getenv" >&6 + if test "${OSTYPE}" = "cygwin" ; then getopt_long=false diff --git a/configure.ac b/configure.ac index 2ce392d..299bfe0 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,7 @@ AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_VPRINTF -AC_CHECK_FUNCS(strtod strtol snprintf htonl usleep vsprintf vsnprintf) +AC_CHECK_FUNCS(strtod strtol snprintf htonl usleep vsprintf vsnprintf basename setjmp setpriority time gettimeofday getenv) AC_CHECK_FUNC(basename) AC_CHECK_FUNC(setjmp) AC_CHECK_FUNC(setpriority) diff --git a/tools/Makefile.in b/tools/Makefile.in index fd1f0d6..3c6a568 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -163,9 +163,9 @@ wxlibs = @wxlibs@ bin_PROGRAMS = @lamprograms@ ctsimtext EXTRA_PROGRAMS = ctsimtext-lam INCLUDES = @my_includes@ -@HAVE_SGP_FALSE@SOURCE_DEPEND = ../include/ct.h ../libctsim/libctsim.a ../libctsupport/libctsupport.a @HAVE_SGP_TRUE@SOURCE_DEPEND = ../include/ct.h ../libctsim/libctsim.a ../libctsupport/libctsupport.a ../libctgraphics/libctgraphics.a +@HAVE_SGP_FALSE@SOURCE_DEPEND = ../include/ct.h ../libctsim/libctsim.a ../libctsupport/libctsupport.a ctsimtext_SOURCES = ctsimtext.cpp if1.cpp if2.cpp ifinfo.cpp ifexport.cpp phm2if.cpp phm2pj.cpp pj2if.cpp pjinfo.cpp pjrec.cpp nographics.cpp phm2helix.cpp pjHinterp.cpp linogram.cpp ctsimtext_LDADD = @ctlibs@ -- 2.34.1