php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #946 Makefile bugs (long!)
Submitted: 1998-11-23 14:16 UTC Modified: 1998-11-24 00:32 UTC
From: ernst at pem dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 3.0.5 OS: SCO OpenServer 5.0.4
Private report: No CVE-ID: None
 [1998-11-23 14:16 UTC] ernst at pem dot com
1) WARNING LEVEL

In the generated Makefile I find:
  WARNING_LEVEL =

Used then as:
  .. -w $(WARNING_LEVEL) ..

This brings an ERROR when the WARNING_LEVEL is empty, like:
  error: illegal warning level: "language-scanner.c"

So I would replace the "WARNING_LEVEL" to:
  WARNING_OPTION = 
  or
  WARNING_OPTION = -Wall
  ...

And use it like:
  .. $(WARNING_OPTION)

----------------------------------------------------------

2) SHELL

When I run the script having a SHELL variable pointing to
a 'csh' Shell, I get the 'make' errors like:

bn=internal_functions.o: Command not found.

(he is trying to set the variable, but the syntax for this
in csh is different).  So simply adding a:

  SHELL=/bin/sh

to the top of the Makefile makes this work like a charm.

----------------------------------------------------------
3) Includes are not quite correct in functions/*.c files:

In functions/adabasd.c:
Now:       #include "php3_string.h"
           #include "functions/head.h"
           #include "adabasd.h"
Should be: #include "functions/php3_string.h"
           #include "functions/head.h"
           #include "functions/adabasd.h"

.... and so on! All includes in 'functions' are not 
referenced by the full relative path. Maybe other
C-Compilers can find those files anyway, but SCO's 'CC'
does not, it really needs the exact path of the file.

Because I didn't wanted to change all files per hand, I 
wrote a script to change all includes to the correct
ones.  I ran this in the 'functions' dir:

#!/bin/sh

set CHANGE=
for include in *.h
do
  CHANGE="$CHANGE;s/\"$include\"/\"functions\/$include\"/g"
done

for file in *.c
do
  echo $file
  sed -e $CHANGE < $file > $file.new
  mv $file.new $file
done

----------------------------------------------------------
4) MySQL

The standard location of the MySQL includes is:
  /usr/local/mysql/include

Instead of the defaults in configure:
  /usr/local/include/mysql

Same goes for the library:
Now:       -L/usr/local/lib/mysql
Should be: -L/usr/local/mysql/lib

And configure does not seem to search for the include and
library files if the MySQL location was not explicitly given.
It assumes the default location and does not check for the
files.

----------------------------------------------------------
5) Things that are not defined (when linking):

 symbol                             in file
php3_dir_module_entry               internal_functions.o
php3_dl                             configuration-parser.tab.o
basic_functions_module              internal_functions.o
php3_filestat_module_entry          internal_functions.o
browser_hash                        configuration-parser.tab.o
php3_std_date                       functions/head.o
alloca                              language-parser.tab.o
browscap_module_entry               internal_functions.o
_php3_sock_fgets                    fopen-wrappers.o
crypt_module_entry                  internal_functions.o
dbm_module_entry                    internal_functions.o
lookup_hostname                     fopen-wrappers.o
_php3_base64_encode                 fopen-wrappers.o
bcmath_module_entry                 internal_functions.o
php3_file_module_entry              internal_functions.o

All those _entry seems to be things declared 'extern' and are
not declared anywhere else. I don't know much of C, but is 
this maybe just a 'hack' for something?  Maybe this could be
rewroten to also work on other 'cc's other then GNUs.

The 'lookup_hostname' is not here. Maybe this can be 
rewritten using the 'gethostbyname' or similar?

Other things I cannot explain, maybe you have some ideas.

----------------------------------------------------------

That's it!  Hope you can include those fixes in the next
version, so SCO Users can compile it 'out-of-the-box'! ;

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-24 00:32 UTC] rasmus
You are wrong on a number of these.  For example, the default install for the source 
distribution of MySQL is definitely /usr/local/include/mysql.  I am looking at the Makefile right now.

And what do you mean by lookup_hostname is not there.  It is in functions/fsock.c in the PHP
distribution.  And the includes are fine.  It sounds to me like you need to get yourself either a
real make program, and/or a real compiler.  Other people have built PHP ok on SCO.

There may be some SCO issues, but submit separate bug reports for each issue and make sure you
look into each one before sending them.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 09 02:01:33 2024 UTC