Skip to content

Commit 4a21ccc

Browse files
author
g_j_m
committed
Fix for ticket #208. configure now accepts an optional
--with-projlibdir option to explicitly set the directory that the proj4 library is in. Fix an error in the summary at the end of the configure run too. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5715 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent dea3bc9 commit 4a21ccc

File tree

1 file changed

+50
-38
lines changed

1 file changed

+50
-38
lines changed

configure.in

+50-38
Original file line numberDiff line numberDiff line change
@@ -112,45 +112,57 @@ AC_ARG_WITH(projdir,
112112
AC_HELP_STRING([--with-projdir=DIR],
113113
[ Proj4 installation directory, e.g. '--with-projdir=/usr/local']),
114114
[
115-
AC_MSG_CHECKING([for Proj4 library in $with_projdir])
116-
if test -d "$with_projdir/lib"; then
117-
LDFLAGS="$LDFLAGS -L$with_projdir/lib"
118-
CPPFLAGS="$CPPFLAGS -I$with_projdir/include"
119-
AC_MSG_RESULT(["$with_projdir exists"])
120-
AC_CHECK_HEADERS(proj_api.h,
121-
[PROJ_INC="-I$with_projdir/include"],
122-
[
123-
AC_MSG_ERROR([*** Proj4 headers not found.])
124-
])
125-
AC_CHECK_LIB(proj,pj_is_latlong,
126-
[
127-
have_proj_lib=yes
128-
PROJ_LIB="-L$with_projdir/lib -lproj"
129-
],
130-
[
131-
AC_MSG_ERROR([*** Proj4 library not found.])
132-
])
133-
else
134-
AC_MSG_ERROR([*** directory $with_projdir does not exist.])
135-
fi
136-
],
115+
if test x"$with_projlibdir" = "x" ; then
116+
AC_MSG_CHECKING([for Proj4 library in $with_projdir/lib])
117+
PROJ_LIB="-L$with_projdir/lib -lproj"
118+
if test -d "$with_projdir/lib" ; then
119+
projlibdir="$with_projdir/lib"
120+
fi
121+
else
122+
AC_MSG_CHECKING([for Proj4 library in $with_projlibdir])
123+
PROJ_LIB="-L$with_projlibdir -lproj"
124+
if test -d "$with_projlibdir" ; then
125+
projlibdir="$with_projlibdir"
126+
fi
127+
fi
128+
129+
if test x"$projlibdir" = "x" ; then
130+
AC_MSG_ERROR([*** directory $projlibdir does not exist.])
131+
else
132+
LDFLAGS="$LDFLAGS $PROJ_LIB"
133+
CPPFLAGS="$CPPFLAGS -I$with_projdir/include"
134+
AC_MSG_RESULT(["$with_projdir exists"])
135+
136+
AC_CHECK_HEADERS(proj_api.h,
137+
[PROJ_INC="-I$with_projdir/include"],
138+
[AC_MSG_ERROR([*** Proj4 headers not found.])])
139+
140+
AC_CHECK_LIB(proj,pj_is_latlong,
141+
[have_proj_lib=yes],
142+
[AC_MSG_ERROR([*** Proj4 library not found.])])
143+
fi
144+
],
145+
137146
[
138-
AC_CHECK_HEADERS(proj_api.h,[PROJ_INC=""],
139-
[
140-
AC_MSG_ERROR([*** Proj4 headers not found.])
141-
])
142-
]
147+
AC_CHECK_HEADERS(proj_api.h,[PROJ_INC=""],
148+
[AC_MSG_ERROR([*** Proj4 headers not found.])])
149+
]
143150
AC_CHECK_LIB(proj,pj_is_latlong,
144-
[
145-
have_proj_lib=yes
146-
PROJ_LIB="-lproj"
147-
],
148-
[
149-
AC_MSG_ERROR([Proj4 is required and was not found.])
150-
])
151-
152-
153-
)
151+
[
152+
have_proj_lib=yes
153+
PROJ_LIB="-lproj"
154+
],
155+
[
156+
AC_MSG_ERROR([Proj4 is required and was not found.])
157+
])
158+
)
159+
160+
dnl A dummy section that's here just to produce some text for the
161+
dnl configure --help output. The actual use of projlibdir is in
162+
dnl the AC_ARG_WITH(projdir) macro
163+
164+
AC_ARG_WITH(projlibdir,AC_HELP_STRING([--with-projlibdir=DIR],
165+
[ Proj4 library directory, optional, use when library is in a different directory to that derived by appending /lib to --with-projdir ]),[],[])
154166

155167
AC_SUBST(PROJ_INC)
156168
AC_SUBST(PROJ_LIB)
@@ -531,7 +543,7 @@ echo "CPPFLAGS : $CPPFLAGS"
531543
echo "CXXFLAGS : $CXXFLAGS"
532544
echo ""
533545
echo "Debug : $ac_debug"
534-
echo "Plugin dir : ${libdir}/$PACKAGE"
546+
echo "Plugin dir : ${prefix}/lib/$PACKAGE"
535547
echo ""
536548
if test "$have_qtmac" = "yes"; then
537549
echo "The binary will be installed in $prefix"

0 commit comments

Comments
 (0)