diff -ru apt-0.6.46.4.1/apt-inst/deb/dpkgdb.cc apt-0.6.46.4.1+iPhone/apt-inst/deb/dpkgdb.cc
--- apt-0.6.46.4.1/apt-inst/deb/dpkgdb.cc	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-inst/deb/dpkgdb.cc	2007-12-31 01:46:53.000000000 +0000
@@ -26,6 +26,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
 #include <fcntl.h>
diff -ru apt-0.6.46.4.1/buildlib/environment.mak.in apt-0.6.46.4.1+iPhone/buildlib/environment.mak.in
--- apt-0.6.46.4.1/buildlib/environment.mak.in	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/buildlib/environment.mak.in	2007-12-29 10:58:41.000000000 +0000
@@ -62,11 +62,11 @@
 
 # Shared library things
 HOST_OS = @host_os@
-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
-   SONAME_MAGIC=-Wl,-soname -Wl,
+#ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
+   SONAME_MAGIC=
    LFLAGS_SO=
-else
+#else
    # Do not know how to create shared libraries here.
-   ONLYSTATICLIBS = yes
-endif
+#   ONLYSTATICLIBS = yes
+#endif
 	
diff -r -u apt-0.6.46.4/apt-inst/makefile apt-0.6.46.4.1+iPhone/apt-inst/makefile
--- apt-0.6.46.4/apt-inst/makefile	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-inst/makefile	2007-12-25 06:42:18.000000000 +0000
@@ -11,7 +11,8 @@
 
 # The library name
 LIBRARY=apt-inst
-LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+LIBEXT=
+#$(GLIBC_VER)$(LIBSTDCPP_VER)
 MAJOR=1.1
 MINOR=0
 SLIBS=$(PTHREADLIB) -lapt-pkg
diff -r -u apt-0.6.46.4/apt-pkg/deb/dpkgpm.cc apt-0.6.46.4.1+iPhone/apt-pkg/deb/dpkgpm.cc
--- apt-0.6.46.4/apt-pkg/deb/dpkgpm.cc	2006-12-04 16:33:53.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-pkg/deb/dpkgpm.cc	2007-12-24 11:22:47.000000000 +0000
@@ -511,6 +511,8 @@
       clog << flush;
       cerr << flush;
 
+      typedef void (*sighandler_t)(int);
+
       /* Mask off sig int/quit. We do this because dpkg also does when 
          it forks scripts. What happens is that when you hit ctrl-c it sends
 	 it to all processes in the group. Since dpkg ignores the signal 
diff -r -u apt-0.6.46.4/apt-pkg/init.cc apt-0.6.46.4.1+iPhone/apt-pkg/init.cc
--- apt-0.6.46.4/apt-pkg/init.cc	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-pkg/init.cc	2007-12-25 05:36:40.000000000 +0000
@@ -95,14 +95,6 @@
    if (Cnf.FindB("Debug::pkgInitConfig",false) == true)
       Cnf.Dump();
    
-#ifdef APT_DOMAIN
-   if (Cnf.Exists("Dir::Locale"))
-   {  
-      bindtextdomain(APT_DOMAIN,Cnf.FindDir("Dir::Locale").c_str());
-      bindtextdomain(textdomain(0),Cnf.FindDir("Dir::Locale").c_str());
-   }
-#endif
-   
    return true;
 }
 									/*}}}*/
diff -r -u apt-0.6.46.4/apt-pkg/makefile apt-0.6.46.4.1+iPhone/apt-pkg/makefile
--- apt-0.6.46.4/apt-pkg/makefile	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/apt-pkg/makefile	2007-12-25 06:42:27.000000000 +0000
@@ -12,7 +12,8 @@
 # The library name, don't forget to update init.h and the copy in 
 # methods/makefile - FIXME
 LIBRARY=apt-pkg
-LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
+LIBEXT=
+#$(GLIBC_VER)$(LIBSTDCPP_VER)
 MAJOR=3.11
 MINOR=0
 SLIBS=$(PTHREADLIB) $(INTLLIBS)
diff -r -u apt-0.6.46.4/buildlib/podomain.mak apt-0.6.46.4.1+iPhone/buildlib/podomain.mak
--- apt-0.6.46.4/buildlib/podomain.mak	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/buildlib/podomain.mak	2007-12-25 06:41:16.000000000 +0000
@@ -14,7 +14,8 @@
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: SRC := $(addprefix $(SUBDIR)/,$(SOURCE))
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: makefile
 	(echo $(SRC) | xargs -n1 echo) > $@
-binary program clean: $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
+binary program clean:
+#$(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
 
 veryclean: veryclean/$(LOCAL)
 veryclean/po/$(LOCAL): LIST := $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
diff -r -u apt-0.6.46.4/buildlib/program.mak apt-0.6.46.4.1+iPhone/buildlib/program.mak
--- apt-0.6.46.4/buildlib/program.mak	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/buildlib/program.mak	2007-12-25 05:26:04.000000000 +0000
@@ -44,6 +44,7 @@
 # The binary build rule
 $($(LOCAL)-BIN): $($(LOCAL)-OBJS) $($(LOCAL)-MKS)
 	echo Building program $@
