[PHP-DEV] Bug #946: Makefile bugs (long!) From: ernst <email protected>
Date: 11/23/98

From: ernst <email protected>
Operating system: SCO OpenServer 5.0.4
PHP version: 3.0.5
PHP Bug Type: Compile Failure
Bug description: Makefile bugs (long!)

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'! ;

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>