sid24ss / distcc

Automatically exported from code.google.com/p/distcc
GNU General Public License v2.0
0 stars 0 forks source link

build fails when popt.h is present but libopt is not. #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
configure doesn't correctly handle the case where popt.h is present but
libopt is not.

(This issue is extracted from issue 30.)

So I tried to compile distcc by hand, but then there several failures due
to the fact that I did not say --with-include-popt, so configure.ac decided, 
without even checking, to add -lpopt to all the compilations, which results
in several functions not being correctly detected as present:

configure:7042: checking for strsep
configure:7099: ccache i686-apple-darwin9-gcc-4.0.1 -o conftest -g -O2 -MD
-W -Wall -Wimplicit -Wshadow -Wpointer-arith -Wcast-align -
Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wnested-externs -Wmissing-declarations -Wuninitialized  -isystem 
/opt/local/include -DHAVE_CONFIG_H -D_GNU_SOURCE  conftest.c  -lpopt >&5
conftest.c:60: warning: function declaration isn't a prototype
conftest.c:67: warning: function declaration isn't a prototype
conftest.c:75: warning: function declaration isn't a prototype
ld: library not found for -lpopt
collect2: ld returned 1 exit status
distcc[56012] ERROR: compile conftest.c on localhost failed
configure:7105: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "distcc"
| #define PACKAGE_TARNAME "distcc"
| #define PACKAGE_VERSION "3.1"
| #define PACKAGE_STRING "distcc 3.1"
| #define PACKAGE_BUGREPORT "distcc@lists.samba.org"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_SIGNAL_H 1
| #define HAVE_CTYPE_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_ARPA_NAMESER_H 1
| #define HAVE_RESOLV_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_FNMATCH_H 1
| #define HAVE_IN_PORT_T 1
| #define HAVE_IN_ADDR_T 1
| #define RETSIGTYPE void
| /* end confdefs.h.  */
| /* Define strsep to an innocuous variant, in case <limits.h> declares strsep.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define strsep innocuous_strsep
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char strsep (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef strsep
| 
| /* 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 strsep ();
| /* 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_strsep) || defined (__stub___strsep)
| choke me
| #else
| char (*f) () = strsep;
| #endif
| #ifdef __cplusplus
| }
| #endif
| 
| int
| main ()
| {
| return f != strsep;
|   ;
|   return 0;
| }
configure:7129: result: no

But my machine does have strsep, and therefore, later:

ccache i686-apple-darwin9-gcc-4.0.1 -isystem /opt/local/include
-DHAVE_CONFIG_H -D_GNU_SOURCE -DSYSCONFDIR="\"/usr/local/etc\"" -
DPKGDATADIR="\"/usr/local/share/distcc\"" -Isrc -I"../../src" -I"../../lzo"
 -Werror -g -O2 -MD -W -Wall -Wimplicit -Wshadow -Wpointer-arith -
Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes
-Wmissing-prototypes -Wnested-externs -Wmissing-declarations -
Wuninitialized  -o src/util.o -c ../../src/util.c
distcc[57093] ERROR: compile
/Users/akim/.ccache/util.tmp.montero.gostai.ensta.fr.57089.i on localhost
failed
distcc[57089] Warning: INCLUDE_SERVER_PORT not set - did you forget to run
under 'pump'?
distcc[57089] (dcc_build_somewhere) Warning: failed to get includes from
include server, preprocessing locally
distcc[57089] ERROR: compile ../../src/util.c on bf-macintel-1/4,cpp failed
distcc[57089] (dcc_build_somewhere) Warning: remote compilation of
'../../src/util.c' failed, retrying locally
distcc[57089] Warning: failed to distribute ../../src/util.c to
bf-macintel-1/4,cpp, running locally instead
../../src/util.c:721: error: static declaration of 'strsep' follows
non-static declaration
/usr/include/string.h:135: error: previous declaration of 'strsep' was here
distcc[57089] ERROR: compile ../../src/util.c on localhost failed
make: *** [src/util.o] Error 1
Compilation FAILED: /tmp/distcc-3.1: build-for-darwin  exit 2

So I'll start again with the needed flags, but can I suggest to
AC_CHECK_LIBS first whether popt is present before deciding not to use the
provided one?  
That's much nicer to the user IMHO.

Original issue reported on code.google.com by fergus.h...@gmail.com on 18 Dec 2008 at 6:48

GoogleCodeExporter commented 9 years ago
How about this patch?

Original comment by mand...@gmail.com on 3 Mar 2014 at 5:03

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r796.

Original comment by mand...@gmail.com on 29 Jul 2014 at 5:43