Skip to content

Commit

Permalink
Configuration fixes:
Browse files Browse the repository at this point in the history
kinder, gentler config.h

Remove obsolete tests while we're at it.
  • Loading branch information
Edward Rosten committed Jun 30, 2017
1 parent a0439a4 commit 1ae6120
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 288 deletions.
160 changes: 4 additions & 156 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ have_png
have_libuvc
have_lapack
have_toon
have_shared_ptr
have_videodisplay
XMKMF
have_qtbuffer
Expand Down Expand Up @@ -4469,7 +4468,6 @@ minor=$cvd_minor




################################################################################
#
#Lists of optional components
Expand Down Expand Up @@ -6796,80 +6794,6 @@ fi



if test "$with_shared_ptr" != no && test "$have_shared_ptr" != yes
then
if test "$with_shared_ptr" == ""
then
with_shared_ptr=yes
fi

save_LIBS="$LIBS"
save_CXXFLAGS="$CXXFLAGS"
a=

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared_ptr" >&5
$as_echo_n "checking for shared_ptr... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <memory>
int main(){std::shared_ptr<int> i; return 0;}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }; a=1
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test x$a == x1
then
a=0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tr1::shared_ptr" >&5
$as_echo_n "checking for tr1::shared_ptr... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <tr1/memory>
int main(){std::tr1::shared_ptr<int> i; return 0;}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }; a=1
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
$as_echo "#define CVD_INTERNAL_NEED_TR1 1" >>confdefs.h

dodginess_options="$dodginess_options tr1_shared_ptr"
fi


if test x$a == x
then
$as_echo "#define CVD_HAVE_SHARED_PTR 1" >>confdefs.h

have_shared_ptr=yes

options="$options shared_ptr"

else
LIBS="$save_LIBS"
CXXFLAGS="$save_CXXFLAGS"
fi
fi

if test "$have_shared_ptr" != yes
then
:

fi




if test "$with_toon" != no && test "$have_toon" != yes
then
if test "$with_toon" == ""
Expand Down Expand Up @@ -6897,32 +6821,6 @@ $as_echo "no" >&6; }; a=1
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test x$a = x1
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for old TooN" >&5
$as_echo_n "checking for old TooN... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <TooN/TooN.h>
int main(){TooN::Vector<2> v;return 0;}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }; a=2
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test x$a = x1
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your version of TooN is too old. You need version 2.0-beta3 or later." >&5
$as_echo "$as_me: WARNING: Your version of TooN is too old. You need version 2.0-beta3 or later." >&2;}
fi
a=1
fi


if test x$a == x
then
Expand Down Expand Up @@ -7690,60 +7588,6 @@ else
a=1
fi

oldpng=0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_set_expand_gray_1_2_4_to_8 in -lpng" >&5
$as_echo_n "checking for png_set_expand_gray_1_2_4_to_8 in -lpng... " >&6; }
if ${ac_cv_lib_png_png_set_expand_gray_1_2_4_to_8+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char png_set_expand_gray_1_2_4_to_8 ();
int
main ()
{
return png_set_expand_gray_1_2_4_to_8 ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_png_png_set_expand_gray_1_2_4_to_8=yes
else
ac_cv_lib_png_png_set_expand_gray_1_2_4_to_8=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_set_expand_gray_1_2_4_to_8" >&5
$as_echo "$ac_cv_lib_png_png_set_expand_gray_1_2_4_to_8" >&6; }
if test "x$ac_cv_lib_png_png_set_expand_gray_1_2_4_to_8" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPNG 1
_ACEOF

LIBS="-lpng $LIBS"

else
oldpng=1
fi

if test $oldpng == 1
then
dodginess_options="$dodginess_options oldpng"
$as_echo "#define CVD_INTERNAL_HAVE_OLD_PNG 1" >>confdefs.h

fi


if test x$a == x
Expand Down Expand Up @@ -8980,6 +8824,9 @@ OFLAGS=$OFLAGS
echo $CXXFLAGS
echo $LIBS


ac_config_headers="$ac_config_headers cvd/config.h"

ac_config_files="$ac_config_files Makefile"

cat >confcache <<\_ACEOF
Expand Down Expand Up @@ -9674,6 +9521,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"cvd/config.h") CONFIG_HEADERS="$CONFIG_HEADERS cvd/config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
Expand Down
40 changes: 2 additions & 38 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ AC_DEFINE_UNQUOTED(CVD_MINOR_VERSION,$cvd_minor)
AC_SUBST(minor, $cvd_minor)



################################################################################
#
#Lists of optional components
Expand Down Expand Up @@ -571,40 +570,10 @@ CHECK_FOR_OPTION(videodisplay,[
])

CHECK_FOR_OPTION(shared_ptr, [
AC_MSG_CHECKING([for shared_ptr])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <memory>
int main(){std::shared_ptr<int> i; return 0;}])], [AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no); a=1])
if test x$a == x1
then
a=0
AC_MSG_CHECKING([for tr1::shared_ptr])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <tr1/memory>
int main(){std::tr1::shared_ptr<int> i; return 0;}])], [AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no); a=1])
AC_DEFINE(CVD_INTERNAL_NEED_TR1)
APPEND(dodginess_options, tr1_shared_ptr)
fi
])


CHECK_FOR_OPTION(toon, [
AC_MSG_CHECKING([for TooN])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <TooN/TooN.h>
int main(){TooN::Vector<2, double> v=TooN::Zeros;return 0;}])], [AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no); a=1])
if test x$a = x1
then
AC_MSG_CHECKING([for old TooN])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <TooN/TooN.h>
int main(){TooN::Vector<2> v;return 0;}])], [AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no); a=2])
if test x$a = x1
then
AC_MSG_WARN([Your version of TooN is too old. You need version 2.0-beta3 or later.])
fi
a=1
fi
])

CHECK_FOR_OPTION(lapack, [
Expand Down Expand Up @@ -675,13 +644,6 @@ CHECK_FOR_OPTION(libuvc, [
CHECK_FOR_OPTION(png, [
AC_CHECK_HEADERS(png.h, [], [a=1])
AC_CHECK_LIB(png, png_init_io, [], [a=1])
oldpng=0
AC_CHECK_LIB(png, png_set_expand_gray_1_2_4_to_8, [], [oldpng=1])
if test $oldpng == 1
then
APPEND(dodginess_options, oldpng)
AC_DEFINE(CVD_INTERNAL_HAVE_OLD_PNG, 1)
fi
])

CHECK_FOR_OPTION(jpeg, [
Expand Down Expand Up @@ -1065,4 +1027,6 @@ AC_SUBST(OFLAGS, $OFLAGS)
echo $CXXFLAGS
echo $LIBS


AC_CONFIG_HEADERS(cvd/config.h)
AC_OUTPUT(Makefile)
2 changes: 0 additions & 2 deletions cvd/Linux/v4lbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#ifndef CVD_V4LBUFFER_H
#define CVD_V4LBUFFER_H

#include <cvd/config.h>

#include <vector>

#include <linux/videodev2.h>
Expand Down
8 changes: 8 additions & 0 deletions cvd/config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef CVD_INCLUDE_CONFIG_H_3216ac8
#define CVD_INCLUDE_CONFIG_H_3216ac8

#undef CVD_HAVE_TOON
#undef CVD_HAVE_JPEG
#undef CVD_HAVE_PNG
#undef CVD_HAVE_TIFF
#endif
92 changes: 0 additions & 92 deletions cvd/cpu_hacks.h

This file was deleted.

Loading

0 comments on commit 1ae6120

Please sign in to comment.