Python 2.7 and semaphores
Henry Hu
henry.hu.sh at gmail.com
Sat Oct 25 22:17:12 UTC 2014
On Sat, Oct 25, 2014 at 2:38 PM, George Mitchell <george+freebsd at m5p.com>
wrote:
> In the process of building and trying textproc/meld, I discovered that
> the lang/python27 configure process concludes, erroneously, that FreeBSD
> does not support working Posix semaphores. In particular, this program
> from the configure script was alleged to fail, according to config.log:
>
> #include <unistd.h>
> #include <fcntl.h>
> #include <stdio.h>
> #include <semaphore.h>
> #include <sys/stat.h>
>
> int main(void) {
> sem_t *a = sem_open("/autoconf", O_CREAT, S_IRUSR|S_IWUSR, 0);
> if (a == SEM_FAILED) {
> perror("sem_open");
> return 1;
> }
> sem_close(a);
> sem_unlink("/autoconf");
> return 0;
> }
>
> But when I compiled and ran the program by hand, it worked perfectly.
>
> Then, poking around in lang/python27/Makefile, I found these two lines:
>
> SEM_CONFIGURE_ENV= ac_cv_posix_semaphores_enabled=yes
> SEM_CONFIGURE_ENV_OFF= ac_cv_posix_semaphores_enabled=no
>
> I could not explain why these settings should have any effect on the
> configure and build process, but muttering my most superstitious
> imprecations under my breath I changed "...=no" to "...=yes" in the
> second line and re-installed Python. Lo and behold, configure now
> admitted that Posix semaphores worked, and I could run meld. (Why
> meld needs working semaphores is beyond me, but I'll worry about that
> another day.)
>
> Can anyone explain to me how those lines affect the configure process?
> And does either line belong in the Makefile at this point? -- George
>
There is a config option called "SEM" which enables Posix sem support.
By default it is enabled.
> _______________________________________________
> freebsd-ports at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe at freebsd.org"
>
--
Cheers,
Henry
More information about the freebsd-ports
mailing list