I want to make a note about this diff, it's a major simplification of
the instructions and part of an idea I have to reduce some of the
ifdefs. Of paticular note is the variable $(ARCH_CC) this is a
replacement for the CC="gcc $(64FLAGS)" (a similar definition can also
be used CXX as well) part of the configure line for CLFS arches.
Currently it's defined in the vars subdirectory for the zlib package,
but in an effort to use it more widely across all the Makefiles (where
possible), it would be better to move this to the top level vars.<arch>
file. Another variable that would be useful is $(EXTRA_CONF), for those
packages that need extra flags for a specific arch, no need to use an
ifdef in that case.
The basic point of the idea is to currently replace the ifdefs that are
used in a similar fashion like here with zlib, across all packages
(where possible) down to just the normal configure line with
$(ARCH_CC/CXX) in front and the $(EXTRA_CONF) tacked on the end.
Comments?
Thomas
Modified: trunk/packages/zlib/Makefile
===================================================================
--- trunk/packages/zlib/Makefile 2005-12-18 23:37:34 UTC (rev 1286)
+++ trunk/packages/zlib/Makefile 2005-12-18 23:43:19 UTC (rev 1287)
@@ -8,6 +8,8 @@
URL-$(FILE)= $(HTTP)/$(NM)/$(FILE)
SHA-$(FILE)= 967e280f284d02284b0cd8872a8e2e04bfdc7283
+include $(CROSSVARS)
+
# Targets
include $(ROOT)/scripts/functions
@@ -30,35 +32,17 @@
cp $(SRC)/$(FILE) $(LFSSRC)
compile-stage2:
-ifndef CROSS
- ./configure --prefix=/usr --shared --libdir=/lib
-else
- CC="gcc $(64FLAGS)" CXX="g++ $(64FLAGS)" CFLAGS="${CFLAGS} -fPIC" \
- ./configure --prefix=/usr --shared --libdir=/lib64
-endif
+
+ $(ARCH_CC) $(ARCH_CFLAGS) ./configure --prefix=/usr --shared
--libdir=/$(LIB_MAYBE64)
make $(PM)
make install
-ifndef CROSS
- rm /lib/libz.so
- ln -sf ../../lib/libz.so.$(VRS) /usr/lib/libz.so
-else
- rm /lib64/libz.so
- ln -sf ../../lib64/libz.so.$(VRS) /usr/lib64/libz.so
-endif
+ rm /$(LIB_MAYBE64)/libz.so
+ ln -sf ../../$(LIB_MAYBE64)/libz.so.$(VRS) /usr/$(LIB_MAYBE64)/libz.so
make clean
-ifndef CROSS
- ./configure --prefix=/usr
-else
- CC="gcc $(64FLAGS)" CXX="g++ $(64FLAGS)" ./configure \
- --prefix=/usr --libdir=/usr/lib64
-endif
+ $(ARCH_CC) ./configure --prefix=/usr $(EXTRA_CONF)
make $(PM)
make install
-ifndef CROSS
- chmod 644 /usr/lib/libz.a
-else
- chmod 644 /usr/lib64/libz.a
-endif
+ chmod 644 /usr/$(LIB_MAYBE64)/libz.a
clean:
-rm -rf $(DIR)
Added: trunk/packages/zlib/vars/vars.ppc
===================================================================
Added: trunk/packages/zlib/vars/vars.sparc64
===================================================================
--- trunk/packages/zlib/vars/vars.sparc64 2005-12-18 23:37:34 UTC (rev
1286)
+++ trunk/packages/zlib/vars/vars.sparc64 2005-12-18 23:43:19 UTC (rev
1287)
@@ -0,0 +1,3 @@
+ARCH_CC=CC="gcc $(64FLAGS)"
+ARCH_CFLAGS=CFLAGS="${CFLAGS} -fPIC"
+EXTRA_CONF="--libdir=/usr/lib64"
Added: trunk/packages/zlib/vars/vars.x86
===================================================================
Added: trunk/packages/zlib/vars/vars.x86_64
===================================================================
--- trunk/packages/zlib/vars/vars.x86_64 2005-12-18 23:37:34 UTC (rev
1286)
+++ trunk/packages/zlib/vars/vars.x86_64 2005-12-18 23:43:19 UTC (rev
1287)
@@ -0,0 +1,3 @@
+ARCH_CC=CC="gcc $(64FLAGS)"
+ARCH_CFLAGS=CFLAGS="${CFLAGS} -fPIC"
+EXTRA_CONF="--libdir=/usr/lib64"
--
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page