Apple Enterprise - NeXTanswers Support Archive
Enterprise
[Index]
[Download]


Search NeXTanswers for:

NEXTSTEP


Title: How to build a "foundation.h" header file

Entry Number:

Last Updated: Mar 24 1995
Document Revision:

Keywords:
Foundation Header Files

Question


Q: I want to include all foundation header files in my application, but I can't find "foundation.h" under /NextDeveloper/Headers/foundation. How can I build one?

Answer


A: There is no foundation.h header in EOF 1.0 or EOF 1.1. However, if your app uses EOF classes, you can import eoaccess.h which also includes all the foundation header files.
Another option is to add the following script to EODeveloper.post_install in your EODeveloper.pkg to generate the foundation.h file automatically. Note that you must modify the post_install script before each new installation of EOF.

set foundation = /NextDeveloper/Headers/foundation/foundation
rm -f ${foundation}.h
cd /NextDeveloper/Headers/foundation
ls *.h | awk '{print "#import \"" $1 "\"" }' > ${foundation}.h
echo -n " Precompiling ${foundation}.h ... "
/bin/cc -precomp ${foundation}.h -o ${foundation}.p ${RC_CFLAGS} || exit 1
echo "OK."

If you have already installed EOF, you can still run the following script as root to generate the header file:

echo ""

echo -n " Checking compiler ... "
if ( ! -x /bin/cc ) then
echo "Couldn't find /bin/cc. /bin/cc (in the DeveloperTools package) is required for building precompiled headers."
exit 1
endif
echo "OK."

set arch_type = `/usr/bin/arch`
if ( ${arch_type} == "sparc" ) then
set RC_CFLAGS = "-arch m68k -arch i386 -arch hppa -arch sparc"
else if ( ${arch_type} == "hppa" ) then
set RC_CFLAGS = "-arch m68k -arch i386 -arch hppa"
else
set RC_CFLAGS = "-arch m68k -arch i386"
endif

set foundation = /NextDeveloper/Headers/foundation/foundation
rm -f ${foundation}.h
cd /NextDeveloper/Headers/foundation
ls *.h | awk '{print "#import \"" $1 "\"" }' > ${foundation}.h
echo -n " Precompiling ${foundation}.h ... "
/bin/cc -precomp ${foundation}.h -o ${foundation}.p ${RC_CFLAGS} || exit 1
echo "OK."echo " ... done."
exit 0



Valid for: EOF 1.0, 1.1, NEXTSTEP Developer 3.2, 3.3


OpenStep | Alliances | Training | Tech Support | Where to Buy