@@ -112,45 +112,57 @@ AC_ARG_WITH(projdir,
112
112
AC_HELP_STRING([--with-projdir=DIR],
113
113
[ Proj4 installation directory, e.g. '--with-projdir=/usr/local']),
114
114
[
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
+
137
146
[
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
+ ]
143
150
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 ]),[],[])
154
166
155
167
AC_SUBST(PROJ_INC)
156
168
AC_SUBST(PROJ_LIB)
@@ -531,7 +543,7 @@ echo "CPPFLAGS : $CPPFLAGS"
531
543
echo "CXXFLAGS : $CXXFLAGS"
532
544
echo ""
533
545
echo "Debug : $ac_debug"
534
- echo "Plugin dir : ${libdir} /$PACKAGE"
546
+ echo "Plugin dir : ${prefix}/lib /$PACKAGE"
535
547
echo ""
536
548
if test "$have_qtmac" = "yes"; then
537
549
echo "The binary will be installed in $prefix"
0 commit comments