+	echo $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LFLAGS) -o $@ $(filter %.o,$^) $($(@F)-SLIBS) $(LEFLAGS)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LFLAGS) -o $@ $(filter %.o,$^) $($(@F)-SLIBS) $(LEFLAGS)
 
 # Compilation rules
diff -r -u apt-0.6.46.4/cmdline/apt-cache.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc
--- apt-0.6.46.4/cmdline/apt-cache.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cache.cc	2007-12-25 03:50:15.000000000 +0000
@@ -1748,7 +1752,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-cdrom.cc apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc
--- apt-0.6.46.4/cmdline/apt-cdrom.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-cdrom.cc	2007-12-25 03:50:24.000000000 +0000
@@ -188,7 +192,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-config.cc apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc
--- apt-0.6.46.4/cmdline/apt-config.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-config.cc	2007-12-25 03:50:35.000000000 +0000
@@ -103,7 +107,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-extracttemplates.cc apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc
--- apt-0.6.46.4/cmdline/apt-extracttemplates.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-extracttemplates.cc	2007-12-25 03:50:39.000000000 +0000
@@ -361,7 +365,7 @@
 
 	// Set up gettext support
 	setlocale(LC_ALL,"");
-	textdomain(PACKAGE);
+	//textdomain(PACKAGE);
 
 	// Parse the command line and initialize the package library
 	CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/cmdline/apt-get.cc apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc
--- apt-0.6.46.4/cmdline/apt-get.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-get.cc	2007-12-26 09:03:07.000000000 +0000
@@ -62,12 +62,13 @@
 #include <sys/wait.h>
 									/*}}}*/
 
+#define _trace() printf("_trace(%s:%d)\n", __FILE__, __LINE__)
+
 using namespace std;
 
 ostream c0out(0);
 ostream c1out(0);
 ostream c2out(0);
-ofstream devnull("/dev/null");
 unsigned int ScreenWidth = 80 - 1; /* - 1 for the cursor */
 
 // class CacheFile - Cover class for some dependency cache functions	/*{{{*/
@@ -2560,7 +2565,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
@@ -2588,6 +2593,9 @@
    if (!isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
       _config->Set("quiet","1");
 
+   ofstream devnull;
+   devnull.open("/dev/null");
+
    // Setup the output streams
    c0out.rdbuf(cout.rdbuf());
    c1out.rdbuf(cout.rdbuf());
diff -r -u apt-0.6.46.4/cmdline/apt-sortpkgs.cc apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc
--- apt-0.6.46.4/cmdline/apt-sortpkgs.cc	2006-12-04 14:37:35.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/cmdline/apt-sortpkgs.cc	2007-12-25 03:50:52.000000000 +0000
@@ -174,7 +178,7 @@
 
    // Set up gettext support
    setlocale(LC_ALL,"");
-   textdomain(PACKAGE);
+   //textdomain(PACKAGE);
 
    // Parse the command line and initialize the package library
    CommandLine CmdL(Args,_config);
diff -r -u apt-0.6.46.4/ftparchive/cachedb.cc apt-0.6.46.4.1+iPhone/ftparchive/cachedb.cc
--- apt-0.6.46.4/ftparchive/cachedb.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/ftparchive/cachedb.cc	2007-12-24 11:27:03.000000000 +0000
@@ -319,6 +319,14 @@
    } 
 }
 
+void *memrchr(void *data, char value, int size) {
+    char *cdata = (char *) data;
+    for (int i = 0; i != size; ++i)
+        if (cdata[size - i - 1] == value)
+            return cdata + size - i - 1;
+    return NULL;
+}
+
 // CacheDB::GetMD5 - Get the MD5 hash					/*{{{*/
 // ---------------------------------------------------------------------
 /* */
diff -r -u apt-0.6.46.4/ftparchive/contents.cc apt-0.6.46.4.1+iPhone/ftparchive/contents.cc
--- apt-0.6.46.4/ftparchive/contents.cc	2006-12-04 14:37:36.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/ftparchive/contents.cc	2007-12-24 11:27:23.000000000 +0000
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>    
+#include <memory.h>    
 									/*}}}*/
 
 // GenContents::~GenContents - Free allocated memory			/*{{{*/
diff -r -u apt-0.6.46.4/Makefile apt-0.6.46.4.1+iPhone/Makefile
--- apt-0.6.46.4/Makefile	2006-12-04 14:37:34.000000000 +0000
+++ apt-0.6.46.4.1+iPhone/Makefile	2007-12-25 05:49:13.000000000 +0000
@@ -18,7 +18,6 @@
 	$(MAKE) -C ftparchive $@
 	$(MAKE) -C dselect $@
 	$(MAKE) -C doc $@
-	$(MAKE) -C po $@
 
 # Some very common aliases
 .PHONY: maintainer-clean dist-clean distclean pristine sanity