Skip to content

Commit

Permalink
tidy configure for shipped liblwgeom
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Dec 8, 2018
1 parent f68dda1 commit 1cd8e1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 68 deletions.
63 changes: 3 additions & 60 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3748,66 +3748,9 @@ rm -f geos_test errors.txt geos_test.cpp
OBJECTS="${OBJECTS} \$(OBJECTS_RCPP)"
for ac_header in liblwgeom_internal.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "liblwgeom_internal.h" "ac_cv_header_liblwgeom_internal_h" "$ac_includes_default"
if test "x$ac_cv_header_liblwgeom_internal_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBLWGEOM_INTERNAL_H 1
_ACEOF
lwgeomint=yes
fi
done
if test "${lwgeomint}" = yes; then
PKG_CPPFLAGS="${PKG_CPPFLAGS} -DHAVE_LIBLWGEOM_INTERNAL_H"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_init_plus in -lproj" >&5
$as_echo_n "checking for pj_init_plus in -lproj... " >&6; }
if ${ac_cv_lib_proj_pj_init_plus+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lproj $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 pj_init_plus ();
int
main ()
{
return pj_init_plus ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_proj_pj_init_plus=yes
else
ac_cv_lib_proj_pj_init_plus=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_proj_pj_init_plus" >&5
$as_echo "$ac_cv_lib_proj_pj_init_plus" >&6; }
if test "x$ac_cv_lib_proj_pj_init_plus" = xyes; then :
PKG_LIBS="${PKG_LIBS} -lproj"
else
as_fn_error $? "libproj not found a standard locations." "$LINENO" 5
fi
#AC_CHECK_LIB(proj, pj_init_plus,
# AC_SUBST([PKG_LIBS], ["${PKG_LIBS} -lproj"]),
# AC_MSG_ERROR([libproj not found a standard locations.]))
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GEOS_init_r in -lgeos_c" >&5
$as_echo_n "checking for GEOS_init_r in -lgeos_c... " >&6; }
Expand Down
11 changes: 3 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,9 @@ rm -f geos_test errors.txt geos_test.cpp
#
AC_SUBST([OBJECTS], ["${OBJECTS} \$(OBJECTS_RCPP)"])

AC_CHECK_HEADERS(liblwgeom_internal.h,lwgeomint=yes)
if test "${lwgeomint}" = yes; then
AC_SUBST([PKG_CPPFLAGS], ["${PKG_CPPFLAGS} -DHAVE_LIBLWGEOM_INTERNAL_H"])
fi

AC_CHECK_LIB(proj, pj_init_plus,
AC_SUBST([PKG_LIBS], ["${PKG_LIBS} -lproj"]),
AC_MSG_ERROR([libproj not found a standard locations.]))
#AC_CHECK_LIB(proj, pj_init_plus,
# AC_SUBST([PKG_LIBS], ["${PKG_LIBS} -lproj"]),
# AC_MSG_ERROR([libproj not found a standard locations.]))

AC_CHECK_LIB(geos_c, GEOS_init_r,
AC_SUBST([PKG_LIBS], ["${PKG_LIBS} -lgeos_c"]),
Expand Down

0 comments on commit 1cd8e1b

Please sign in to comment.