Incomplete configure (autoconfig)

Programming, for all ages and all languages.
Post Reply
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Incomplete configure (autoconfig)

Post by AndrewAPrice »

I'm just wondering, when I call configure (the autoconfig script) and it's checking my system, why do some things say "no" yet the the program still compiles.

e.g.

Code: Select all

checking for sys/file.h... yes
checking for sys/param.h... yes
checking for limits.h... yes
checking for stdlib.h... yes
checking for malloc.h... yes
checking for string.h... yes
checking for unistd.h... yes
checking for strings.h... yes
checking for sys/time.h... yes
checking for time.h... yes
checking for sys/resource.h... yes
checking for sys/stat.h... yes
checking for sys/mman.h... yes
checking for fcntl.h... yes
checking for alloca.h... yes
checking for sys/pstat.h... no
checking for sys/sysmp.h... no
checking for sys/sysinfo.h... no
checking for machine/hal_sysinfo.h... no
checking for sys/table.h... no
checking for sys/sysctl.h... no
checking for sys/systemcfg.h... no
checking for stdint.h... yes
checking for stdio_ext.h... no
Why would it check for "sys/pstat.h" if it didn't depend on it? Yet it compiles fine without it. Does the code change to adapt to not having that file?

I've noticed some other things fail as well, like checking for compiler features or certain functions, yet it still builds.

How are these tests performed:

Code: Select all

checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
By parsing the headers or compiling sample code? (which seems like a lot)

Also, it determined I had a functioning C compiler, then a while later I saw:

Code: Select all

checking for int... yes
!
My OS is Perception.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Incomplete configure (autoconfig)

Post by Combuster »

*recalls gentoo spurting out "removing useless checks" messages prior to calling configure*
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Incomplete configure (autoconfig)

Post by Solar »

MessiahAndrw wrote:Does the code change to adapt to not having that file?
Exactly.
How are these tests performed:
You will find a file "config.log" in your configure directory, which has additional information. This is especially useful if your configure fails, because the error message the configure script gives you might not really reflect the error that has happened...
Every good solution is obvious once you've found it.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Incomplete configure (autoconfig)

Post by bewing »

How are these tests performed:
...

By parsing the headers or compiling sample code? (which seems like a lot)
When a configure script tests for include files and libraries, it uses the "test" command -- just letting the shell determine if the file exists.

For individual compiler features, like the ones you posted -- yes, the configure script creates a tiny little .c program for each feature and compiles it with the compiler that it already detected, and verifies the output. Yes, it IS a lot. Why do you think configure scripts are so slow? :wink:
Post Reply